Siebrand has submitted this change and it was merged.

Change subject: Convert to JSON i18n
......................................................................


Convert to JSON i18n

Used the generateJsonI18N.php script

Change-Id: Ie25f5ddd99d45e20735868b21e4ceee58a960620
---
M BlueSky.i18n.php
M BlueSky.php
A i18n/en.json
3 files changed, 67 insertions(+), 43 deletions(-)

Approvals:
  Siebrand: Verified; Looks good to me, approved



diff --git a/BlueSky.i18n.php b/BlueSky.i18n.php
index 2219492..42233bf 100644
--- a/BlueSky.i18n.php
+++ b/BlueSky.i18n.php
@@ -1,48 +1,35 @@
 <?php
 /**
- * Internationalization file for the BlueSky skin.
+ * This is a backwards-compatibility shim, generated by:
+ * 
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
  *
- * @file
+ * 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();
+if ( !function_exists( 'wfJsonI18nShimb1f505ade9a49d1b' ) ) {
+       function wfJsonI18nShimb1f505ade9a49d1b( $cache, $code, &$cachedData ) {
+               $codeSequence = array_merge( array( $code ), 
$cachedData['fallbackSequence'] );
+               foreach ( $codeSequence as $csCode ) {
+                       $fileName = dirname( __FILE__ ) . 
"/skins/BlueSky/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 */
-$messages['en'] = array(
-       'bluesky-admin-menu' => 'Admin',
-       'bluesky-article-info' => 'Article info',
-       'bluesky-article-tools' => 'Article tools',
-       'bluesky-categorize' => 'Categorize articles',
-       'bluesky-discuss' => 'Discuss',
-       'bluesky-edit-this-article' => 'Edit this article', // originally 
called 'edit-this-article'
-       'bluesky-featured-contributor-action' => 'Join the community', // 
originally 'fc_action'
-       'bluesky-featured-contributor-list' => '', // originally 'fc_list'
-       'bluesky-featured-contributor-title' => 'Meet a community member', // 
originally 'fc_title'
-       'bluesky-follow-header' => 'Follow us on...', // originally 'fw-header'
-       'bluesky-follow-table' => '', // originally 'fw-table'
-       'bluesky-home' => 'Home',
-       'bluesky-js-no-thanks' => 'No thanks',
-       'bluesky-more-ideas' => 'More ideas...',
-       'bluesky-more-ideas-url' => 'Project:Contribute to {{SITENAME}}',
-       'bluesky-mylinks' => 'My Links', // originally called 'mylinks'
-       'bluesky-my-page' => 'My page',
-       'bluesky-navbar-explore' => 'Explore',
-       'bluesky-navbar-help' => 'Help us',
-       'bluesky-navbar-messages' => 'Messages',
-       'bluesky-navbar-profile' => 'My profile',
-       'bluesky-navmenu-aboutus' => 'About us', // only shown to anons
-       'bluesky-navmenu-categories' => 'Categories',
-       'bluesku-navmenu-tipspatrol' => 'Patrol tips',
-       'bluesky-site-footer-anon' => '', // originally called 
'site_footer_owl_anon'
-       'bluesky-site-footer' => '<ul>
-<li class="top">[[{{int:mainpage}}|Home]]</li>
-<li>[[{{int:aboutpage}}|{{int:about}}]]</li>
-<li>[[{{int:disclaimerpage}}|{{int:disclaimers}}]]</li>
-<li>[[{{int:privacypage}}|{{int:privacy}}]]</li>
-</ul>', // originally called 'site_footer_owl'
-       'bluesky-unread-notifications' => '{{PLURAL:$1|One unread|$1 unread}}',
-       'bluesky-unwatch' => 'Remove watch',
-       'bluesky-watch' => 'Watch',
-       'bluesky-write-article' => 'Write article',
-       'bluesky-write-article-url' => '{{ns:help}}:Creating a new page',
-);
\ No newline at end of file
+                       $cachedData['deps'][] = new FileDependency( $fileName );
+               }
+               return true;
+       }
+
+       $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 
'wfJsonI18nShimb1f505ade9a49d1b';
+}
diff --git a/BlueSky.php b/BlueSky.php
index 8394d59..df5235d 100644
--- a/BlueSky.php
+++ b/BlueSky.php
@@ -46,6 +46,7 @@
 
 $wgAutoloadClasses['SkinBlueSky'] = $dir . 'BlueSky.skin.php';
 $wgExtensionMessagesFiles['SkinBlueSky'] = $dir . 'BlueSky.i18n.php';
+$wgMessagesDirs['SkinBlueSky'] = $dir . '/i18n';
 $wgResourceModules['skins.bluesky'] = array(
        'styles' => array(
                // MonoBook also loads these
@@ -158,4 +159,4 @@
        */
 
        return true;
-};
\ No newline at end of file
+};
diff --git a/i18n/en.json b/i18n/en.json
new file mode 100644
index 0000000..0eb7390
--- /dev/null
+++ b/i18n/en.json
@@ -0,0 +1,36 @@
+{
+       "@metadata": {
+               "authors": []
+       },
+       "bluesky-admin-menu": "Admin",
+       "bluesky-article-info": "Article info",
+       "bluesky-article-tools": "Article tools",
+       "bluesky-categorize": "Categorize articles",
+       "bluesky-discuss": "Discuss",
+       "bluesky-edit-this-article": "Edit this article",
+       "bluesky-featured-contributor-action": "Join the community",
+       "bluesky-featured-contributor-list": "",
+       "bluesky-featured-contributor-title": "Meet a community member",
+       "bluesky-follow-header": "Follow us on...",
+       "bluesky-follow-table": "",
+       "bluesky-home": "Home",
+       "bluesky-js-no-thanks": "No thanks",
+       "bluesky-more-ideas": "More ideas...",
+       "bluesky-more-ideas-url": "Project:Contribute to {{SITENAME}}",
+       "bluesky-mylinks": "My Links",
+       "bluesky-my-page": "My page",
+       "bluesky-navbar-explore": "Explore",
+       "bluesky-navbar-help": "Help us",
+       "bluesky-navbar-messages": "Messages",
+       "bluesky-navbar-profile": "My profile",
+       "bluesky-navmenu-aboutus": "About us",
+       "bluesky-navmenu-categories": "Categories",
+       "bluesku-navmenu-tipspatrol": "Patrol tips",
+       "bluesky-site-footer-anon": "",
+       "bluesky-site-footer": "<ul>\n<li 
class=\"top\">[[{{int:mainpage}}|Home]]</li>\n<li>[[{{int:aboutpage}}|{{int:about}}]]</li>\n<li>[[{{int:disclaimerpage}}|{{int:disclaimers}}]]</li>\n<li>[[{{int:privacypage}}|{{int:privacy}}]]</li>\n</ul>",
+       "bluesky-unread-notifications": "{{PLURAL:$1|One unread|$1 unread}}",
+       "bluesky-unwatch": "Remove watch",
+       "bluesky-watch": "Watch",
+       "bluesky-write-article": "Write article",
+       "bluesky-write-article-url": "{{ns:help}}:Creating a new page"
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/140070
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie25f5ddd99d45e20735868b21e4ceee58a960620
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/skins/BlueSky
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Jack Phoenix <j...@countervandalism.net>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to