r113314 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113313‎ | r113314 | r113315 >
Date:22:55, 7 March 2012
Author:krinkle
Status:deferred
Tags:
Comment:
[TsIntution] Fix typo in file name
- Poke r91589, r90764
Modified paths:
  • /trunk/tools/ToolserverI18N/scripts/getFalbacks.php (deleted) (history)
  • /trunk/tools/ToolserverI18N/scripts/getFallbacks.php (added) (history)

Diff [purge]

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
135 + native

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90764getFallbacks.php: Get fallbacks from MediaWiki Core...jan10:35, 25 June 2011
r91589Minor fixes and follow-up to r91439 (Integration of PLURAL / MediaWiki langua...krinkle19:39, 6 July 2011

Status & tagging log