use CLDRPluralRuleParser\Evaluator;
use CLDRPluralRuleParser\Error as CLDRPluralRuleError;
+use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices;
/**
*/
private $store;
+ /**
+ * @var \Psr\Log\LoggerInterface
+ */
+ private $logger;
+
/**
* A 2-d associative array, code/key, where presence indicates that the item
* is loaded. Value arbitrary.
global $wgCacheDirectory;
$this->conf = $conf;
+ $this->logger = LoggerFactory::getInstance( 'localisation' );
$directory = !empty( $conf['storeDirectory'] ) ? $conf['storeDirectory'] : $wgCacheDirectory;
$storeArg = [];
);
}
}
-
- wfDebugLog( 'caches', static::class . ": using store $storeClass" );
+ $this->logger->debug( static::class . ": using store $storeClass" );
$this->store = new $storeClass( $storeArg );
foreach ( [ 'manualRecache', 'forceRecache' ] as $var ) {
*/
public function isExpired( $code ) {
if ( $this->forceRecache && !isset( $this->recachedLangs[$code] ) ) {
- wfDebug( __METHOD__ . "($code): forced reload\n" );
+ $this->logger->debug( __METHOD__ . "($code): forced reload\n" );
return true;
}
$preload = $this->store->get( $code, 'preload' );
// Different keys may expire separately for some stores
if ( $deps === null || $keys === null || $preload === null ) {
- wfDebug( __METHOD__ . "($code): cache missing, need to make one\n" );
+ $this->logger->debug( __METHOD__ . "($code): cache missing, need to make one\n" );
return true;
}
// anymore (e.g. uninstalled extensions)
// When this happens, always expire the cache
if ( !$dep instanceof CacheDependency || $dep->isExpired() ) {
- wfDebug( __METHOD__ . "($code): cache for $code expired due to " .
+ $this->logger->debug( __METHOD__ . "($code): cache for $code expired due to " .
get_class( $dep ) . "\n" );
return true;
try {
$compiledRules = Evaluator::compile( $rules );
} catch ( CLDRPluralRuleError $e ) {
- wfDebugLog( 'l10n', $e->getMessage() );
+ $this->logger->debug( $e->getMessage() );
return [];
}
# Load the primary localisation from the source file
$data = $this->readSourceFilesAndRegisterDeps( $code, $deps );
if ( $data === false ) {
- wfDebug( __METHOD__ . ": no localisation file for $code, using fallback to en\n" );
+ $this->logger->debug( __METHOD__ . ": no localisation file for $code, using fallback to en\n" );
$coreData['fallback'] = 'en';
} else {
- wfDebug( __METHOD__ . ": got localisation for $code from source\n" );
+ $this->logger->debug( __METHOD__ . ": got localisation for $code from source\n" );
# Merge primary localisation
foreach ( $data as $key => $value ) {
"config-copyright": "== Аўтарскае права і ўмовы ==\n\n$1\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but '''without any warranty'''; without even the implied warranty of '''merchantability''' or '''fitness for a particular purpose'''.\nSee the GNU General Public License for more details.\n\nYou should have received <doclink href=Copying>a copy of the GNU General Public License</doclink> along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. or [https://www.gnu.org/copyleft/gpl.html read it online].",
"config-sidebar": "* [https://www.mediawiki.org Хатняя старонка MediaWiki]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Даведка для ўдзельнікаў]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents Даведка для адміністратараў]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ Адказы на частыя пытаньні]",
"config-sidebar-readme": "Прачытай мяне",
+ "config-sidebar-relnotes": "Заўвагі да выпуску",
"config-env-good": "Асяродзьдзе было праверанае.\nВы можаце ўсталёўваць MediaWiki.",
"config-env-bad": "Асяродзьдзе было праверанае.\nУсталяваньне MediaWiki немагчымае.",
"config-env-php": "Усталяваны PHP $1.",
"config-page-existingwiki": "Eksisterende wiki",
"config-help-restart": "Vil du rydde alle gemte data, du har indtastet og genstarte installationen?",
"config-restart": "Ja, genstart den",
+ "config-sidebar-upgrade": "Opgraderer",
"config-env-php": "PHP $1 er installeret.",
"config-env-hhvm": "HHVM $1 er installeret.",
"config-apc": "[https://www.php.net/apc APC] er installeret",
"Tosky",
"Selven",
"Sarah Bernabei",
- "ArTrix"
+ "ArTrix",
+ "Annibale covini gerolamo"
]
},
"config-desc": "Programma di installazione per MediaWiki",
"config-sidebar": "* [https://www.mediawiki.org Pagina principale MediaWiki]\n* [https://www.mediawiki.org/Special:MyLanguage/Help:Contents Guida ai contenuti per utenti]\n* [https://www.mediawiki.org/Special:MyLanguage/Manual:Contents Guida ai contenuti per admin]\n* [https://www.mediawiki.org/Special:MyLanguage/Manual:FAQ FAQ]",
"config-sidebar-readme": "Leggimi",
"config-sidebar-relnotes": "Note di versione",
+ "config-sidebar-license": "copiando",
"config-sidebar-upgrade": "Aggiornamento",
"config-env-good": "L'ambiente è stato controllato.\nÈ possibile installare MediaWiki.",
"config-env-bad": "L'ambiente è stato controllato.\nNon è possibile installare MediaWiki.",
* @param int $flags Bitfield of BagOStuff::WRITE_* constants
* @return bool Success
*/
- protected function mergeViaCas( $key, $callback, $exptime = 0, $attempts = 10, $flags = 0 ) {
+ final protected function mergeViaCas( $key, callable $callback, $exptime, $attempts, $flags ) {
do {
$casToken = null; // passed by reference
// Get the old value and CAS token from cache
/**
* Delete all objects expiring before a certain date.
* @param string|int $timestamp The reference date in MW or TS_UNIX format
- * @param callable|null $progressCallback Optional, a function which will be called
+ * @param callable|null $progress Optional, a function which will be called
* regularly during long-running operations with the percentage progress
* as the first parameter. [optional]
* @param int $limit Maximum number of keys to delete [default: INF]
*
- * @return bool Success, false if unimplemented
+ * @return bool Success; false if unimplemented
*/
public function deleteObjectsExpiringBefore(
$timestamp,
- callable $progressCallback = null,
+ callable $progress = null,
$limit = INF
) {
- // stub
return false;
}
* @return bool Success
* @since 1.24
*/
- final public function setMulti( array $data, $exptime = 0, $flags = 0 ) {
+ public function setMulti( array $data, $exptime = 0, $flags = 0 ) {
if ( ( $flags & self::WRITE_ALLOW_SEGMENTS ) === self::WRITE_ALLOW_SEGMENTS ) {
throw new InvalidArgumentException( __METHOD__ . ' got WRITE_ALLOW_SEGMENTS' );
}
-
return $this->doSetMulti( $data, $exptime, $flags );
}
foreach ( $data as $key => $value ) {
$res = $this->doSet( $key, $value, $exptime, $flags ) && $res;
}
-
return $res;
}
* @return bool Success
* @since 1.33
*/
- final public function deleteMulti( array $keys, $flags = 0 ) {
+ public function deleteMulti( array $keys, $flags = 0 ) {
if ( ( $flags & self::WRITE_ALLOW_SEGMENTS ) === self::WRITE_ALLOW_SEGMENTS ) {
throw new InvalidArgumentException( __METHOD__ . ' got WRITE_ALLOW_SEGMENTS' );
}
-
return $this->doDeleteMulti( $keys, $flags );
}
foreach ( $keys as $key ) {
$res = $this->doDelete( $key, $flags ) && $res;
}
-
return $res;
}
* @param mixed $mainValue
* @return string|null|bool The combined string, false if missing, null on error
*/
- protected function resolveSegments( $key, $mainValue ) {
+ final protected function resolveSegments( $key, $mainValue ) {
if ( SerializedValueContainer::isUnified( $mainValue ) ) {
return $this->unserialize( $mainValue->{SerializedValueContainer::UNIFIED_DATA} );
}
* @param callable $workCallback
* @since 1.28
*/
- public function addBusyCallback( callable $workCallback ) {
+ final public function addBusyCallback( callable $workCallback ) {
$this->busyCallbacks[] = $workCallback;
}
*/
protected function debug( $text ) {
if ( $this->debugMode ) {
- $this->logger->debug( "{class} debug: $text", [
- 'class' => static::class,
- ] );
+ $this->logger->debug( "{class} debug: $text", [ 'class' => static::class ] );
}
}
* @param int $exptime
* @return bool
*/
- protected function expiryIsRelative( $exptime ) {
+ final protected function expiryIsRelative( $exptime ) {
return ( $exptime != 0 && $exptime < ( 10 * self::TTL_YEAR ) );
}
* @param int $exptime Absolute TTL or 0 for indefinite
* @return int
*/
- protected function convertToExpiry( $exptime ) {
- $exptime = (int)$exptime; // sanity
-
+ final protected function convertToExpiry( $exptime ) {
return $this->expiryIsRelative( $exptime )
? (int)$this->getCurrentTime() + $exptime
: $exptime;
* @param int $exptime
* @return int
*/
- protected function convertToRelative( $exptime ) {
- if ( $exptime >= ( 10 * self::TTL_YEAR ) ) {
- $exptime -= (int)$this->getCurrentTime();
- if ( $exptime <= 0 ) {
- $exptime = 1;
- }
- return $exptime;
- } else {
- return $exptime;
- }
+ final protected function convertToRelative( $exptime ) {
+ return $this->expiryIsRelative( $exptime )
+ ? (int)$exptime
+ : max( $exptime - (int)$this->getCurrentTime(), 1 );
}
/**
* @param mixed $value
* @return bool
*/
- protected function isInteger( $value ) {
+ final protected function isInteger( $value ) {
if ( is_int( $value ) ) {
return true;
} elseif ( !is_string( $value ) ) {
* @param BagOStuff[] $bags
* @return int[] Resulting flag map (class ATTR_* constant => class QOS_* constant)
*/
- protected function mergeFlagMaps( array $bags ) {
+ final protected function mergeFlagMaps( array $bags ) {
$map = [];
foreach ( $bags as $bag ) {
foreach ( $bag->attrMap as $attr => $rank ) {
public function deleteObjectsExpiringBefore(
$timestamp,
- callable $progressCallback = null,
+ callable $progress = null,
$limit = INF
) {
- $this->procCache->deleteObjectsExpiringBefore( $timestamp, $progressCallback, $limit );
+ $this->procCache->deleteObjectsExpiringBefore( $timestamp, $progress, $limit );
- return $this->backend->deleteObjectsExpiringBefore(
- $timestamp,
- $progressCallback,
- $limit
- );
+ return $this->backend->deleteObjectsExpiringBefore( $timestamp, $progress, $limit );
}
// These just call the backend (tested elsewhere)
return false;
}
- protected function doSet( $key, $value, $exp = 0, $flags = 0 ) {
+ protected function doSet( $key, $value, $exptime = 0, $flags = 0 ) {
return true;
}
return $result;
}
- public function doGetMulti( array $keys, $flags = 0 ) {
+ protected function doGetMulti( array $keys, $flags = 0 ) {
$this->debug( 'getMulti(' . implode( ', ', $keys ) . ')' );
foreach ( $keys as $key ) {
$this->validateKeyEncoding( $key );
return $this->checkResult( false, $result );
}
- public function doSetMulti( array $data, $exptime = 0, $flags = 0 ) {
+ protected function doSetMulti( array $data, $exptime = 0, $flags = 0 ) {
$this->debug( 'setMulti(' . implode( ', ', array_keys( $data ) ) . ')' );
foreach ( array_keys( $data ) as $key ) {
$this->validateKeyEncoding( $key );
return $this->checkResult( false, $result );
}
- public function doDeleteMulti( array $keys, $flags = 0 ) {
+ protected function doDeleteMulti( array $keys, $flags = 0 ) {
$this->debug( 'deleteMulti(' . implode( ', ', $keys ) . ')' );
foreach ( $keys as $key ) {
$this->validateKeyEncoding( $key );
);
}
- public function doGetMulti( array $keys, $flags = 0 ) {
+ protected function doGetMulti( array $keys, $flags = 0 ) {
foreach ( $keys as $key ) {
$this->validateKeyEncoding( $key );
}
public function deleteObjectsExpiringBefore(
$timestamp,
- callable $progressCallback = null,
+ callable $progress = null,
$limit = INF
) {
$ret = false;
foreach ( $this->caches as $cache ) {
- if ( $cache->deleteObjectsExpiringBefore( $timestamp, $progressCallback, $limit ) ) {
+ if ( $cache->deleteObjectsExpiringBefore( $timestamp, $progress, $limit ) ) {
$ret = true;
}
}
return $res;
}
- public function doSetMulti( array $data, $exptime = 0, $flags = 0 ) {
+ public function setMulti( array $data, $exptime = 0, $flags = 0 ) {
return $this->doWrite(
$this->cacheIndexes,
$this->usesAsyncWritesGivenFlags( $flags ),
);
}
- public function doDeleteMulti( array $data, $flags = 0 ) {
+ public function deleteMulti( array $data, $flags = 0 ) {
+ return $this->doWrite(
+ $this->cacheIndexes,
+ $this->usesAsyncWritesGivenFlags( $flags ),
+ __FUNCTION__,
+ func_get_args()
+ );
+ }
+
+ public function changeTTLMulti( array $keys, $exptime, $flags = 0 ) {
return $this->doWrite(
$this->cacheIndexes,
$this->usesAsyncWritesGivenFlags( $flags ),
throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
}
+ protected function doSetMulti( array $keys, $exptime = 0, $flags = 0 ) {
+ throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+ }
+
+ protected function doDeleteMulti( array $keys, $flags = 0 ) {
+ throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+ }
+
protected function serialize( $value ) {
throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
}
- protected function unserialize( $value ) {
+ protected function unserialize( $blob ) {
throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
}
}
return $result;
}
- protected function doSet( $key, $value, $expiry = 0, $flags = 0 ) {
+ protected function doSet( $key, $value, $exptime = 0, $flags = 0 ) {
list( $server, $conn ) = $this->getConnection( $key );
if ( !$conn ) {
return false;
}
- $expiry = $this->convertToRelative( $expiry );
+ $ttl = $this->convertToRelative( $exptime );
try {
- if ( $expiry ) {
- $result = $conn->setex( $key, $expiry, $this->serialize( $value ) );
+ if ( $ttl ) {
+ $result = $conn->setex( $key, $ttl, $this->serialize( $value ) );
} else {
// No expiry, that is very different from zero expiry in Redis
$result = $conn->set( $key, $this->serialize( $value ) );
return $result;
}
- public function doGetMulti( array $keys, $flags = 0 ) {
+ protected function doGetMulti( array $keys, $flags = 0 ) {
$batches = [];
$conns = [];
foreach ( $keys as $key ) {
return $result;
}
- public function doSetMulti( array $data, $expiry = 0, $flags = 0 ) {
+ protected function doSetMulti( array $data, $expiry = 0, $flags = 0 ) {
$batches = [];
$conns = [];
foreach ( $data as $key => $value ) {
return $result;
}
- public function doDeleteMulti( array $keys, $flags = 0 ) {
+ protected function doDeleteMulti( array $keys, $flags = 0 ) {
$batches = [];
$conns = [];
foreach ( $keys as $key ) {
public function deleteObjectsExpiringBefore(
$timestamp,
- callable $progressCallback = null,
+ callable $progress = null,
$limit = INF
) {
- return $this->writeStore->deleteObjectsExpiringBefore(
- $timestamp,
- $progressCallback,
- $limit
- );
+ return $this->writeStore->deleteObjectsExpiringBefore( $timestamp, $progress, $limit );
}
public function getMulti( array $keys, $flags = 0 ) {
: $this->readStore->getMulti( $keys, $flags );
}
- public function doSetMulti( array $data, $exptime = 0, $flags = 0 ) {
+ public function setMulti( array $data, $exptime = 0, $flags = 0 ) {
return $this->writeStore->setMulti( $data, $exptime, $flags );
}
- public function doDeleteMulti( array $keys, $flags = 0 ) {
+ public function deleteMulti( array $keys, $flags = 0 ) {
return $this->writeStore->deleteMulti( $keys, $flags );
}
+ public function changeTTLMulti( array $keys, $exptime, $flags = 0 ) {
+ return $this->writeStore->changeTTLMulti( $keys, $exptime, $flags );
+ }
+
public function incr( $key, $value = 1 ) {
return $this->writeStore->incr( $key, $value );
}
throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
}
+ protected function doSetMulti( array $keys, $exptime = 0, $flags = 0 ) {
+ throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+ }
+
+ protected function doDeleteMulti( array $keys, $flags = 0 ) {
+ throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
+ }
+
protected function serialize( $value ) {
throw new LogicException( __METHOD__ . ': proxy class does not need this method.' );
}
return $success;
}
- protected function doSet( $key, $value, $expire = 0, $flags = 0 ) {
- $result = wincache_ucache_set( $key, $this->serialize( $value ), $expire );
+ protected function doSet( $key, $value, $exptime = 0, $flags = 0 ) {
+ $result = wincache_ucache_set( $key, $this->serialize( $value ), $exptime );
// false positive, wincache_ucache_set returns an empty array
// in some circumstances.
return $values;
}
- public function doSetMulti( array $data, $exptime = 0, $flags = 0 ) {
+ protected function doSetMulti( array $data, $exptime = 0, $flags = 0 ) {
return $this->modifyMulti( $data, $exptime, $flags, self::$OP_SET );
}
return (bool)$db->affectedRows();
}
- public function doDeleteMulti( array $keys, $flags = 0 ) {
+ protected function doDeleteMulti( array $keys, $flags = 0 ) {
return $this->modifyMulti(
array_fill_keys( $keys, null ),
0,
return $ok;
}
- public function changeTTLMulti( array $keys, $exptime, $flags = 0 ) {
+ protected function doChangeTTLMulti( array $keys, $exptime, $flags = 0 ) {
return $this->modifyMulti(
array_fill_keys( $keys, null ),
$exptime,
public function deleteObjectsExpiringBefore(
$timestamp,
- callable $progressCallback = null,
+ callable $progress = null,
$limit = INF
) {
/** @noinspection PhpUnusedLocalVariableInspection */
$this->deleteServerObjectsExpiringBefore(
$db,
$timestamp,
- $progressCallback,
+ $progress,
$limit,
$numServersDone,
$keysDeletedCount
'image' => $this->getName(),
'variant' => $variant,
'format' => $format,
- 'lang' => $context->getLanguage(),
- 'skin' => $context->getSkin(),
- 'version' => $context->getVersion(),
];
+ if ( $this->varyOnLanguage() ) {
+ $query['lang'] = $context->getLanguage();
+ }
+ // The following parameters are at the end to keep the original order of the parameters.
+ $query['skin'] = $context->getSkin();
+ $query['version'] = $context->getVersion();
return wfAppendQuery( $script, $query );
}
return $png ?: false;
}
}
+
+ /**
+ * Check if the image depends on the language.
+ *
+ * @return bool
+ */
+ private function varyOnLanguage() {
+ return is_array( $this->descriptor ) && (
+ isset( $this->descriptor['ltr'] ) ||
+ isset( $this->descriptor['rtl'] ) ||
+ isset( $this->descriptor['lang'] ) );
+ }
}
/** @var bool */
protected $warn = true;
- /** @var SessionManager|null */
+ /** @var SessionManagerInterface|null */
protected $manager;
/** @var BagOStuff|null */
/** @var array Track original session fields for later modification check */
protected $sessionFieldCache = [];
- protected function __construct( SessionManager $manager ) {
+ protected function __construct( SessionManagerInterface $manager ) {
$this->setEnableFlags(
\RequestContext::getMain()->getConfig()->get( 'PHPSessionHandling' )
);
/**
* Install a session handler for the current web request
- * @param SessionManager $manager
+ * @param SessionManagerInterface $manager
*/
- public static function install( SessionManager $manager ) {
+ public static function install( SessionManagerInterface $manager ) {
if ( self::$instance ) {
$manager->setupPHPSessionHandler( self::$instance );
return;
/**
* Set the manager, store, and logger
* @private Use self::install().
- * @param SessionManager $manager
+ * @param SessionManagerInterface $manager
* @param BagOStuff $store
* @param LoggerInterface $logger
*/
public function setManager(
- SessionManager $manager, BagOStuff $store, LoggerInterface $logger
+ SessionManagerInterface $manager, BagOStuff $store, LoggerInterface $logger
) {
if ( $this->manager !== $manager ) {
// Close any existing session before we change stores
"delete-legend": "Выдаліць",
"historywarning": "<strong>Папярэджаньне</strong>: старонка, якую Вы зьбіраецеся выдаліць, мае гісторыю з $1 {{PLURAL:$1|вэрсіі|вэрсіяў|вэрсіяў}}:",
"historyaction-submit": "Паказаць вэрсіі",
- "confirmdeletetext": "Ð\97аÑ\80аз Ð\92Ñ\8b вÑ\8bдалÑ\96Ñ\86е Ñ\81Ñ\82аÑ\80онкÑ\83 Ñ\80азам з Ñ\83Ñ\81Ñ\91й гÑ\96Ñ\81Ñ\82оÑ\80Ñ\8bÑ\8fй зÑ\8cменаÑ\9e.\nÐ\9aалÑ\96 лаÑ\81ка, паÑ\86Ñ\8cвеÑ\80дзÑ\96Ñ\86е, Ñ\88Ñ\82о Ð\92Ñ\8b зÑ\8cбÑ\96Ñ\80аеÑ\86еÑ\81Ñ\8f гÑ\8dÑ\82а зÑ\80абÑ\96Ñ\86Ñ\8c Ñ\96 Ñ\88Ñ\82о Ð\92ы разумееце ўсе наступствы, а таксама робіце гэта ў адпаведнасьці з [[{{MediaWiki:Policy-url}}|правіламі]].",
+ "confirmdeletetext": "Ð\97аÑ\80аз вÑ\8b вÑ\8bдалÑ\96Ñ\86е Ñ\81Ñ\82аÑ\80онкÑ\83 Ñ\80азам з Ñ\83Ñ\81Ñ\91й гÑ\96Ñ\81Ñ\82оÑ\80Ñ\8bÑ\8fй зÑ\8cменаÑ\9e.\nÐ\9aалÑ\96 лаÑ\81ка, паÑ\86Ñ\8cвеÑ\80дзÑ\96Ñ\86е, Ñ\88Ñ\82о вÑ\8b зÑ\8cбÑ\96Ñ\80аеÑ\86еÑ\81Ñ\8f гÑ\8dÑ\82а зÑ\80абÑ\96Ñ\86Ñ\8c Ñ\96 Ñ\88Ñ\82о вы разумееце ўсе наступствы, а таксама робіце гэта ў адпаведнасьці з [[{{MediaWiki:Policy-url}}|правіламі]].",
"actioncomplete": "Дзеяньне выкананае",
"actionfailed": "Дзеяньне ня выкананае",
"deletedtext": "«$1» была выдаленая.\nЗапісы пра выдаленыя старонкі зьмяшчаюцца ў $2.",
"autoblockedtext": "Deine IP-Adresse wurde automatisch gesperrt, da sie von einem anderen Benutzer genutzt wurde, der von $1 gesperrt wurde.\nAls Grund wurde angegeben:\n\n:''$2''\n\n* Beginn der Sperre: $8\n* Ende der Sperre: $6\n* Sperre betrifft: $7\n\nDu kannst $1 oder einen der anderen [[{{MediaWiki:Grouppage-sysop}}|Administratoren]] kontaktieren, um über die Sperre zu diskutieren.\n\nDu kannst die „{{int:emailuser}}“-Funktion nicht nutzen, solange keine gültige E-Mail-Adresse in deinen [[Special:Preferences|Benutzerkonto-Einstellungen]] eingetragen ist oder diese Funktion für dich gesperrt wurde.\n\nDeine aktuelle IP-Adresse ist $3, und die Sperr-ID ist $5.\nBitte füge alle Informationen jeder Anfrage hinzu, die du stellst.",
"systemblockedtext": "Dein Benutzername oder deine IP-Adresse wurde von MediaWiki automatisch gesperrt.\nDer angegebene Grund ist:\n\n:<em>$2</em>\n\n* Beginn der Sperre: $8\n* Ablauf der Sperre: $6\n* Sperre betrifft: $7\n\nDeine aktuelle IP-Adresse ist $3.\nBitte gib alle oben stehenden Details in jeder Anfrage an.",
"blockednoreason": "keine Begründung angegeben",
+ "blockedtext-composite": "<strong>Dein Benutzername oder deine IP-Adresse wurde gesperrt.</strong>\n\nDer Angegebene Grund ist:\n\n:<em>$2</em>\n\n* Beginn der Sperre: $8\n* Ablauf der längsten Sperre: $6\n\nDeine aktuelle IP-Adresse ist $3.\nBitte gib alle oben stehenden Details in jeder Anfrage an.",
+ "blockedtext-composite-reason": "Es gibt mehrere Sperren gegen dein Benutzerkonto und/oder deine IP-Adresse",
"whitelistedittext": "Du musst dich $1, um Seiten bearbeiten zu können.",
"confirmedittext": "Du musst deine E-Mail-Adresse erst bestätigen, bevor du Bearbeitungen durchführen kannst. Bitte ergänze und bestätige deine E-Mail in den [[Special:Preferences|Einstellungen]].",
"nosuchsectiontitle": "Abschnitt nicht gefunden",
"mw-widgets-abandonedit-title": "Bist du sicher?",
"mw-widgets-copytextlayout-copy": "Kopieren",
"mw-widgets-copytextlayout-copy-fail": "Der Text konnte nicht in die Zwischenablage kopiert werden.",
+ "mw-widgets-copytextlayout-copy-success": "Text in die Zwischenablage kopiert.",
"mw-widgets-dateinput-no-date": "Kein Datum ausgewählt",
"mw-widgets-dateinput-placeholder-day": "JJJJ-MM-TT",
"mw-widgets-dateinput-placeholder-month": "JJJJ-MM",
"restrictionsfield-help": "Eine IP-Adresse oder ein CIDR-Bereich pro Zeile. Um alles zu aktivieren, verwende:\n<pre>\n0.0.0.0/0\n::/0\n</pre>",
"edit-error-short": "Fehler: $1",
"edit-error-long": "Fehler:\n\n$1",
+ "specialmute": "Stumm",
+ "specialmute-success": "Deine Stummschaltungseinstellungen wurden aktualisiert. Schau dir alle stummgeschalteten Benutzer in [[Special:Preferences|deinen Einstellungen]] an.",
+ "specialmute-submit": "Bestätigen",
+ "specialmute-label-mute-email": "E-Mails von diesem Benutzer stummschalten",
+ "specialmute-header": "Bitte wähle deine Stummschaltungseinstellungen für {{BIDI:[[User:$1]]}}.",
+ "specialmute-error-invalid-user": "Der gesuchte Benutzername konnte nicht gefunden werden.",
+ "specialmute-error-email-blacklist-disabled": "Das Stummschalten von E-Mails von Benutzern ist nicht aktiviert.",
+ "specialmute-error-email-preferences": "Du musst deine E-Mail Adresse bestätigen bevor du einen Benutzer bestätigen kannst. Du kannst dies [[Special:Preferences|in deinen Einstellungen]] tun.",
+ "specialmute-email-footer": "Um deine E-Mail Einstellungen für {{BIDI:$2}} zu verwalten besuche bitte $1.",
+ "specialmute-login-required": "Bitte melde dich an um deine Stummschaltungseinstellungen zu ändern.",
"revid": "Version $1",
"pageid": "Seitenkennung $1",
"interfaceadmin-info": "$1\n\nBerechtigungen für das Bearbeiten von wikiweiten CSS/JS/JSON-Dateien wurden kürzlich vom Recht <code>editinterface</code> getrennt. Falls du nicht verstehst, warum du diesen Fehler erhältst, siehe [[mw:MediaWiki_1.32/interface-admin]].",
"logentry-pagelang-pagelang": "$1 {{GENDER:$2|promijenio|promijenila}} je jezik stranice $3 iz $4 u $5.",
"mediastatistics": "Statistika datoteka",
"mediastatistics-summary": "Slijede statistike postavljenih datoteka koje pokazuju zadnju inačicu datoteke. Starije ili izbrisane inačice nisu prikazane.",
- "mediastatistics-nfiles": "$1 ($2%)",
+ "mediastatistics-nfiles": "$1 ($2 %)",
"mediastatistics-nbytes": "{{PLURAL:$1|$1 bajt|$1 bajta|$1 bajtova}} ($2; $3 %)",
"mediastatistics-bytespertype": "Ukupna veličina datoteka za ovaj odlomak: {{PLURAL:$1|$1 bajt|$1 bajta|$1 bajtova}} ($2; $3%).",
"mediastatistics-allbytes": "Ukupna veličina svih datoteka: {{PLURAL:$1|$1 bajt|$1 bajta|$1 bajtova}} ($2).",
"specialmute-success": "Vaše postavke utišavanja su uspješno ažurirane. Vidite sve utišane korisnike ovdje: [[Special:Preferences]].",
"specialmute-submit": "Potvrdi",
"specialmute-error-invalid-user": "Korisničko ime koje ste tražili nije moguće pronaći.",
- "specialmute-error-email-preferences": "Morate potvrditi svoju email adresu prije nego što možete utišati ovoga korisnika. To možete učiniti putem [[Special:Preferences]].",
- "specialmute-login-required": "Molimo Vas prijavite se da biste promijenili postavke.",
+ "specialmute-error-email-preferences": "Morate potvrditi svoju adresu e-pošte prije nego što možete utišati ovoga korisnika. To možete učiniti putem [[Special:Preferences]].",
+ "specialmute-login-required": "Molimo Vas, prijavite se da biste promijenili postavke.",
"gotointerwiki": "Napuštate projekt {{SITENAME}}",
"gotointerwiki-invalid": "Navedeni naslov nije valjan.",
"gotointerwiki-external": "Napuštate projekt {{SITENAME}} da biste posjetili zasebno mrežno mjesto [[$2]].\n\n<strong>[$1 Nastavljate na $1]</strong>",
"history": "Riwayat halaman",
"history_short": "Versi terdahulu",
"history_small": "riwayat",
- "updatedmarker": "diubah sejak kunjungan terakhir saya",
+ "updatedmarker": "berubah sejak kunjungan terakhir saya",
"printableversion": "Versi cetak",
"permalink": "Pranala permanen",
"print": "Cetak",
"autoblockedtext": "Alamat IP Anda telah terblokir secara otomatis karena digunakan oleh pengguna lain, yang diblokir oleh $1. Pemblokiran dilakukan dengan alasan:\n\n:<em>$2</em>\n\n* Diblokir sejak: $8\n* Blokir kedaluwarsa pada: $6\n* Sasaran pemblokiran: $7\n\nAnda dapat menghubungi $1 atau [[{{MediaWiki:Grouppage-sysop}}|pengurus]] lainnya untuk membicarakan pemblokiran ini.\n\nAnda tidak dapat menggunakan fitur \"{{int:emailuser}}\" kecuali Anda telah memasukkan alamat surel yang sah di [[Special:Preferences|preferensi akun]] Anda dan Anda tidak diblokir untuk menggunakannya.\n\nAlamat IP Anda saat ini adalah $3, dan ID pemblokiran adalah #$5.\nTolong sertakan informasi-informasi ini dalam setiap pertanyaan Anda.",
"systemblockedtext": "Nama pengguna atau alamat IP Anda telah diblokir secara otomatis oleh MediaWiki.\nAlasan yang diberikan adalah:\n\n:<em>$2</em>\n\n* Diblokir sejak: $8\n* Blokir kedaluwarsa pada: $6\n* Sasaran pemblokiran: $7\n\nAlamat IP Anda saat ini adalah $3\nMohon sertakan semua perincian di atas dalam setiap pertanyaan yang Anda ajukan.",
"blockednoreason": "tidak ada alasan yang diberikan",
+ "blockedtext-composite-reason": "Ada pemblokiran berganda terhadap akun Anda dan/atau alamat IP Anda.",
"whitelistedittext": "Anda harus $1 untuk dapat menyunting halaman.",
"confirmedittext": "Anda harus mengkonfirmasikan dulu alamat surel Anda sebelum menyunting halaman.\nHarap masukkan dan validasikan alamat surel Anda melalui [[Special:Preferences|halaman preferensi pengguna]] Anda.",
"nosuchsectiontitle": "Bagian tidak ditemukan",
"mw-widgets-abandonedit-discard": "Buang suntingan",
"mw-widgets-abandonedit-keep": "Lanjutkan penyuntingan",
"mw-widgets-abandonedit-title": "Apakah Anda yakin?",
+ "mw-widgets-copytextlayout-copy": "Salin",
+ "mw-widgets-copytextlayout-copy-fail": "Gagal menyalin ke papan klip.",
+ "mw-widgets-copytextlayout-copy-success": "Salin ke papan klip.",
"mw-widgets-dateinput-no-date": "Tanggal tidak ada yang terpilih",
"mw-widgets-dateinput-placeholder-day": "TTTT-BB-HH",
"mw-widgets-dateinput-placeholder-month": "TTTT-BB",
"restrictionsfield-help": "Satu alamat IP atau rentang CIDR per baris. Untuk mengaktifkan semuanya, gunakan:\n<pre>0.0.0.0/0\n::/0</pre>",
"edit-error-short": "Galat: $1",
"edit-error-long": "Galat:\n\n$1",
+ "specialmute": "Diam",
+ "specialmute-submit": "Konfirmasi",
"revid": "revisi $1",
"pageid": "ID halaman $1",
"rawhtml-notallowed": "Tag <html> tidak dapat digunakan di luar halaman normal.",
"log-action-filter-suppress-block": "Сокрытие пользователя через блокировки",
"log-action-filter-suppress-reblock": "Сокрытие пользователя через повторное блокирование",
"log-action-filter-upload-upload": "Новая загрузка",
- "log-action-filter-upload-overwrite": "Ð\9fовÑ\82оÑ\80но загÑ\80Ñ\83зиÑ\82Ñ\8c",
- "log-action-filter-upload-revert": "Ð\9eÑ\82каÑ\82иÑ\82Ñ\8c",
+ "log-action-filter-upload-overwrite": "Ð\9fеÑ\80езапиÑ\81Ñ\8c Ñ\84айла",
+ "log-action-filter-upload-revert": "Ð\92озвÑ\80аÑ\82 Ñ\81Ñ\82аÑ\80ой веÑ\80Ñ\81ии Ñ\84айла",
"authmanager-authn-not-in-progress": "Проверка подлинности не выполняется или данные сессии были утеряны. Пожалуйста, начните снова с самого начала.",
"authmanager-authn-no-primary": "Предоставленные учётные данные не могут быть проверены на подлинность.",
"authmanager-authn-no-local-user": "Предоставленные учётные данные не связаны ни с одним участником этой вики.",
"revertmerge": "растави",
"mergelogpagetext": "Испод се налази списак најновијих обједињавања историја једне странице у другу.",
"history-title": "Историја измена странице „$1”",
- "difference-title": "Разлика између измена на страници „$1”",
+ "difference-title": "$1 — разлика између измена",
"difference-title-multipage": "Разлика између страница „$1“ и „$2“",
"difference-multipage": "(разлике између страница)",
"lineno": "Ред $1:",
"svg-long-desc": "SVG датотека, номинално $1 × $2 пиксела, величина: $3",
"svg-long-desc-animated": "Анимирана SVG датотека, номинално: $1 × $2 пиксела, величина: $3",
"svg-long-error": "Неважећа SVG датотека: $1",
- "show-big-image": "Ð\9fÑ\80вобиÑ\82на датотека",
+ "show-big-image": "Ð\9eÑ\80игинална датотека",
"show-big-image-preview": "Величина овог приказа: $1.",
"show-big-image-preview-differ": "Величина $3 прегледа за ову $2 датотеку је $1.",
"show-big-image-other": "$2 {{PLURAL:$2|друга резолуција|друге резолуције|других резолуција}}: $1.",
</exclude>
</groups>
<filter>
- <whitelist addUncoveredFilesFromWhitelist="true">
+ <whitelist addUncoveredFilesFromWhitelist="false">
<directory suffix=".php">includes</directory>
<directory suffix=".php">languages</directory>
<directory suffix=".php">maintenance</directory>
+ <directory suffix=".php">extensions</directory>
+ <directory suffix=".php">skins</directory>
<exclude>
<directory suffix=".php">languages/messages</directory>
<file>languages/data/normalize-ar.php</file>
+++ /dev/null
-<?php
-
-/**
- * @covers LanguageCode
- * @group Language
- *
- * @author Thiemo Kreuz
- */
-class LanguageCodeTest extends PHPUnit\Framework\TestCase {
-
- use MediaWikiCoversValidator;
-
- public function testConstructor() {
- $instance = new LanguageCode();
-
- $this->assertInstanceOf( LanguageCode::class, $instance );
- }
-
- public function testGetDeprecatedCodeMapping() {
- $map = LanguageCode::getDeprecatedCodeMapping();
-
- $this->assertInternalType( 'array', $map );
- $this->assertContainsOnly( 'string', array_keys( $map ) );
- $this->assertArrayNotHasKey( '', $map );
- $this->assertContainsOnly( 'string', $map );
- $this->assertNotContains( '', $map );
-
- // Codes special to MediaWiki should never appear in a map of "deprecated" codes
- $this->assertArrayNotHasKey( 'qqq', $map, 'documentation' );
- $this->assertNotContains( 'qqq', $map, 'documentation' );
- $this->assertArrayNotHasKey( 'qqx', $map, 'debug code' );
- $this->assertNotContains( 'qqx', $map, 'debug code' );
-
- // Valid language codes that are currently not "deprecated"
- $this->assertArrayNotHasKey( 'bh', $map, 'family of Bihari languages' );
- $this->assertArrayNotHasKey( 'no', $map, 'family of Norwegian languages' );
- $this->assertArrayNotHasKey( 'simple', $map );
- }
-
- public function testReplaceDeprecatedCodes() {
- $this->assertEquals( 'gsw', LanguageCode::replaceDeprecatedCodes( 'als' ) );
- $this->assertEquals( 'gsw', LanguageCode::replaceDeprecatedCodes( 'gsw' ) );
- $this->assertEquals( null, LanguageCode::replaceDeprecatedCodes( null ) );
- }
-
- /**
- * test @see LanguageCode::bcp47().
- * Please note the BCP 47 explicitly state that language codes are case
- * insensitive, there are some exceptions to the rule :)
- * This test is used to verify our formatting against all lower and
- * all upper cases language code.
- *
- * @see https://tools.ietf.org/html/bcp47
- * @dataProvider provideLanguageCodes()
- */
- public function testBcp47( $code, $expected ) {
- $this->assertEquals( $expected, LanguageCode::bcp47( $code ),
- "Applying BCP 47 standard to '$code'"
- );
-
- $code = strtolower( $code );
- $this->assertEquals( $expected, LanguageCode::bcp47( $code ),
- "Applying BCP 47 standard to lower case '$code'"
- );
-
- $code = strtoupper( $code );
- $this->assertEquals( $expected, LanguageCode::bcp47( $code ),
- "Applying BCP 47 standard to upper case '$code'"
- );
- }
-
- /**
- * Array format is ($code, $expected)
- */
- public static function provideLanguageCodes() {
- return [
- // Extracted from BCP 47 (list not exhaustive)
- # 2.1.1
- [ 'en-ca-x-ca', 'en-CA-x-ca' ],
- [ 'sgn-be-fr', 'sgn-BE-FR' ],
- [ 'az-latn-x-latn', 'az-Latn-x-latn' ],
- # 2.2
- [ 'sr-Latn-RS', 'sr-Latn-RS' ],
- [ 'az-arab-ir', 'az-Arab-IR' ],
-
- # 2.2.5
- [ 'sl-nedis', 'sl-nedis' ],
- [ 'de-ch-1996', 'de-CH-1996' ],
-
- # 2.2.6
- [
- 'en-latn-gb-boont-r-extended-sequence-x-private',
- 'en-Latn-GB-boont-r-extended-sequence-x-private'
- ],
-
- // Examples from BCP 47 Appendix A
- # Simple language subtag:
- [ 'DE', 'de' ],
- [ 'fR', 'fr' ],
- [ 'ja', 'ja' ],
-
- # Language subtag plus script subtag:
- [ 'zh-hans', 'zh-Hans' ],
- [ 'sr-cyrl', 'sr-Cyrl' ],
- [ 'sr-latn', 'sr-Latn' ],
-
- # Extended language subtags and their primary language subtag
- # counterparts:
- [ 'zh-cmn-hans-cn', 'zh-cmn-Hans-CN' ],
- [ 'cmn-hans-cn', 'cmn-Hans-CN' ],
- [ 'zh-yue-hk', 'zh-yue-HK' ],
- [ 'yue-hk', 'yue-HK' ],
-
- # Language-Script-Region:
- [ 'zh-hans-cn', 'zh-Hans-CN' ],
- [ 'sr-latn-RS', 'sr-Latn-RS' ],
-
- # Language-Variant:
- [ 'sl-rozaj', 'sl-rozaj' ],
- [ 'sl-rozaj-biske', 'sl-rozaj-biske' ],
- [ 'sl-nedis', 'sl-nedis' ],
-
- # Language-Region-Variant:
- [ 'de-ch-1901', 'de-CH-1901' ],
- [ 'sl-it-nedis', 'sl-IT-nedis' ],
-
- # Language-Script-Region-Variant:
- [ 'hy-latn-it-arevela', 'hy-Latn-IT-arevela' ],
-
- # Language-Region:
- [ 'de-de', 'de-DE' ],
- [ 'en-us', 'en-US' ],
- [ 'es-419', 'es-419' ],
-
- # Private use subtags:
- [ 'de-ch-x-phonebk', 'de-CH-x-phonebk' ],
- [ 'az-arab-x-aze-derbend', 'az-Arab-x-aze-derbend' ],
- /**
- * Previous test does not reflect the BCP 47 which states:
- * az-Arab-x-AZE-derbend
- * AZE being private, it should be lower case, hence the test above
- * should probably be:
- * [ 'az-arab-x-aze-derbend', 'az-Arab-x-AZE-derbend' ],
- */
-
- # Private use registry values:
- [ 'x-whatever', 'x-whatever' ],
- [ 'qaa-qaaa-qm-x-southern', 'qaa-Qaaa-QM-x-southern' ],
- [ 'de-qaaa', 'de-Qaaa' ],
- [ 'sr-latn-qm', 'sr-Latn-QM' ],
- [ 'sr-qaaa-rs', 'sr-Qaaa-RS' ],
-
- # Tags that use extensions
- [ 'en-us-u-islamcal', 'en-US-u-islamcal' ],
- [ 'zh-cn-a-myext-x-private', 'zh-CN-a-myext-x-private' ],
- [ 'en-a-myext-b-another', 'en-a-myext-b-another' ],
-
- # Invalid:
- // de-419-DE
- // a-DE
- // ar-a-aaa-b-bbb-a-ccc
-
- # Non-standard and deprecated language codes used by MediaWiki
- [ 'als', 'gsw' ],
- [ 'bat-smg', 'sgs' ],
- [ 'be-x-old', 'be-tarask' ],
- [ 'fiu-vro', 'vro' ],
- [ 'roa-rup', 'rup' ],
- [ 'zh-classical', 'lzh' ],
- [ 'zh-min-nan', 'nan' ],
- [ 'zh-yue', 'yue' ],
- [ 'cbk-zam', 'cbk' ],
- [ 'de-formal', 'de-x-formal' ],
- [ 'eml', 'egl' ],
- [ 'en-rtl', 'en-x-rtl' ],
- [ 'es-formal', 'es-x-formal' ],
- [ 'hu-formal', 'hu-x-formal' ],
- [ 'kk-Arab', 'kk-Arab' ],
- [ 'kk-Cyrl', 'kk-Cyrl' ],
- [ 'kk-Latn', 'kk-Latn' ],
- [ 'map-bms', 'jv-x-bms' ],
- [ 'mo', 'ro-Cyrl-MD' ],
- [ 'nrm', 'nrf' ],
- [ 'nl-informal', 'nl-x-informal' ],
- [ 'roa-tara', 'nap-x-tara' ],
- [ 'simple', 'en-simple' ],
- [ 'sr-ec', 'sr-Cyrl' ],
- [ 'sr-el', 'sr-Latn' ],
- [ 'zh-cn', 'zh-Hans-CN' ],
- [ 'zh-sg', 'zh-Hans-SG' ],
- [ 'zh-my', 'zh-Hans-MY' ],
- [ 'zh-tw', 'zh-Hant-TW' ],
- [ 'zh-hk', 'zh-Hant-HK' ],
- [ 'zh-mo', 'zh-Hant-MO' ],
- [ 'zh-hans', 'zh-Hans' ],
- [ 'zh-hant', 'zh-Hant' ],
- ];
- }
-
-}
--- /dev/null
+<?php
+
+/**
+ * @covers LanguageCode
+ * @group Language
+ *
+ * @author Thiemo Kreuz
+ */
+class LanguageCodeTest extends MediaWikiUnitTestCase {
+
+ public function testConstructor() {
+ $instance = new LanguageCode();
+
+ $this->assertInstanceOf( LanguageCode::class, $instance );
+ }
+
+ public function testGetDeprecatedCodeMapping() {
+ $map = LanguageCode::getDeprecatedCodeMapping();
+
+ $this->assertInternalType( 'array', $map );
+ $this->assertContainsOnly( 'string', array_keys( $map ) );
+ $this->assertArrayNotHasKey( '', $map );
+ $this->assertContainsOnly( 'string', $map );
+ $this->assertNotContains( '', $map );
+
+ // Codes special to MediaWiki should never appear in a map of "deprecated" codes
+ $this->assertArrayNotHasKey( 'qqq', $map, 'documentation' );
+ $this->assertNotContains( 'qqq', $map, 'documentation' );
+ $this->assertArrayNotHasKey( 'qqx', $map, 'debug code' );
+ $this->assertNotContains( 'qqx', $map, 'debug code' );
+
+ // Valid language codes that are currently not "deprecated"
+ $this->assertArrayNotHasKey( 'bh', $map, 'family of Bihari languages' );
+ $this->assertArrayNotHasKey( 'no', $map, 'family of Norwegian languages' );
+ $this->assertArrayNotHasKey( 'simple', $map );
+ }
+
+ public function testReplaceDeprecatedCodes() {
+ $this->assertEquals( 'gsw', LanguageCode::replaceDeprecatedCodes( 'als' ) );
+ $this->assertEquals( 'gsw', LanguageCode::replaceDeprecatedCodes( 'gsw' ) );
+ $this->assertEquals( null, LanguageCode::replaceDeprecatedCodes( null ) );
+ }
+
+ /**
+ * test @see LanguageCode::bcp47().
+ * Please note the BCP 47 explicitly state that language codes are case
+ * insensitive, there are some exceptions to the rule :)
+ * This test is used to verify our formatting against all lower and
+ * all upper cases language code.
+ *
+ * @see https://tools.ietf.org/html/bcp47
+ * @dataProvider provideLanguageCodes()
+ */
+ public function testBcp47( $code, $expected ) {
+ $this->assertEquals( $expected, LanguageCode::bcp47( $code ),
+ "Applying BCP 47 standard to '$code'"
+ );
+
+ $code = strtolower( $code );
+ $this->assertEquals( $expected, LanguageCode::bcp47( $code ),
+ "Applying BCP 47 standard to lower case '$code'"
+ );
+
+ $code = strtoupper( $code );
+ $this->assertEquals( $expected, LanguageCode::bcp47( $code ),
+ "Applying BCP 47 standard to upper case '$code'"
+ );
+ }
+
+ /**
+ * Array format is ($code, $expected)
+ */
+ public static function provideLanguageCodes() {
+ return [
+ // Extracted from BCP 47 (list not exhaustive)
+ # 2.1.1
+ [ 'en-ca-x-ca', 'en-CA-x-ca' ],
+ [ 'sgn-be-fr', 'sgn-BE-FR' ],
+ [ 'az-latn-x-latn', 'az-Latn-x-latn' ],
+ # 2.2
+ [ 'sr-Latn-RS', 'sr-Latn-RS' ],
+ [ 'az-arab-ir', 'az-Arab-IR' ],
+
+ # 2.2.5
+ [ 'sl-nedis', 'sl-nedis' ],
+ [ 'de-ch-1996', 'de-CH-1996' ],
+
+ # 2.2.6
+ [
+ 'en-latn-gb-boont-r-extended-sequence-x-private',
+ 'en-Latn-GB-boont-r-extended-sequence-x-private'
+ ],
+
+ // Examples from BCP 47 Appendix A
+ # Simple language subtag:
+ [ 'DE', 'de' ],
+ [ 'fR', 'fr' ],
+ [ 'ja', 'ja' ],
+
+ # Language subtag plus script subtag:
+ [ 'zh-hans', 'zh-Hans' ],
+ [ 'sr-cyrl', 'sr-Cyrl' ],
+ [ 'sr-latn', 'sr-Latn' ],
+
+ # Extended language subtags and their primary language subtag
+ # counterparts:
+ [ 'zh-cmn-hans-cn', 'zh-cmn-Hans-CN' ],
+ [ 'cmn-hans-cn', 'cmn-Hans-CN' ],
+ [ 'zh-yue-hk', 'zh-yue-HK' ],
+ [ 'yue-hk', 'yue-HK' ],
+
+ # Language-Script-Region:
+ [ 'zh-hans-cn', 'zh-Hans-CN' ],
+ [ 'sr-latn-RS', 'sr-Latn-RS' ],
+
+ # Language-Variant:
+ [ 'sl-rozaj', 'sl-rozaj' ],
+ [ 'sl-rozaj-biske', 'sl-rozaj-biske' ],
+ [ 'sl-nedis', 'sl-nedis' ],
+
+ # Language-Region-Variant:
+ [ 'de-ch-1901', 'de-CH-1901' ],
+ [ 'sl-it-nedis', 'sl-IT-nedis' ],
+
+ # Language-Script-Region-Variant:
+ [ 'hy-latn-it-arevela', 'hy-Latn-IT-arevela' ],
+
+ # Language-Region:
+ [ 'de-de', 'de-DE' ],
+ [ 'en-us', 'en-US' ],
+ [ 'es-419', 'es-419' ],
+
+ # Private use subtags:
+ [ 'de-ch-x-phonebk', 'de-CH-x-phonebk' ],
+ [ 'az-arab-x-aze-derbend', 'az-Arab-x-aze-derbend' ],
+ /**
+ * Previous test does not reflect the BCP 47 which states:
+ * az-Arab-x-AZE-derbend
+ * AZE being private, it should be lower case, hence the test above
+ * should probably be:
+ * [ 'az-arab-x-aze-derbend', 'az-Arab-x-AZE-derbend' ],
+ */
+
+ # Private use registry values:
+ [ 'x-whatever', 'x-whatever' ],
+ [ 'qaa-qaaa-qm-x-southern', 'qaa-Qaaa-QM-x-southern' ],
+ [ 'de-qaaa', 'de-Qaaa' ],
+ [ 'sr-latn-qm', 'sr-Latn-QM' ],
+ [ 'sr-qaaa-rs', 'sr-Qaaa-RS' ],
+
+ # Tags that use extensions
+ [ 'en-us-u-islamcal', 'en-US-u-islamcal' ],
+ [ 'zh-cn-a-myext-x-private', 'zh-CN-a-myext-x-private' ],
+ [ 'en-a-myext-b-another', 'en-a-myext-b-another' ],
+
+ # Invalid:
+ // de-419-DE
+ // a-DE
+ // ar-a-aaa-b-bbb-a-ccc
+
+ # Non-standard and deprecated language codes used by MediaWiki
+ [ 'als', 'gsw' ],
+ [ 'bat-smg', 'sgs' ],
+ [ 'be-x-old', 'be-tarask' ],
+ [ 'fiu-vro', 'vro' ],
+ [ 'roa-rup', 'rup' ],
+ [ 'zh-classical', 'lzh' ],
+ [ 'zh-min-nan', 'nan' ],
+ [ 'zh-yue', 'yue' ],
+ [ 'cbk-zam', 'cbk' ],
+ [ 'de-formal', 'de-x-formal' ],
+ [ 'eml', 'egl' ],
+ [ 'en-rtl', 'en-x-rtl' ],
+ [ 'es-formal', 'es-x-formal' ],
+ [ 'hu-formal', 'hu-x-formal' ],
+ [ 'kk-Arab', 'kk-Arab' ],
+ [ 'kk-Cyrl', 'kk-Cyrl' ],
+ [ 'kk-Latn', 'kk-Latn' ],
+ [ 'map-bms', 'jv-x-bms' ],
+ [ 'mo', 'ro-Cyrl-MD' ],
+ [ 'nrm', 'nrf' ],
+ [ 'nl-informal', 'nl-x-informal' ],
+ [ 'roa-tara', 'nap-x-tara' ],
+ [ 'simple', 'en-simple' ],
+ [ 'sr-ec', 'sr-Cyrl' ],
+ [ 'sr-el', 'sr-Latn' ],
+ [ 'zh-cn', 'zh-Hans-CN' ],
+ [ 'zh-sg', 'zh-Hans-SG' ],
+ [ 'zh-my', 'zh-Hans-MY' ],
+ [ 'zh-tw', 'zh-Hant-TW' ],
+ [ 'zh-hk', 'zh-Hant-HK' ],
+ [ 'zh-mo', 'zh-Hant-MO' ],
+ [ 'zh-hans', 'zh-Hans' ],
+ [ 'zh-hant', 'zh-Hant' ],
+ ];
+ }
+
+}