Subversion Repositories oidplus

Rev

Rev 624 | Rev 635 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 624 Rev 632
Line 30... Line 30...
30
$dir = __DIR__ . '/../../';
30
$dir = __DIR__ . '/../../';
31
 
31
 
32
// ---
32
// ---
33
 
33
 
34
$langs = array();
34
$langs = array();
35
$tmp = glob($dir.'/plugins/language/*/messages.xml');
35
$tmp1 = glob($dir.'/plugins/language/'.'*'.'/messages.xml');
-
 
36
$tmp2 = glob($dir.'/plugins/_thirdParty/'.'*'.'/language/'.'*'.'/messages.xml');
-
 
37
$tmp = array_merge($tmp1, $tmp2);
36
foreach ($tmp as $tmp2) {
38
foreach ($tmp as $tmp2) {
37
        $tmp3 = explode('/', $tmp2);
39
        $tmp3 = explode('/', $tmp2);
38
        $lang = $tmp3[count($tmp3)-2];
40
        $lang = $tmp3[count($tmp3)-2];
39
        if ($lang == 'enus') continue; // ignore base lang
41
        if ($lang == 'enus') continue; // ignore base lang
40
        $langs[] = $lang;
42
        $langs[] = $lang;
Line 79... Line 81...
79
 
81
 
80
// ---
82
// ---
81
 
83
 
82
foreach ($langs as $lang) {
84
foreach ($langs as $lang) {
83
        $translation_array = array();
85
        $translation_array = array();
-
 
86
        $translation_files = array_merge(
84
        $translation_file = $dir.'/plugins/language/'.$lang.'/messages.xml';
87
                glob($dir.'/plugins/language/'.$lang.'/messages.xml'),
-
 
88
                glob($dir.'/plugins/_thirdParty/'.'*'.'/language/'.$lang.'/messages.xml')
-
 
89
        );
-
 
90
        $translation_file = count($translation_files) > 0 ? $translation_files[0] : null;
85
        if (file_exists($translation_file)) {
91
        if (file_exists($translation_file)) {
86
        $xml = simplexml_load_string(file_get_contents($translation_file));
92
                $xml = simplexml_load_string(file_get_contents($translation_file));
87
        if (!$xml) {
93
                if (!$xml) {
88
                echo "STOP: Cannot load $translation_file\n";
94
                        echo "STOP: Cannot load $translation_file\n";
89
                continue;
95
                        continue;