| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
require_once 'System.php';
|
|
|
4 |
require_once 'File/Gettext.php';
|
|
|
5 |
require_once 'I18Nv2/Locale.php';
|
|
|
6 |
|
|
|
7 |
$l = &new I18Nv2_Locale('en');
|
|
|
8 |
$g = &File_Gettext::factory('MO');
|
|
|
9 |
|
|
|
10 |
$g->meta = array('Content-Type' => 'text/plain; charset=iso-8859-1');
|
|
|
11 |
|
|
|
12 |
$langs = array('en', 'de', 'it');
|
|
|
13 |
foreach ($langs as $lang) {
|
|
|
14 |
$l->setLocale($lang);
|
|
|
15 |
$g->strings = array();
|
|
|
16 |
foreach (range(0, 6) as $day) {
|
|
|
17 |
$g->strings["day_$day"] = $l->dayName($day);
|
|
|
18 |
}
|
|
|
19 |
foreach (range(0, 11) as $month) {
|
|
|
20 |
$g->strings[sprintf('month_%02d', $month + 1)] = $l->monthName($month);
|
|
|
21 |
}
|
|
|
22 |
$g->strings['nasty ampersand'] = 'lean & mean';
|
|
|
23 |
System::mkdir(array('-p', $dir = 'locale/'. $lang .'/LC_MESSAGES/'));
|
|
|
24 |
$g->save($dir . 'calendar.mo');
|
|
|
25 |
}
|
|
|
26 |
$g->strings = array('alone' => 'solo soletto');
|
|
|
27 |
$g->save('locale/it/LC_MESSAGES/alone.mo');
|
|
|
28 |
|
|
|
29 |
?>
|