Raimond Spekking has submitted this change and it was merged. Change subject: Migrate to JSON i18n ......................................................................
Migrate to JSON i18n Procedure per https://www.mediawiki.org/wiki/Manual:GenerateJsonI18n.php with shim. Change-Id: I0a556f76f48be133383a6b677252b4494bd15e81 --- M PubSubHubbub.i18n.php M PubSubHubbub.php A i18n/ast.json A i18n/de.json A i18n/en.json A i18n/es.json A i18n/fa.json A i18n/fr.json A i18n/gl.json A i18n/ko.json A i18n/mk.json A i18n/nl.json A i18n/oc.json A i18n/qqq.json A i18n/ru.json A i18n/sv.json A i18n/uk.json A i18n/zh-hans.json A i18n/zh-hant.json 19 files changed, 164 insertions(+), 124 deletions(-) Approvals: Raimond Spekking: Verified; Looks good to me, approved diff --git a/PubSubHubbub.i18n.php b/PubSubHubbub.i18n.php index b868a36..eeb2776 100644 --- a/PubSubHubbub.i18n.php +++ b/PubSubHubbub.i18n.php @@ -1,129 +1,31 @@ <?php /** - * Internationalisation file for PubSubHubbub extension. + * This is a backwards-compatibility shim, generated by: + * https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php * - * @file - * @ingroup Extensions + * Beginning with MediaWiki 1.23, translation strings are stored in json files, + * and the EXTENSION.i18n.php file only exists to provide compatibility with + * older releases of MediaWiki. For more information about this migration, see: + * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format + * + * This shim maintains compatibility back to MediaWiki 1.17. */ - $messages = array(); +$GLOBALS['wgHooks']['LocalisationCacheRecache'][] = function ( $cache, $code, &$cachedData ) { + $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); + foreach ( $codeSequence as $csCode ) { + $fileName = __DIR__ . "/i18n/$csCode.json"; + if ( is_readable( $fileName ) ) { + $data = FormatJson::decode( file_get_contents( $fileName ), true ); + foreach ( array_keys( $data ) as $key ) { + if ( $key === '' || $key[0] === '@' ) { + unset( $data[$key] ); + } + } + $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); + } -/** English - * @author BP2013N2 - */ -$messages['en'] = array( - 'pubsubhubbub-desc' => 'Publishes changes to a PubSubHubbub hub', -); - -/** Message documentation (Message documentation) - * @author Raimond Spekking - */ -$messages['qqq'] = array( - 'pubsubhubbub-desc' => '{{desc|name=PubSubHubbub|url=https://www.mediawiki.org/wiki/Extension:PubSubHubbub}}', -); - -/** Asturian (asturianu) - * @author Xuacu - */ -$messages['ast'] = array( - 'pubsubhubbub-desc' => 'Espubliza los cambios a un centru PubSubHubbub', -); - -/** German (Deutsch) - * @author Metalhead64 - */ -$messages['de'] = array( - 'pubsubhubbub-desc' => 'Ermöglicht die Veröffentlichung von Änderungen an einen PubSubHubbub-Knoten', -); - -/** Spanish (español) - * @author Carlitosag - */ -$messages['es'] = array( - 'pubsubhubbub-desc' => 'Publica los cambios a un núcleo PubSubHubbub', -); - -/** Persian (فارسی) - * @author Armin1392 - */ -$messages['fa'] = array( - 'pubsubhubbub-desc' => 'انتشار تغییرات برای یک پابسابهابباب هاب', -); - -/** French (français) - * @author Gomoko - */ -$messages['fr'] = array( - 'pubsubhubbub-desc' => 'Publie les changements vers un centre de PubSubHubbub', -); - -/** Galician (galego) - * @author Toliño - */ -$messages['gl'] = array( - 'pubsubhubbub-desc' => 'Publica os cambios nun centro PubSubHubbub', -); - -/** Korean (한국어) - * @author Priviet - */ -$messages['ko'] = array( - 'pubsubhubbub-desc' => 'PubSubHubbub 허브에 바뀜을 게시', -); - -/** Macedonian (македонски) - * @author Bjankuloski06 - */ -$messages['mk'] = array( - 'pubsubhubbub-desc' => 'Објавува промени на собиралиштето PubSubHubbub', -); - -/** Dutch (Nederlands) - * @author Siebrand - */ -$messages['nl'] = array( - 'pubsubhubbub-desc' => 'Publiceert wijzigingen via een PubSubHubbubhub', -); - -/** Occitan (occitan) - * @author Cedric31 - */ -$messages['oc'] = array( - 'pubsubhubbub-desc' => 'Publica los cambiaments cap a un centre de PubSubHubbub', -); - -/** Russian (русский) - * @author Okras - */ -$messages['ru'] = array( - 'pubsubhubbub-desc' => 'Публикует изменения в хаб PubSubHubbub', -); - -/** Swedish (svenska) - * @author Jopparn - * @author Lokal Profil - */ -$messages['sv'] = array( - 'pubsubhubbub-desc' => 'Publicerar ändringar till ett PubSubHubbub-nav', -); - -/** Ukrainian (українська) - * @author Andriykopanytsia - */ -$messages['uk'] = array( - 'pubsubhubbub-desc' => 'Публікує зміни до концентратора PubSubHubbub', -); - -/** Simplified Chinese (中文(简体)) - * @author Liuxinyu970226 - */ -$messages['zh-hans'] = array( - 'pubsubhubbub-desc' => '发布更改至一个PubSubHubbub集线器', -); - -/** Traditional Chinese (中文(繁體)) - * @author Liuxinyu970226 - */ -$messages['zh-hant'] = array( - 'pubsubhubbub-desc' => '將更改發佈至PubSubHubbub集線器', -); + $cachedData['deps'][] = new FileDependency( $fileName ); + } + return true; +}; diff --git a/PubSubHubbub.php b/PubSubHubbub.php index d6ff9b9..2c8f5cd 100644 --- a/PubSubHubbub.php +++ b/PubSubHubbub.php @@ -27,7 +27,7 @@ } global $wgExtensionCredits; -global $wgExtensionMessagesFiles; +global $wgExtensionMessagesFiles, $wgMessagesDirs; global $wgAutoloadClasses; global $wgHooks; global $wgJobClasses; @@ -43,6 +43,7 @@ $dir = __DIR__ . '/'; +$wgMessagesDirs['PubSubHubbub'] = __DIR__ . '/i18n'; $wgExtensionMessagesFiles['PubSubHubbub'] = $dir . 'PubSubHubbub.i18n.php'; $wgAutoloadClasses['PubSubHubbub\\PubSubHubbub'] = $dir . 'PubSubHubbub.body.php'; diff --git a/i18n/ast.json b/i18n/ast.json new file mode 100644 index 0000000..92eec4b --- /dev/null +++ b/i18n/ast.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Xuacu" + ] + }, + "pubsubhubbub-desc": "Espubliza los cambios a un centru PubSubHubbub" +} diff --git a/i18n/de.json b/i18n/de.json new file mode 100644 index 0000000..a6bc8d5 --- /dev/null +++ b/i18n/de.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Metalhead64" + ] + }, + "pubsubhubbub-desc": "Ermöglicht die Veröffentlichung von Änderungen an einen PubSubHubbub-Knoten" +} diff --git a/i18n/en.json b/i18n/en.json new file mode 100644 index 0000000..e6266dc --- /dev/null +++ b/i18n/en.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "BP2013N2" + ] + }, + "pubsubhubbub-desc": "Publishes changes to a PubSubHubbub hub" +} diff --git a/i18n/es.json b/i18n/es.json new file mode 100644 index 0000000..b782df7 --- /dev/null +++ b/i18n/es.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Carlitosag" + ] + }, + "pubsubhubbub-desc": "Publica los cambios a un núcleo PubSubHubbub" +} diff --git a/i18n/fa.json b/i18n/fa.json new file mode 100644 index 0000000..8ec1f58 --- /dev/null +++ b/i18n/fa.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Armin1392" + ] + }, + "pubsubhubbub-desc": "انتشار تغییرات برای یک پابسابهابباب هاب" +} diff --git a/i18n/fr.json b/i18n/fr.json new file mode 100644 index 0000000..fdcb67a --- /dev/null +++ b/i18n/fr.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Gomoko" + ] + }, + "pubsubhubbub-desc": "Publie les changements vers un centre de PubSubHubbub" +} diff --git a/i18n/gl.json b/i18n/gl.json new file mode 100644 index 0000000..a4f039e --- /dev/null +++ b/i18n/gl.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Toliño" + ] + }, + "pubsubhubbub-desc": "Publica os cambios nun centro PubSubHubbub" +} diff --git a/i18n/ko.json b/i18n/ko.json new file mode 100644 index 0000000..35c5868 --- /dev/null +++ b/i18n/ko.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Priviet" + ] + }, + "pubsubhubbub-desc": "PubSubHubbub 허브에 바뀜을 게시" +} diff --git a/i18n/mk.json b/i18n/mk.json new file mode 100644 index 0000000..b6b01a4 --- /dev/null +++ b/i18n/mk.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Bjankuloski06" + ] + }, + "pubsubhubbub-desc": "Објавува промени на собиралиштето PubSubHubbub" +} diff --git a/i18n/nl.json b/i18n/nl.json new file mode 100644 index 0000000..2b06b02 --- /dev/null +++ b/i18n/nl.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Siebrand" + ] + }, + "pubsubhubbub-desc": "Publiceert wijzigingen via een PubSubHubbubhub" +} diff --git a/i18n/oc.json b/i18n/oc.json new file mode 100644 index 0000000..11f4cdc --- /dev/null +++ b/i18n/oc.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Cedric31" + ] + }, + "pubsubhubbub-desc": "Publica los cambiaments cap a un centre de PubSubHubbub" +} diff --git a/i18n/qqq.json b/i18n/qqq.json new file mode 100644 index 0000000..8e8f094 --- /dev/null +++ b/i18n/qqq.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Raimond Spekking" + ] + }, + "pubsubhubbub-desc": "{{desc|name=PubSubHubbub|url=https://www.mediawiki.org/wiki/Extension:PubSubHubbub}}" +} diff --git a/i18n/ru.json b/i18n/ru.json new file mode 100644 index 0000000..5e44d33 --- /dev/null +++ b/i18n/ru.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Okras" + ] + }, + "pubsubhubbub-desc": "Публикует изменения в хаб PubSubHubbub" +} diff --git a/i18n/sv.json b/i18n/sv.json new file mode 100644 index 0000000..bce15e6 --- /dev/null +++ b/i18n/sv.json @@ -0,0 +1,9 @@ +{ + "@metadata": { + "authors": [ + "Jopparn", + "Lokal Profil" + ] + }, + "pubsubhubbub-desc": "Publicerar ändringar till ett PubSubHubbub-nav" +} diff --git a/i18n/uk.json b/i18n/uk.json new file mode 100644 index 0000000..ab5c965 --- /dev/null +++ b/i18n/uk.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Andriykopanytsia" + ] + }, + "pubsubhubbub-desc": "Публікує зміни до концентратора PubSubHubbub" +} diff --git a/i18n/zh-hans.json b/i18n/zh-hans.json new file mode 100644 index 0000000..68d8d72 --- /dev/null +++ b/i18n/zh-hans.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Liuxinyu970226" + ] + }, + "pubsubhubbub-desc": "发布更改至一个PubSubHubbub集线器" +} diff --git a/i18n/zh-hant.json b/i18n/zh-hant.json new file mode 100644 index 0000000..33e35d7 --- /dev/null +++ b/i18n/zh-hant.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Liuxinyu970226" + ] + }, + "pubsubhubbub-desc": "將更改發佈至PubSubHubbub集線器" +} -- To view, visit https://gerrit.wikimedia.org/r/123271 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0a556f76f48be133383a6b677252b4494bd15e81 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PubSubHubbub Gerrit-Branch: master Gerrit-Owner: Siebrand <siebr...@kitano.nl> Gerrit-Reviewer: Raimond Spekking <raimond.spekk...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits