Subversion Repositories oidplus

Rev

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

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