]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Do not export codes twice
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Fri, 6 Nov 2009 17:49:42 +0000 (18:49 +0100)
committerSiebrand Mazeland <s.mazeland@xs4all.nl>
Fri, 6 Nov 2009 17:49:42 +0000 (18:49 +0100)
scripts/update_translations.php

index baa377caca6cae53d7317072e25cd0d152c793be..580c472eef0e5049f64d58946a08a5ab0505f59b 100755 (executable)
@@ -47,6 +47,8 @@ $codeMap = array(
        'zh_TW' => 'zh-hant'
 );
 
+$doneCodes = array();
+
 foreach ($languages as $language) {
        $code = $language['lang'];
 
@@ -56,6 +58,13 @@ foreach ($languages as $language) {
                continue;
        }
 
+       // Do not export codes twice (happens for 'nb')
+       if( in_array( $code, $doneCodes ) ) {
+               continue;
+       } else {
+               $doneCodes[] = $code;
+       }
+
        // Convert code if needed
        if( isset( $codeMap[$code] ) ) {
                $twnCode = $codeMap[$code];