+ $code = $language['lang'];
+
+ // Skip export of source language
+ // and duplicates
+ if( $code == 'en' || $code == 'no' ) {
+ 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];
+ } else {
+ $twnCode = str_replace('_', '-', strtolower($code)); // pt_BR -> pt-br
+ }
+
+ // Fetch updates from translatewiki.net...
+ $file_url = 'http://translatewiki.net/w/i.php?' .
+ http_build_query(array(
+ 'title' => 'Special:Translate',
+ 'task' => 'export-to-file',
+ 'group' => 'out-statusnet-core',
+ 'language' => $twnCode));