Paladox has uploaded a new change for review.

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

Change subject: Remove i18n shim
......................................................................

Remove i18n shim

Change-Id: I6be0f8c67b9b48ab618e4b1ade4297d676bbed02
---
M .gitignore
D DismissableSiteNotice.i18n.php
M DismissableSiteNotice.php
A Gruntfile.js
A package.json
5 files changed, 33 insertions(+), 36 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DismissableSiteNotice 
refs/changes/72/222572/1

diff --git a/.gitignore b/.gitignore
index 98b092a..4bf4869 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
 *~
 *.kate-swp
 .*.swp
+node_modules/
diff --git a/DismissableSiteNotice.i18n.php b/DismissableSiteNotice.i18n.php
deleted file mode 100644
index c232578..0000000
--- a/DismissableSiteNotice.i18n.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * This is a backwards-compatibility shim, generated by:
- * 
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
- *
- * 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( 'wfJsonI18nShim6a70a7d776e402df' ) ) {
-       function wfJsonI18nShim6a70a7d776e402df( $cache, $code, &$cachedData ) {
-               $codeSequence = array_merge( array( $code ), 
$cachedData['fallbackSequence'] );
-               foreach ( $codeSequence as $csCode ) {
-                       $fileName = dirname( __FILE__ ) . "/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'] );
-                       }
-
-                       $cachedData['deps'][] = new FileDependency( $fileName );
-               }
-               return true;
-       }
-
-       $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 
'wfJsonI18nShim6a70a7d776e402df';
-}
diff --git a/DismissableSiteNotice.php b/DismissableSiteNotice.php
index 4e91e04..a1415e3 100644
--- a/DismissableSiteNotice.php
+++ b/DismissableSiteNotice.php
@@ -33,7 +33,6 @@
 );
 
 $wgMessagesDirs['DismissableSiteNotice'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['DismissableSiteNotice'] = __DIR__ . 
'/DismissableSiteNotice.i18n.php';
 
 $wgResourceModules['ext.dismissableSiteNotice'] = array(
        'localBasePath' => __DIR__ . '/modules',
diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 0000000..9c56558
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,20 @@
+/*jshint node:true */
+module.exports = function ( grunt ) {
+       grunt.loadNpmTasks( 'grunt-banana-checker' );
+       grunt.loadNpmTasks( 'grunt-jsonlint' );
+
+       grunt.initConfig( {
+               banana: {
+                       all: 'i18n/'
+               },
+               jsonlint: {
+                       all: [
+                               '**/*.json',
+                               '!node_modules/**'
+                       ]
+               }
+       } );
+
+       grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
+       grunt.registerTask( 'default', 'test' );
+};
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..76e8a82
--- /dev/null
+++ b/package.json
@@ -0,0 +1,12 @@
+{
+  "private": true,
+  "scripts": {
+    "test": "grunt test"
+  },
+  "devDependencies": {
+    "grunt": "0.4.5",
+    "grunt-cli": "0.1.13",
+    "grunt-banana-checker": "0.2.2",
+    "grunt-jsonlint": "1.0.4"
+  }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6be0f8c67b9b48ab618e4b1ade4297d676bbed02
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DismissableSiteNotice
Gerrit-Branch: master
Gerrit-Owner: Paladox <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to