Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
require_once 'Translation2.php';
3
require_once 'Translation2/Admin.php';
4
require_once 'I18Nv2/Locale.php';
5
 
6
PEAR::setErrorHandling(PEAR_ERROR_DIE);
7
 
8
$options = array(
9
    'langs_avail_file'  => 'gettext_langs.ini',
10
    'domains_path_file' => 'gettext_domains.ini',
11
    'default_domain'    => 'admin'
12
);
13
 
14
$tr = &Translation2_Admin::factory('gettext', $options, array('prefetch' => false));
15
 
16
$langs = $tr->getLangs('ids');
17
$days  = array();
18
$months= array();
19
 
20
$lc = &new I18Nv2_Locale;
21
 
22
foreach ($langs as $lang) {
23
    $lc->setLocale($lang);
24
    foreach (range(0,6) as $day) {
25
        $days[$day][$lang] = $lc->dayName($day);
26
    }
27
    foreach (range(0,11) as $month) {
28
        $months[$month][$lang] = $lc->monthName($month);
29
    }
30
}
31
 
32
$tr->storage->begin();
33
foreach ($langs as $lang) {
34
    foreach (range(0,6) as $day) {
35
        $tr->add('day_'. sprintf('%02d', $day), null, $days[$day]);
36
    }
37
    foreach (range(0,11) as $month) {
38
        $tr->add('month_'. sprintf('%02d', $month), null, $months[$month]);
39
    }
40
}
41
$tr->storage->commit();
42
 
43
foreach ($langs as $lang) {
44
    foreach (range(0,6) as $day) {
45
        echo "$lang day $day: ", $tr->get('day_'. sprintf('%02d', $day), null, $lang), "\n";
46
    }
47
    foreach (range(0,11) as $month) {
48
        echo "$lang month $month: ", $tr->get('month_'. sprintf('%02d', $month), null, $lang), "\n";
49
    }
50
    echo "\n";
51
}
52
?>