Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/123068
Change subject: Migrate to JSON i18n ...................................................................... Migrate to JSON i18n Procedure per https://www.mediawiki.org/wiki/Manual:GenerateJsonI18n.php with shim. Change-Id: I7957a39f4a7955ad0de439540d189bac13b418ba --- M SemanticRating.i18n.php M SemanticRating.php A i18n/ast.json A i18n/de.json A i18n/dsb.json A i18n/en.json A i18n/es.json A i18n/fa.json A i18n/fr.json A i18n/gl.json A i18n/hsb.json A i18n/it.json A i18n/ja.json A i18n/ko.json A i18n/ksh.json A i18n/mk.json A i18n/nl.json A i18n/oc.json A i18n/qqq.json A i18n/roa-tara.json A i18n/ru.json A i18n/uk.json A i18n/zh-hans.json 23 files changed, 193 insertions(+), 165 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticRating refs/changes/68/123068/1 diff --git a/SemanticRating.i18n.php b/SemanticRating.i18n.php index e43846c..eeb2776 100644 --- a/SemanticRating.i18n.php +++ b/SemanticRating.i18n.php @@ -1,169 +1,31 @@ <?php - -/* - * Copyright (c) 2013 The MITRE Corporation +/** + * This is a backwards-compatibility shim, generated by: + * https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: + * 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 * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. + * 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'] ); + } -$messages['en'] = array( - 'semanticrating-desc' => 'Allows users to rate items between 1 and 5 with stars' -); - -/** Message documentation (Message documentation) - * @author Kghbln - */ -$messages['qqq'] = array( - 'semanticrating-desc' => '{{desc|name=Semantic Rating|url=http://www.mediawiki.org/wiki/Extension:Semantic_Rating}}', -); - -/** Asturian (asturianu) - * @author Xuacu - */ -$messages['ast'] = array( - 'semanticrating-desc' => 'Permite a los usuarios puntuar los elementos ente 1 y 5 estrelles', -); - -/** German (Deutsch) - * @author Metalhead64 - */ -$messages['de'] = array( - 'semanticrating-desc' => 'Ermöglicht es Benutzern, Objekte mit 1 bis 5 Sternen zu bewerten', -); - -/** Lower Sorbian (dolnoserbski) - * @author Michawiki - */ -$messages['dsb'] = array( - 'semanticrating-desc' => 'Zmóžnja wužywarjam zapiski z 1 gwězdku resp. až do 5 gwězdkow pógódnośiś', -); - -/** Spanish (español) - * @author Fitoschido - */ -$messages['es'] = array( - 'semanticrating-desc' => 'Permite a los usuarios evaluar los artículos con una escala de 1 a 5 estrellas', -); - -/** Persian (فارسی) - * @author Ebraminio - */ -$messages['fa'] = array( - 'semanticrating-desc' => 'اجازه میدهد کاربران موردها بین ۱ تا ۵ ستاره رتبهدهی کنند', -); - -/** French (français) - * @author Gomoko - */ -$messages['fr'] = array( - 'semanticrating-desc' => 'Permet aux utilisateurs de classer les éléments entre 1 et 5 avec des étoiles', -); - -/** Galician (galego) - * @author Toliño - */ -$messages['gl'] = array( - 'semanticrating-desc' => 'Permite aos usuarios avaliar os elementos entre 1 e 5 estrelas', -); - -/** Upper Sorbian (hornjoserbsce) - * @author Michawiki - */ -$messages['hsb'] = array( - 'semanticrating-desc' => 'Zmóžnja wužiwarjam zapiski z 1 hwěžku resp. hač do 5 hwěžkow pohódnoćić', -); - -/** Italian (italiano) - * @author Beta16 - */ -$messages['it'] = array( - 'semanticrating-desc' => 'Consente agli utenti di valutare gli elementi da 1 a 5 con stelle', -); - -/** Japanese (日本語) - * @author Shirayuki - */ -$messages['ja'] = array( - 'semanticrating-desc' => '利用者が、星 1 つから 5 つの範囲で項目を評価できるようにする', -); - -/** Korean (한국어) - * @author Hym411 - */ -$messages['ko'] = array( - 'semanticrating-desc' => '사용자에게 별 한개에서 다섯개를 이용해 항목의 별점을 매길 수 있게 합니다.', -); - -/** Colognian (Ripoarisch) - * @author Purodha - */ -$messages['ksh'] = array( - 'semanticrating-desc' => 'Määd_et möjjelesch för Metmaacher, Saache met einem bes fönnef Schtähne ze bewääte.', -); - -/** Macedonian (македонски) - * @author Bjankuloski06 - */ -$messages['mk'] = array( - 'semanticrating-desc' => 'Им овозможува на корисниците да ги оценуваат предметите од 1 до 5 со ѕвездички', -); - -/** Dutch (Nederlands) - * @author Siebrand - */ -$messages['nl'] = array( - 'semanticrating-desc' => 'Maakt het voor gebruikers mogelijk items te waarderen met 1 tot 5 sterren', -); - -/** Occitan (occitan) - * @author Cedric31 - */ -$messages['oc'] = array( - 'semanticrating-desc' => "Permet als utilizaires de classar los elements entre 1 e 5 amb d'estelas", -); - -/** tarandíne (tarandíne) - * @author Joetaras - */ -$messages['roa-tara'] = array( - 'semanticrating-desc' => "Permette a l'utinde de valutà vôsce 'mbrà 1 e 5 stelle", -); - -/** Russian (русский) - * @author Okras - */ -$messages['ru'] = array( - 'semanticrating-desc' => 'Позволяет пользователям поставить элементам оценку от 1 до 5 звёзд', -); - -/** Ukrainian (українська) - * @author Andriykopanytsia - */ -$messages['uk'] = array( - 'semanticrating-desc' => 'Дозволяє користувачам оцінювати елементи від 1 до 5 з зірок', -); - -/** Simplified Chinese (中文(简体)) - * @author Yfdyh000 - */ -$messages['zh-hans'] = array( - 'semanticrating-desc' => '允许用户以1到5星评分', -); + $cachedData['deps'][] = new FileDependency( $fileName ); + } + return true; +}; diff --git a/SemanticRating.php b/SemanticRating.php index a7e8804..8e0089d 100644 --- a/SemanticRating.php +++ b/SemanticRating.php @@ -1,5 +1,4 @@ <?php - /* * Copyright (c) 2013 The MITRE Corporation * @@ -40,7 +39,7 @@ $wgExtensionCredits['semantic'][] = array ( 'name' => 'SemanticRating', - 'version' => '1.0', + 'version' => '1.1.0', 'author' => array( '[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy Cicalese]' ), @@ -56,6 +55,7 @@ $wgAutoloadClasses['SemanticRating'] = __DIR__ . '/SemanticRating.class.php'; +$wgMessagesDirs['SemanticRating'] = __DIR__ . '/i18n'; $wgExtensionMessagesFiles['SemanticRating'] = __DIR__ . '/SemanticRating.i18n.php'; diff --git a/i18n/ast.json b/i18n/ast.json new file mode 100644 index 0000000..f8e1f7e --- /dev/null +++ b/i18n/ast.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Xuacu" + ] + }, + "semanticrating-desc": "Permite a los usuarios puntuar los elementos ente 1 y 5 estrelles" +} diff --git a/i18n/de.json b/i18n/de.json new file mode 100644 index 0000000..a94f57f --- /dev/null +++ b/i18n/de.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Metalhead64" + ] + }, + "semanticrating-desc": "Ermöglicht es Benutzern, Objekte mit 1 bis 5 Sternen zu bewerten" +} diff --git a/i18n/dsb.json b/i18n/dsb.json new file mode 100644 index 0000000..d70486f --- /dev/null +++ b/i18n/dsb.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Michawiki" + ] + }, + "semanticrating-desc": "Zmóžnja wužywarjam zapiski z 1 gwězdku resp. až do 5 gwězdkow pógódnośiś" +} diff --git a/i18n/en.json b/i18n/en.json new file mode 100644 index 0000000..5be26db --- /dev/null +++ b/i18n/en.json @@ -0,0 +1,6 @@ +{ + "@metadata": { + "authors": [] + }, + "semanticrating-desc": "Allows users to rate items between 1 and 5 with stars" +} diff --git a/i18n/es.json b/i18n/es.json new file mode 100644 index 0000000..4cab97d --- /dev/null +++ b/i18n/es.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Fitoschido" + ] + }, + "semanticrating-desc": "Permite a los usuarios evaluar los artículos con una escala de 1 a 5 estrellas" +} diff --git a/i18n/fa.json b/i18n/fa.json new file mode 100644 index 0000000..03b9893 --- /dev/null +++ b/i18n/fa.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Ebraminio" + ] + }, + "semanticrating-desc": "اجازه میدهد کاربران موردها بین ۱ تا ۵ ستاره رتبهدهی کنند" +} diff --git a/i18n/fr.json b/i18n/fr.json new file mode 100644 index 0000000..bbd52d1 --- /dev/null +++ b/i18n/fr.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Gomoko" + ] + }, + "semanticrating-desc": "Permet aux utilisateurs de classer les éléments entre 1 et 5 avec des étoiles" +} diff --git a/i18n/gl.json b/i18n/gl.json new file mode 100644 index 0000000..e3ab581 --- /dev/null +++ b/i18n/gl.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Toliño" + ] + }, + "semanticrating-desc": "Permite aos usuarios avaliar os elementos entre 1 e 5 estrelas" +} diff --git a/i18n/hsb.json b/i18n/hsb.json new file mode 100644 index 0000000..b7df7a6 --- /dev/null +++ b/i18n/hsb.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Michawiki" + ] + }, + "semanticrating-desc": "Zmóžnja wužiwarjam zapiski z 1 hwěžku resp. hač do 5 hwěžkow pohódnoćić" +} diff --git a/i18n/it.json b/i18n/it.json new file mode 100644 index 0000000..4dca476 --- /dev/null +++ b/i18n/it.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Beta16" + ] + }, + "semanticrating-desc": "Consente agli utenti di valutare gli elementi da 1 a 5 con stelle" +} diff --git a/i18n/ja.json b/i18n/ja.json new file mode 100644 index 0000000..ab1bdc6 --- /dev/null +++ b/i18n/ja.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Shirayuki" + ] + }, + "semanticrating-desc": "利用者が、星 1 つから 5 つの範囲で項目を評価できるようにする" +} diff --git a/i18n/ko.json b/i18n/ko.json new file mode 100644 index 0000000..49f477c --- /dev/null +++ b/i18n/ko.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Hym411" + ] + }, + "semanticrating-desc": "사용자에게 별 한개에서 다섯개를 이용해 항목의 별점을 매길 수 있게 합니다." +} diff --git a/i18n/ksh.json b/i18n/ksh.json new file mode 100644 index 0000000..e143c47 --- /dev/null +++ b/i18n/ksh.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Purodha" + ] + }, + "semanticrating-desc": "Määd_et möjjelesch för Metmaacher, Saache met einem bes fönnef Schtähne ze bewääte." +} diff --git a/i18n/mk.json b/i18n/mk.json new file mode 100644 index 0000000..52e2a5a --- /dev/null +++ b/i18n/mk.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Bjankuloski06" + ] + }, + "semanticrating-desc": "Им овозможува на корисниците да ги оценуваат предметите од 1 до 5 со ѕвездички" +} diff --git a/i18n/nl.json b/i18n/nl.json new file mode 100644 index 0000000..d6223da --- /dev/null +++ b/i18n/nl.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Siebrand" + ] + }, + "semanticrating-desc": "Maakt het voor gebruikers mogelijk items te waarderen met 1 tot 5 sterren" +} diff --git a/i18n/oc.json b/i18n/oc.json new file mode 100644 index 0000000..ae60c87 --- /dev/null +++ b/i18n/oc.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Cedric31" + ] + }, + "semanticrating-desc": "Permet als utilizaires de classar los elements entre 1 e 5 amb d'estelas" +} diff --git a/i18n/qqq.json b/i18n/qqq.json new file mode 100644 index 0000000..beb7861 --- /dev/null +++ b/i18n/qqq.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Kghbln" + ] + }, + "semanticrating-desc": "{{desc|name=Semantic Rating|url=http://www.mediawiki.org/wiki/Extension:Semantic_Rating}}" +} diff --git a/i18n/roa-tara.json b/i18n/roa-tara.json new file mode 100644 index 0000000..a2824bd --- /dev/null +++ b/i18n/roa-tara.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Joetaras" + ] + }, + "semanticrating-desc": "Permette a l'utinde de valutà vôsce 'mbrà 1 e 5 stelle" +} diff --git a/i18n/ru.json b/i18n/ru.json new file mode 100644 index 0000000..3d41931 --- /dev/null +++ b/i18n/ru.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Okras" + ] + }, + "semanticrating-desc": "Позволяет пользователям поставить элементам оценку от 1 до 5 звёзд" +} diff --git a/i18n/uk.json b/i18n/uk.json new file mode 100644 index 0000000..0efea8d --- /dev/null +++ b/i18n/uk.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Andriykopanytsia" + ] + }, + "semanticrating-desc": "Дозволяє користувачам оцінювати елементи від 1 до 5 з зірок" +} diff --git a/i18n/zh-hans.json b/i18n/zh-hans.json new file mode 100644 index 0000000..a94eb4a --- /dev/null +++ b/i18n/zh-hans.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Yfdyh000" + ] + }, + "semanticrating-desc": "允许用户以1到5星评分" +} -- To view, visit https://gerrit.wikimedia.org/r/123068 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7957a39f4a7955ad0de439540d189bac13b418ba Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticRating Gerrit-Branch: master Gerrit-Owner: Siebrand <siebr...@kitano.nl> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits