Index: trunk/tools/ToolserverI18N/scripts/getFalbacks.php |
— | — | @@ -1,33 +0,0 @@ |
2 | | -<?PHP |
3 | | -/** |
4 | | - * |
5 | | - * Get fallbacks from MediaWiki Core. |
6 | | - * @author Jan Luca <jan@toolserver.org> |
7 | | - */ |
8 | | - |
9 | | -$dir = "<path to messages dir of MediaWiki>"; |
10 | | -$files = scandir( $dir ); |
11 | | - |
12 | | -$output = fopen("output.php", "w"); |
13 | | - |
14 | | -$reg = "@fallback \\= \\'(.*?)\\'\\;@i"; |
15 | | - |
16 | | -foreach( $files as $file ) { |
17 | | - if( $file == "." || $file == ".." || $file == ".svn" ) { |
18 | | - continue; |
19 | | - } |
20 | | - |
21 | | - $file = $dir."/".$file; |
22 | | - |
23 | | - $content = file_get_contents( $file ); |
24 | | - |
25 | | - if( !$content ) die("Error: " . $file); |
26 | | - |
27 | | - if( preg_match( $reg, $content, $match ) ) { |
28 | | - $fallback_lang = $match[1]; |
29 | | - preg_match("@Messages(.*?)\\.php@", $file, $file_match); |
30 | | - $source_lang = $file_match[1]; |
31 | | - $source_lang = strtolower($source_lang); |
32 | | - fwrite($output, "'".$source_lang."' => '".$fallback_lang."',\n"); |
33 | | - } |
34 | | -} |
\ No newline at end of file |
Index: trunk/tools/ToolserverI18N/scripts/getFallbacks.php |
— | — | @@ -0,0 +1,33 @@ |
| 2 | +<?PHP |
| 3 | +/** |
| 4 | + * |
| 5 | + * Get fallbacks from MediaWiki Core. |
| 6 | + * @author Jan Luca <jan@toolserver.org> |
| 7 | + */ |
| 8 | + |
| 9 | +$dir = "<path to messages dir of MediaWiki>"; |
| 10 | +$files = scandir( $dir ); |
| 11 | + |
| 12 | +$output = fopen("output.php", "w"); |
| 13 | + |
| 14 | +$reg = "@fallback \\= \\'(.*?)\\'\\;@i"; |
| 15 | + |
| 16 | +foreach( $files as $file ) { |
| 17 | + if( $file == "." || $file == ".." || $file == ".svn" ) { |
| 18 | + continue; |
| 19 | + } |
| 20 | + |
| 21 | + $file = $dir."/".$file; |
| 22 | + |
| 23 | + $content = file_get_contents( $file ); |
| 24 | + |
| 25 | + if( !$content ) die("Error: " . $file); |
| 26 | + |
| 27 | + if( preg_match( $reg, $content, $match ) ) { |
| 28 | + $fallback_lang = $match[1]; |
| 29 | + preg_match("@Messages(.*?)\\.php@", $file, $file_match); |
| 30 | + $source_lang = $file_match[1]; |
| 31 | + $source_lang = strtolower($source_lang); |
| 32 | + fwrite($output, "'".$source_lang."' => '".$fallback_lang."',\n"); |
| 33 | + } |
| 34 | +} |
\ No newline at end of file |
Property changes on: trunk/tools/ToolserverI18N/scripts/getFallbacks.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 35 | + native |