Changeset 368
- Timestamp:
- 04/28/08 20:04:34 (2 years ago)
- Files:
-
- trunk/uploadr/strings_import.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/uploadr/strings_import.php
r332 r368 4 4 5 5 $locale = dirname(__FILE__) . '/MacUploadr.app/Contents/Resources/chrome/locale'; 6 7 if (count($_GET)){ 8 $argv = array_keys($_GET); 9 array_unshift($argv, 'foo.php'); 10 } 11 6 12 7 13 # Gotta have a source folder for all those other languages … … 13 19 foreach (array('de-de', 'es-us', 'fr-fr', 'it-it', 'ko-kr', 'pt-br', 'zh-hk') as $l) { 14 20 $dir = opendir("$argv[1]/$l"); 21 if (!$dir) die; 15 22 while (false !== $file = readdir($dir)) { 16 23 … … 32 39 continue; 33 40 } 34 $text = trim( str_replace("\n\n", "\n", preg_replace('/^<\?php.*\?>$/ms', '', $text)));41 $text = trim(preg_replace('/^<\?php.*\?>$/ms', '', $text)); 35 42 36 43 # Process each string … … 74 81 continue; 75 82 } 76 if (false === fwrite($file_p, implode("\n", 77 array_diff($lines, array(''))))) { 83 if (false === fwrite($file_p, implode("\n", $lines))) { 78 84 echo "[error] Writing $file\n"; 79 85 } … … 82 88 } 83 89 90 echo "[ok] finished writing $l/$file\n"; 84 91 } 85 92 closedir($dir);