summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiebrand Mazeland <s.mazeland@xs4all.nl>2009-11-06 16:40:54 +0100
committerSiebrand Mazeland <s.mazeland@xs4all.nl>2009-11-06 16:40:54 +0100
commit8beef3eab3db4e60da56cd5f535c3eae2f2f5283 (patch)
tree6a19e66993861ab47bfab9c2c6d66c034f474557
parent0994fa31d6281167f410b659761ceb332ace7913 (diff)
* add language code conversion for translatewiki.net where needed
* skip update of code 'en' (as English is the source language)
-rwxr-xr-xscripts/update_translations.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/scripts/update_translations.php b/scripts/update_translations.php
index 4f3ebb1a2..88780898d 100755
--- a/scripts/update_translations.php
+++ b/scripts/update_translations.php
@@ -39,12 +39,28 @@ set_time_limit(60);
$languages = get_all_languages();
/* Update the languages */
+// Language code conversion for translatewiki.net
+$codeMap = array(
+ 'nb' => 'no',
+ 'pt_BR' => 'pt-br',
+ 'zh_CN' => 'zh-hans',
+ 'zh_TW' => 'zh-hant'
+);
foreach ($languages as $language) {
+ $code = $language['lang'];
- $code = $language['lang'];
+ // Skip export of source language
+ if( $language == 'en' ) {
+ continue;
+ }
- // Fetch updates from TranslateWiki...
+ // Convert code if needed
+ if( isset( $codeMap[$code] ) ) {
+ $code = $codeMap[$code];
+ }
+
+ // Fetch updates from translatewiki.net...
$twcode = str_replace('_', '-', strtolower($code)); // pt_BR -> pt-br
$file_url = 'http://translatewiki.net/w/i.php?' .
http_build_query(array(