[MediaWiki-commits] [Gerrit] Migrate to JSON i18n - change (mediawiki...Description2)

2014-03-31 Thread Siebrand (Code Review)
Siebrand has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/122313

Change subject: Migrate to JSON i18n
..

Migrate to JSON i18n

Procedure per https://www.mediawiki.org/wiki/Manual:GenerateJsonI18n.php
with shim.

Change-Id: I42758512ddcd921141abefa7134b967a91732f70
---
M Description2.i18n.php
M Description2.php
A i18n/ast.json
A i18n/be-tarask.json
A i18n/br.json
A i18n/bs.json
A i18n/cs.json
A i18n/cy.json
A i18n/de.json
A i18n/dsb.json
A i18n/en.json
A i18n/es.json
A i18n/eu.json
A i18n/fa.json
A i18n/fr.json
A i18n/gl.json
A i18n/gsw.json
A i18n/he.json
A i18n/hsb.json
A i18n/ia.json
A i18n/id.json
A i18n/it.json
A i18n/ja.json
A i18n/ko.json
A i18n/ksh.json
A i18n/lb.json
A i18n/mg.json
A i18n/mk.json
A i18n/ms.json
A i18n/nb.json
A i18n/nl.json
A i18n/oc.json
A i18n/pl.json
A i18n/pms.json
A i18n/pt-br.json
A i18n/pt.json
A i18n/qqq.json
A i18n/roa-tara.json
A i18n/ru.json
A i18n/sco.json
A i18n/sk.json
A i18n/sv.json
A i18n/tl.json
A i18n/uk.json
A i18n/zh-hans.json
A i18n/zh-hant.json
46 files changed, 386 insertions(+), 321 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Description2 
refs/changes/13/122313/1

diff --git a/Description2.i18n.php b/Description2.i18n.php
index ffd9a56..eeb2776 100644
--- a/Description2.i18n.php
+++ b/Description2.i18n.php
@@ -1,321 +1,31 @@
 ?php
 /**
- * Internationalisation for Description2 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 Daniel Friesen
- */
-$messages['en'] = array(
-   'description2-desc' = 'Adds a description meta-tag to MediaWiki pages 
and into the ParserOutput for other extensions to use',
-);
-
-/** Message documentation (Message documentation)
- * @author Purodha
- * @author Shirayuki
- * @author 아라
- */
-$messages['qqq'] = array(
-   'description2-desc' = 
{{desc|name=Description2|url=http://www.mediawiki.org/wiki/Extension:Description2}}
-{{doc-important|Do not translate meta-tag name 'description'}},
-);
-
-/** Asturian (asturianu)
- * @author Xuacu
- */
-$messages['ast'] = array(
-   'description2-desc' = 'Amiesta una etiqueta de descripción a les 
páxines de MediaWiki y a ParserOutput pa que la usen otres estensiones',
-);
-
-/** Belarusian (Taraškievica orthography) (беларуская (тарашкевіца)‎)
- * @author Jim-by
- */
-$messages['be-tarask'] = array(
-   'description2-desc' = 'Дадае мэта-тэг апісаньня да старонак MediaWiki 
і ў ParserOutput для выкарыстаньня іншымі пашырэньнямі',
-);
-
-/** Breton (brezhoneg)
- * @author Fulup
- */
-$messages['br'] = array(
-   'description2-desc' = 'Ouzhpennañ a ra un deskrivadur meta-tikedennet 
da bajennoù MediaWiki hag er Parser Output da vezañ implijet gant astennoù all',
-);
-
-/** Bosnian (bosanski)
- * @author CERminator
- */
-$messages['bs'] = array(
-   'description2-desc' = 'Dodaje opisnu meta-oznaku na MediaWiki stranice 
i u parserski izlaz (ParserOutput) za korištenje od strane drugih proširenja',
-);
-
-/** Czech (česky)
- * @author Jezevec
- */
-$messages['cs'] = array(
-   'description2-desc' = 'Přidá meta-tag popis(description) na stránky 
MediaWiki a do výstupu parseru pro použití dalšími rozšířeními',
-);
-
-/** Welsh (Cymraeg)
- * @author Pwyll
- */
-$messages['cy'] = array(
-   'description2-desc' = Yn ychwanegu tag-meta disgrifiadol i dudalennau 
MediaWiki ac yn y ParserOutput i'w ddefnyddio gan estyniadau eraill.,
-);
-
-/** German (Deutsch)
- * @author Kghbln
- */
-$messages['de'] = array(
-   'description2-desc' = 'Fügt dem Seitenquelltext das 

[MediaWiki-commits] [Gerrit] Migrate to JSON i18n - change (mediawiki...Description2)

2014-03-31 Thread Siebrand (Code Review)
Siebrand 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: I42758512ddcd921141abefa7134b967a91732f70
---
M Description2.i18n.php
M Description2.php
A i18n/ast.json
A i18n/be-tarask.json
A i18n/br.json
A i18n/bs.json
A i18n/cs.json
A i18n/cy.json
A i18n/de.json
A i18n/dsb.json
A i18n/en.json
A i18n/es.json
A i18n/eu.json
A i18n/fa.json
A i18n/fr.json
A i18n/gl.json
A i18n/gsw.json
A i18n/he.json
A i18n/hsb.json
A i18n/ia.json
A i18n/id.json
A i18n/it.json
A i18n/ja.json
A i18n/ko.json
A i18n/ksh.json
A i18n/lb.json
A i18n/mg.json
A i18n/mk.json
A i18n/ms.json
A i18n/nb.json
A i18n/nl.json
A i18n/oc.json
A i18n/pl.json
A i18n/pms.json
A i18n/pt-br.json
A i18n/pt.json
A i18n/qqq.json
A i18n/roa-tara.json
A i18n/ru.json
A i18n/sco.json
A i18n/sk.json
A i18n/sv.json
A i18n/tl.json
A i18n/uk.json
A i18n/zh-hans.json
A i18n/zh-hant.json
46 files changed, 386 insertions(+), 321 deletions(-)

Approvals:
  Siebrand: Verified
  Raimond Spekking: Looks good to me, approved



diff --git a/Description2.i18n.php b/Description2.i18n.php
index ffd9a56..eeb2776 100644
--- a/Description2.i18n.php
+++ b/Description2.i18n.php
@@ -1,321 +1,31 @@
 ?php
 /**
- * Internationalisation for Description2 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 Daniel Friesen
- */
-$messages['en'] = array(
-   'description2-desc' = 'Adds a description meta-tag to MediaWiki pages 
and into the ParserOutput for other extensions to use',
-);
-
-/** Message documentation (Message documentation)
- * @author Purodha
- * @author Shirayuki
- * @author 아라
- */
-$messages['qqq'] = array(
-   'description2-desc' = 
{{desc|name=Description2|url=http://www.mediawiki.org/wiki/Extension:Description2}}
-{{doc-important|Do not translate meta-tag name 'description'}},
-);
-
-/** Asturian (asturianu)
- * @author Xuacu
- */
-$messages['ast'] = array(
-   'description2-desc' = 'Amiesta una etiqueta de descripción a les 
páxines de MediaWiki y a ParserOutput pa que la usen otres estensiones',
-);
-
-/** Belarusian (Taraškievica orthography) (беларуская (тарашкевіца)‎)
- * @author Jim-by
- */
-$messages['be-tarask'] = array(
-   'description2-desc' = 'Дадае мэта-тэг апісаньня да старонак MediaWiki 
і ў ParserOutput для выкарыстаньня іншымі пашырэньнямі',
-);
-
-/** Breton (brezhoneg)
- * @author Fulup
- */
-$messages['br'] = array(
-   'description2-desc' = 'Ouzhpennañ a ra un deskrivadur meta-tikedennet 
da bajennoù MediaWiki hag er Parser Output da vezañ implijet gant astennoù all',
-);
-
-/** Bosnian (bosanski)
- * @author CERminator
- */
-$messages['bs'] = array(
-   'description2-desc' = 'Dodaje opisnu meta-oznaku na MediaWiki stranice 
i u parserski izlaz (ParserOutput) za korištenje od strane drugih proširenja',
-);
-
-/** Czech (česky)
- * @author Jezevec
- */
-$messages['cs'] = array(
-   'description2-desc' = 'Přidá meta-tag popis(description) na stránky 
MediaWiki a do výstupu parseru pro použití dalšími rozšířeními',
-);
-
-/** Welsh (Cymraeg)
- * @author Pwyll
- */
-$messages['cy'] = array(
-   'description2-desc' = Yn ychwanegu tag-meta disgrifiadol i dudalennau 
MediaWiki ac yn y ParserOutput i'w ddefnyddio gan estyniadau eraill.,
-);
-
-/** German (Deutsch)
- * @author Kghbln
- */
-$messages['de'] = array(
-   'description2-desc' = 'Fügt dem Seitenquelltext das Meta-Element 
„description“ hinzu sowie zusätzlich zur