Rev 632 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 632 | Rev 635 | ||
---|---|---|---|
Line 24... | Line 24... | ||
24 | $dir = __DIR__ . '/../../'; |
24 | $dir = __DIR__ . '/../../'; |
25 | 25 | ||
26 | // --- |
26 | // --- |
27 | 27 | ||
28 | $langs = array(); |
28 | $langs = array(); |
29 | $tmp1 = glob($dir.'/plugins/language/'.'*'.'/messages.xml'); |
29 | $tmp = glob($dir.'/plugins/'.'*'.'/language/'.'*'.'/messages.xml'); |
30 | $tmp2 = glob($dir.'/plugins/_thirdParty/'.'*'.'/language/'.'*'.'/messages.xml'); |
- | |
31 | $tmp = array_merge($tmp1, $tmp2); |
- | |
32 | foreach ($tmp as $tmp2) { |
30 | foreach ($tmp as $tmp2) { |
33 | $tmp3 = explode('/', $tmp2); |
31 | $tmp3 = explode('/', $tmp2); |
34 | $lang = $tmp3[count($tmp3)-2]; |
32 | $lang = $tmp3[count($tmp3)-2]; |
35 | if ($lang == 'enus') continue; // ignore base lang |
33 | if ($lang == 'enus') continue; // ignore base lang |
36 | $langs[] = $lang; |
34 | $langs[] = $lang; |
Line 66... | Line 64... | ||
66 | 64 | ||
67 | // --- |
65 | // --- |
68 | 66 | ||
69 | foreach ($langs as $lang) { |
67 | foreach ($langs as $lang) { |
70 | $all_strings = array(); |
68 | $all_strings = array(); |
71 | $translation_files = array_merge( |
- | |
72 | glob($dir.'/plugins/language/'.$lang.'/messages.xml'), |
69 | $translation_files = glob($dir.'/plugins/'.'*'.'/language/'.$lang.'/messages.xml'); |
73 | glob($dir.'/plugins/_thirdParty/'.'*'.'/language/'.$lang.'/messages.xml') |
- | |
74 | ); |
- | |
75 | $translation_file = count($translation_files) > 0 ? $translation_files[0] : null; |
70 | $translation_file = count($translation_files) > 0 ? $translation_files[0] : null; |
76 | if (file_exists($translation_file)) { |
71 | if (file_exists($translation_file)) { |
77 | $xml = simplexml_load_string(file_get_contents($translation_file)); |
72 | $xml = simplexml_load_string(file_get_contents($translation_file)); |
78 | if (!$xml) { |
73 | if (!$xml) { |
79 | echo "STOP: Cannot load $translation_file\n"; |
74 | echo "STOP: Cannot load $translation_file\n"; |