summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSiebrand Mazeland <s.mazeland@xs4all.nl>2009-11-06 16:53:07 +0100
committerSiebrand Mazeland <s.mazeland@xs4all.nl>2009-11-06 16:53:07 +0100
commit814b513aa5d86a38e7b6db220d36fca253bdabfe (patch)
tree6436ed7bdd8fa6325b0b7d82a7cebc92a18cbd90 /scripts
parent8beef3eab3db4e60da56cd5f535c3eae2f2f5283 (diff)
Fix a few bugs I added in previous revision
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/update_translations.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/update_translations.php b/scripts/update_translations.php
index 88780898d..88b85dc12 100755
--- a/scripts/update_translations.php
+++ b/scripts/update_translations.php
@@ -39,7 +39,7 @@ set_time_limit(60);
$languages = get_all_languages();
/* Update the languages */
-// Language code conversion for translatewiki.net
+// Language code conversion for translatewiki.net (these are MediaWiki codes)
$codeMap = array(
'nb' => 'no',
'pt_BR' => 'pt-br',
@@ -51,17 +51,19 @@ foreach ($languages as $language) {
$code = $language['lang'];
// Skip export of source language
- if( $language == 'en' ) {
+ // and duplicates
+ if( $code == 'en' || $code = 'no' ) {
continue;
}
// Convert code if needed
if( isset( $codeMap[$code] ) ) {
- $code = $codeMap[$code];
+ $twnCode = $codeMap[$code];
+ } else {
+ $twnCode = str_replace('_', '-', strtolower($code)); // pt_BR -> pt-br
}
// 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(
'title' => 'Special:Translate',