Explorar o código

Merge pull request #179 from kghbln/develop

Follow up for the 1.1 release
Jamie Thingelstad %!s(int64=10) %!d(string=hai) anos
pai
achega
d3e4d1cdb6
Modificáronse 10 ficheiros con 112 adicións e 72 borrados
  1. 1 0
      CHANGELOG.md
  2. 10 0
      COPYING
  3. 30 66
      Foreground.i18n.php
  4. 5 6
      foreground.php
  5. 11 0
      i18n/ar.json
  6. 11 0
      i18n/de.json
  7. 11 0
      i18n/en.json
  8. 11 0
      i18n/es.json
  9. 11 0
      i18n/nl.json
  10. 11 0
      i18n/ru.json

+ 1 - 0
CHANGELOG.md

@@ -10,3 +10,4 @@
 * [feature] i18n json update/create shim, i18n.php file for localization deprecated in MW 1.23 and being removed in MW 1.24, and shim is backwards compatable to MW 1.17
 * Added CONTRIBUTING.md file
 * Update to README.md
+* Added COPYING file

+ 10 - 0
COPYING

@@ -0,0 +1,10 @@
+Copyright (c) 2013, Garrick Van Buren, Jamie Thingelstad<br />
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 30 - 66
Foreground.i18n.php

@@ -1,71 +1,35 @@
 <?php
-
 /**
- * Internationalization file for skin Foreground.
+ * 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
  *
- * @file
- * @ingroup Skins
+ * This shim maintains compatibility back to MediaWiki 1.17.
  */
-
 $messages = array();
-
-/** English
- * @author Garrick Van Buren
- */
-$messages['en'] = array(
-	'skinname-foreground' => 'Foreground',
-	'foreground-desc' => 'Provides a skin that focuses on putting your content in the foreground',
-	'foreground-browsermsg' => 'may not look as expected in this version of Internet Explorer. We recommend you upgrade to a newer version of Internet Explorer or switch to a browser like Firefox or Chrome.',
-	'foreground-menutitle' => 'Menu'
-);
-
-/** German (Deutsch)
- * @author Kghbln
- */
-$messages['de'] = array(
-	'skinname-foreground' => 'Foreground',
-	'foreground-desc' => 'Stellt eine Benutzeroberfläche bereit, die die Inhalte des Wikis betont',
-	'foreground-browsermsg' => 'sieht in dieser Version des Internet Explorers nicht wie gewünscht aus. Es wird ein Upgrade des Internet Explorers oder der Umstieg auf einen Browser wie Firefox oder Chrome empfohlen.',
-	'foreground-menutitle' => 'Menü'
-);
-
-/** Spanish (español)
- * @author Manuel Rubio 
- */
-$messages['es'] = array(
-	'skinname-foreground' => 'Foreground',
-	'foreground-desc' => 'Provee una plantilla que se centra en resaltar en primer plano el contenido.',
-	'foreground-browsermsg' => 'puede verse diferente a lo esperado en esta versión de Internet Explorer le recomendamos que se actualice a una versión más reciente, o cambie a un navegador como Firefox o Chrome.',
-	'foreground-menutitle' => 'Menu'
-);
-
-/** Dutch (nederlands)
- * @author Marijke Stuivenberg
- */
-$messages['nl'] = array(
-		'skinname-foreground' => 'Foreground',
-		'foreground-desc' => 'Biedt een uiterlijk dat er voor zorgt dat de inhoud op de voorgrond wordt weergegeven',
-		'foreground-browsermsg' => 'wordt mogelijk niet goed weergegeven in deze versie van Internet Explorer. Aanbevolen wordt te upgraden naar een nieuwere versie van Internet Explorer of om te schakelen naar een browser zoals Firefox of Chrome.',
-		'foreground-menutitle' => 'Menu'
-);
-
-/** Arabic
- * @author النعيمي باشا
- */
-$messages['ar'] = array(
-	'skinname-foreground' => 'Foreground',
-	'foreground-desc' => 'نوفر مظهر يركز على وضع محتواك في المقدمة',
-	'foreground-browsermsg' => 'ربما يظهر بشكل غير مقبول في هذه النسخة من انترنت اكسبلورر. ننصحك بالترقية إلى إصدار أحدث لانترنت اكسبلورر أو التغير إلى متصفح مثل فايرفوكس أو كروم.',
-	'foreground-menutitle' => 'قائمة'
-);
-
-/** Russian
- *  @author HiRolla
- */
-$messages['ru'] = array(
-	'skinname-foreground' => 'Foreground',
-	'foreground-desc' => 'Оформление, которое выводит на передний план именно содержимое страниц, минимизируя интерфейс сайта',
-	'foreground-browsermsg' => 'Возможны непредвиденные изменения вида в Internet Explorer. Рекомендуем обновить Internet Explorer или пользоваться такими браузерами, как Firefox или Chrome.',
-	'foreground-menutitle' => 'Меню'
-);
-
+if ( !function_exists( 'wfJsonI18nSkinForeground' ) ) {
+	function wfJsonI18nSkinForeground( $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'][] = 'wfJsonI18nSkinForeground';
+}

+ 5 - 6
foreground.php

@@ -9,12 +9,10 @@
  * @license 2-clause BSD
  */
 
-if( ! defined( 'MEDIAWIKI' ))
-{
-	die("Wiki Wonders What You're Doing");
+if( !defined( 'MEDIAWIKI' ) ) {
+   die( 'This is a skin to the MediaWiki package and cannot be run standalone.' );
 }
 
-
 $wgExtensionCredits['skin'][] = array(
 	'path'		 => __FILE__,
 	'name'		 => 'Foreground',
@@ -31,9 +29,10 @@ $wgExtensionCredits['skin'][] = array(
 
 $wgValidSkinNames['foreground'] = 'Foreground';
 
-$wgAutoloadClasses['SkinForeground'] = __DIR__.'/Foreground.skin.php';
+$wgAutoloadClasses['SkinForeground'] = __DIR__ . '/Foreground.skin.php';
 
-$wgExtensionMessagesFiles['SkinForeground'] = __DIR__.'/Foreground.i18n.php';
+$wgMessagesDirs['SkinForeground'] = __DIR__ . '/i18n';
+$wgExtensionMessagesFiles['SkinForeground'] = __DIR__ . '/Foreground.i18n.php';
 
 $wgResourceModules['skins.foreground'] = array(
 	'styles'         => array(

+ 11 - 0
i18n/ar.json

@@ -0,0 +1,11 @@
+{
+	"@metadata": {
+		"authors": [
+			"النعيمي باشا"
+		]
+	},
+	"skinname-foreground": "Foreground",
+	"foreground-desc": "نوفر مظهر يركز على وضع محتواك في المقدمة",
+	"foreground-browsermsg": "ربما يظهر بشكل غير مقبول في هذه النسخة من انترنت اكسبلورر. ننصحك بالترقية إلى إصدار أحدث لانترنت اكسبلورر أو التغير إلى متصفح مثل فايرفوكس أو كروم.",
+	"foreground-menutitle": "قائمة"
+}

+ 11 - 0
i18n/de.json

@@ -0,0 +1,11 @@
+{
+	"@metadata": {
+		"authors": [
+			"Kghbln"
+		]
+	},
+	"skinname-foreground": "Foreground",
+	"foreground-desc": "Stellt eine Benutzeroberfläche bereit, die die Inhalte des Wikis betont",
+	"foreground-browsermsg": "sieht in dieser Version des Internet Explorers nicht wie gewünscht aus. Es wird eine Aktualisierung des Internet Explorers oder der Umstieg auf einen Browser wie bspw. Firefox oder Chrome empfohlen.",
+	"foreground-menutitle": "Menü"
+}

+ 11 - 0
i18n/en.json

@@ -0,0 +1,11 @@
+{
+	"@metadata": {
+		"authors": [
+			"Garrick Van Buren"
+		]
+	},
+	"skinname-foreground": "Foreground",
+	"foreground-desc": "Provides a skin that focuses on putting your content in the foreground",
+	"foreground-browsermsg": "may not look as expected in this version of Internet Explorer. We recommend you upgrade to a newer version of Internet Explorer or switch to a browser like Firefox or Chrome.",
+	"foreground-menutitle": "Menu"
+}

+ 11 - 0
i18n/es.json

@@ -0,0 +1,11 @@
+{
+	"@metadata": {
+		"authors": [
+			"Manuel Rubio "
+		]
+	},
+	"skinname-foreground": "Foreground",
+	"foreground-desc": "Provee una plantilla que se centra en resaltar en primer plano el contenido.",
+	"foreground-browsermsg": "puede verse diferente a lo esperado en esta versión de Internet Explorer le recomendamos que se actualice a una versión más reciente, o cambie a un navegador como Firefox o Chrome.",
+	"foreground-menutitle": "Menu"
+}

+ 11 - 0
i18n/nl.json

@@ -0,0 +1,11 @@
+{
+	"@metadata": {
+		"authors": [
+			"Marijke Stuivenberg"
+		]
+	},
+	"skinname-foreground": "Foreground",
+	"foreground-desc": "Biedt een uiterlijk dat er voor zorgt dat de inhoud op de voorgrond wordt weergegeven",
+	"foreground-browsermsg": "wordt mogelijk niet goed weergegeven in deze versie van Internet Explorer. Aanbevolen wordt te upgraden naar een nieuwere versie van Internet Explorer of om te schakelen naar een browser zoals Firefox of Chrome.",
+	"foreground-menutitle": "Menu"
+}

+ 11 - 0
i18n/ru.json

@@ -0,0 +1,11 @@
+{
+	"@metadata": {
+		"authors": [
+			"HiRolla"
+		]
+	},
+	"skinname-foreground": "Foreground",
+	"foreground-desc": "Оформление, которое выводит на передний план именно содержимое страниц, минимизируя интерфейс сайта",
+	"foreground-browsermsg": "Возможны непредвиденные изменения вида в Internet Explorer. Рекомендуем обновить Internet Explorer или пользоваться такими браузерами, как Firefox или Chrome.",
+	"foreground-menutitle": "Меню"
+}