1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* This file is part of the MediaWiki skin Chameleon. |
4
|
|
|
* |
5
|
|
|
* @copyright 2013 - 2014, Stephan Gambke |
6
|
|
|
* @license GNU General Public License, version 3 (or any later version) |
7
|
|
|
* |
8
|
|
|
* The Chameleon skin is free software: you can redistribute it and/or modify |
9
|
|
|
* it under the terms of the GNU General Public License as published by the Free |
10
|
|
|
* Software Foundation, either version 3 of the License, or (at your option) any |
11
|
|
|
* later version. |
12
|
|
|
* |
13
|
|
|
* The Chameleon skin is distributed in the hope that it will be useful, but |
14
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
15
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
16
|
|
|
* details. |
17
|
|
|
* |
18
|
|
|
* You should have received a copy of the GNU General Public License along |
19
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>. |
20
|
|
|
* |
21
|
|
|
* @author Stephan Gambke |
22
|
|
|
* @since 1.0 |
23
|
|
|
* @ingroup Skins |
24
|
|
|
*/ |
25
|
|
|
|
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* This is a backwards-compatibility shim, generated by: |
29
|
|
|
* https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php |
30
|
|
|
* |
31
|
|
|
* Beginning with MediaWiki 1.23, translation strings are stored in json files, |
32
|
|
|
* and the EXTENSION.i18n.php file only exists to provide compatibility with |
33
|
|
|
* older releases of MediaWiki. For more information about this migration, see: |
34
|
|
|
* https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format |
35
|
|
|
* |
36
|
|
|
* This shim maintains compatibility back to MediaWiki 1.17. |
37
|
|
|
*/ |
38
|
|
|
$messages = array(); |
39
|
|
|
if ( !function_exists( 'wfJsonI18nShimf931c1431e4504b8' ) ) { |
40
|
|
|
function wfJsonI18nShimf931c1431e4504b8( $cache, $code, &$cachedData ) { |
41
|
|
|
$codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); |
42
|
|
|
foreach ( $codeSequence as $csCode ) { |
43
|
|
|
$fileName = dirname( __FILE__ ) . "/resources/i18n//$csCode.json"; |
44
|
|
|
if ( is_readable( $fileName ) ) { |
45
|
|
|
$data = FormatJson::decode( file_get_contents( $fileName ), true ); |
46
|
|
|
foreach ( array_keys( $data ) as $key ) { |
47
|
|
|
if ( $key === '' || $key[0] === '@' ) { |
48
|
|
|
unset( $data[$key] ); |
49
|
|
|
} |
50
|
|
|
} |
51
|
|
|
$cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
$cachedData['deps'][] = new FileDependency( $fileName ); |
55
|
|
|
} |
56
|
|
|
return true; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
$GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShimf931c1431e4504b8'; |
60
|
|
|
} |
61
|
|
|
|