summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'MLEB/cldr/includes/LanguageNames.php')
-rw-r--r--MLEB/cldr/includes/LanguageNames.php20
1 files changed, 8 insertions, 12 deletions
diff --git a/MLEB/cldr/includes/LanguageNames.php b/MLEB/cldr/includes/LanguageNames.php
index 4c4992d1..f9423062 100644
--- a/MLEB/cldr/includes/LanguageNames.php
+++ b/MLEB/cldr/includes/LanguageNames.php
@@ -12,11 +12,11 @@ class LanguageNames extends CldrNames {
private static $cache = [];
- const FALLBACK_NATIVE = 0; // Missing entries fallback to native name
- const FALLBACK_NORMAL = 1; // Missing entries fallback through the fallback chain
- const LIST_MW_SUPPORTED = 0; // Only names that have localisation in MediaWiki
- const LIST_MW = 1; // All names that are in Names.php
- const LIST_MW_AND_CLDR = 2; // Combination of Names.php and what is in cldr
+ public const FALLBACK_NATIVE = 0; // Missing entries fallback to native name
+ public const FALLBACK_NORMAL = 1; // Missing entries fallback through the fallback chain
+ public const LIST_MW_SUPPORTED = 0; // Only names that have localisation in MediaWiki
+ public const LIST_MW = 1; // All names that are in Names.php
+ public const LIST_MW_AND_CLDR = 2; // Combination of Names.php and what is in cldr
/**
* Get localized language names for a particular language, using fallback languages for missing
@@ -96,6 +96,7 @@ class LanguageNames extends CldrNames {
if ( file_exists( $override ) ) {
$languageNames = false;
require $override;
+ // @phan-suppress-next-line PhanImpossibleCondition
if ( is_array( $languageNames ) ) {
self::$cache[$code] = $languageNames;
}
@@ -105,14 +106,9 @@ class LanguageNames extends CldrNames {
if ( file_exists( $filename ) ) {
$languageNames = false;
require $filename;
+ // @phan-suppress-next-line PhanImpossibleCondition
if ( is_array( $languageNames ) ) {
- if ( isset( self::$cache[$code] ) ) {
- // Add to existing list of localized language names
- self::$cache[$code] = self::$cache[$code] + $languageNames;
- } else {
- // No list exists, so create it
- self::$cache[$code] = $languageNames;
- }
+ self::$cache[$code] = self::$cache[$code] + $languageNames;
}
} else {
wfDebug( __METHOD__ . ": Unable to load language names for $filename\n" );