Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
19.05% covered (danger)
19.05%
36 / 189
CRAP
51.39% covered (warning)
51.39%
867 / 1687
Language
0.00% covered (danger)
0.00%
0 / 1
19.05% covered (danger)
19.05%
36 / 189
62774.89
51.39% covered (warning)
51.39%
867 / 1687
 factory
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 clearCaches
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
8 / 8
 isSupportedLanguage
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 isWellFormedLanguageTag
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
27 / 27
 isValidCode
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 isValidBuiltInCode
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 isKnownLanguageTag
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 getLocalisationCache
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
12.00
0.00% covered (danger)
0.00%
0 / 23
 __destruct
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 3
 initContLang
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getFallbackLanguages
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getBookstoreList
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getNamespaces
0.00% covered (danger)
0.00%
0 / 1
5.00
94.74% covered (success)
94.74%
18 / 19
 setNamespaces
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 3
 resetNamespaces
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 4
 getFormattedNamespaces
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 4
 getNsText
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 2
 getFormattedNsText
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 2
 getGenderNsText
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 3
 needsGenderDistinction
0.00% covered (danger)
0.00%
0 / 1
20.00
0.00% covered (danger)
0.00%
0 / 7
 getLocalNsIndex
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 3
 getNamespaceAliases
0.00% covered (danger)
0.00%
0 / 1
11.23
76.92% covered (warning)
76.92%
20 / 26
 getNamespaceIds
0.00% covered (danger)
0.00%
0 / 1
42.00
0.00% covered (danger)
0.00%
0 / 11
 getNsIndex
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 7
 getVariantname
0.00% covered (danger)
0.00%
0 / 1
20.00
0.00% covered (danger)
0.00%
0 / 7
 getDatePreferences
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getDateFormats
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getDefaultDateFormat
0.00% covered (danger)
0.00%
0 / 1
12.00
0.00% covered (danger)
0.00%
0 / 5
 getDatePreferenceMigrationMap
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getExtraUserToggles
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 2
 getUserToggle
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 fetchLanguageNames
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 fetchLanguageName
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 getMessageFromDB
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 msg
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getMonthName
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getMonthNamesArray
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 4
 getMonthNameGen
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getMonthAbbreviation
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getMonthAbbreviationsArray
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 4
 getWeekdayName
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getWeekdayAbbreviation
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getIranianCalendarMonthName
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getHebrewCalendarMonthName
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getHebrewCalendarMonthNameGen
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getHijriCalendarMonthName
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 dateTimeObjFormat
0.00% covered (danger)
0.00%
0 / 1
12.00
0.00% covered (danger)
0.00%
0 / 4
 sprintfDate
0.00% covered (danger)
0.00%
0 / 1
137.12
93.35% covered (success)
93.35%
365 / 391
 tsToIranian
0.00% covered (danger)
0.00%
0 / 1
90.00
0.00% covered (danger)
0.00%
0 / 26
 tsToHijri
0.00% covered (danger)
0.00%
0 / 1
56.00
0.00% covered (danger)
0.00%
0 / 26
 tsToHebrew
0.00% covered (danger)
0.00%
0 / 1
812.00
0.00% covered (danger)
0.00%
0 / 57
 hebrewYearStart
0.00% covered (danger)
0.00%
0 / 1
156.00
0.00% covered (danger)
0.00%
0 / 18
 tsToYear
0.00% covered (danger)
0.00%
0 / 1
2162.00
0.00% covered (danger)
0.00%
0 / 53
 strongDirFromContent
0.00% covered (danger)
0.00%
0 / 1
12.00
0.00% covered (danger)
0.00%
0 / 5
 romanNumeral
0.00% covered (danger)
0.00%
0 / 1
5.03
90.00% covered (success)
90.00%
9 / 10
 hebrewNumeral
100.00% covered (success)
100.00%
1 / 1
13
100.00% covered (success)
100.00%
33 / 33
 userAdjust
0.00% covered (danger)
0.00%
0 / 1
20.53
52.78% covered (warning)
52.78%
19 / 36
 dateFormat
0.00% covered (danger)
0.00%
0 / 1
20.00
0.00% covered (danger)
0.00%
0 / 9
 getDateFormatString
0.00% covered (danger)
0.00%
0 / 1
56.00
0.00% covered (danger)
0.00%
0 / 15
 date
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 5
 time
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 5
 timeanddate
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 5
 formatDuration
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
6 / 6
 getDurationIntervals
0.00% covered (danger)
0.00%
0 / 1
42.00
0.00% covered (danger)
0.00%
0 / 12
 internalUserTimeAndDate
0.00% covered (danger)
0.00%
0 / 1
20.00
0.00% covered (danger)
0.00%
0 / 12
 userDate
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 userTime
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 userTimeAndDate
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getHumanTimestamp
0.00% covered (danger)
0.00%
0 / 1
20.00
0.00% covered (danger)
0.00%
0 / 12
 getHumanTimestampInternal
0.00% covered (danger)
0.00%
0 / 1
380.00
0.00% covered (danger)
0.00%
0 / 38
 getMessage
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getAllMessages
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 iconv
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 4
 ucfirst
100.00% covered (success)
100.00%
1 / 1
4
100.00% covered (success)
100.00%
8 / 8
 uc
0.00% covered (danger)
0.00%
0 / 1
12.00
0.00% covered (danger)
0.00%
0 / 3
 mbUpperChar
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 2
 lcfirst
0.00% covered (danger)
0.00%
0 / 1
4.03
87.50% covered (warning)
87.50%
7 / 8
 lc
0.00% covered (danger)
0.00%
0 / 1
12.00
0.00% covered (danger)
0.00%
0 / 3
 isMultibyte
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 ucwords
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
9 / 9
 ucwordbreaks
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
14 / 14
 caseFold
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 checkTitleEncoding
0.00% covered (danger)
0.00%
0 / 1
3.58
60.00% covered (warning)
60.00%
3 / 5
 fallback8bitEncoding
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 hasWordBreaks
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 segmentByWord
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 normalizeForSearch
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 convertDoubleWidth
0.00% covered (danger)
0.00%
0 / 1
2.35
55.56% covered (warning)
55.56%
5 / 9
 insertSpace
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 3
 convertForSearchResult
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 firstChar
0.00% covered (danger)
0.00%
0 / 1
342.00
0.00% covered (danger)
0.00%
0 / 39
 normalize
0.00% covered (danger)
0.00%
0 / 1
2.15
66.67% covered (warning)
66.67%
4 / 6
 transformUsingPairFile
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 5
 isRTL
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getDir
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 1
 alignStart
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 1
 alignEnd
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 1
 getDirMarkEntity
0.00% covered (danger)
0.00%
0 / 1
20.00
0.00% covered (danger)
0.00%
0 / 3
 getDirMark
0.00% covered (danger)
0.00%
0 / 1
20.00
0.00% covered (danger)
0.00%
0 / 5
 capitalizeAllNouns
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getArrow
0.00% covered (danger)
0.00%
0 / 1
90.00
0.00% covered (danger)
0.00%
0 / 14
 linkPrefixExtension
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getMagicWords
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getMagic
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 7
 addMagicWordsByLang
0.00% covered (danger)
0.00%
0 / 1
12.00
0.00% covered (danger)
0.00%
0 / 6
 getSpecialPageAliases
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 4
 emphasize
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 formatNum
100.00% covered (success)
100.00%
1 / 1
5
100.00% covered (success)
100.00%
11 / 11
 formatNumNoSeparators
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 parseFormattedNumber
100.00% covered (success)
100.00%
1 / 1
3
100.00% covered (success)
100.00%
10 / 10
 commafy
0.00% covered (danger)
0.00%
0 / 1
90.16
27.03% covered (danger)
27.03%
10 / 37
 digitGroupingPattern
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 digitTransformTable
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 separatorTransformTable
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 minimumGroupingDigits
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 listToText
100.00% covered (success)
100.00%
1 / 1
4
100.00% covered (success)
100.00%
12 / 12
 commaList
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 3
 semicolonList
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 3
 pipeList
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 3
 truncateForDatabase
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 truncateForVisual
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 truncateInternal
0.00% covered (danger)
0.00%
0 / 1
9
95.45% covered (success)
95.45%
21 / 22
 removeBadCharLast
0.00% covered (danger)
0.00%
0 / 1
30.00
0.00% covered (danger)
0.00%
0 / 10
 removeBadCharFirst
0.00% covered (danger)
0.00%
0 / 1
20.00
0.00% covered (danger)
0.00%
0 / 5
 truncateHtml
0.00% covered (danger)
0.00%
0 / 1
29
97.06% covered (success)
97.06%
66 / 68
 truncate_skip
0.00% covered (danger)
0.00%
0 / 1
20.00
0.00% covered (danger)
0.00%
0 / 9
 truncate_endBracket
0.00% covered (danger)
0.00%
0 / 1
56.00
0.00% covered (danger)
0.00%
0 / 9
 convertGrammar
0.00% covered (danger)
0.00%
0 / 1
8.16
86.36% covered (warning)
86.36%
19 / 22
 getGrammarForms
0.00% covered (danger)
0.00%
0 / 1
12.00
0.00% covered (danger)
0.00%
0 / 5
 getGrammarTransformations
0.00% covered (danger)
0.00%
0 / 1
4.02
88.89% covered (warning)
88.89%
8 / 9
 gender
0.00% covered (danger)
0.00%
0 / 1
20.00
0.00% covered (danger)
0.00%
0 / 8
 convertPlural
100.00% covered (success)
100.00%
1 / 1
3
100.00% covered (success)
100.00%
8 / 8
 handleExplicitPluralForms
0.00% covered (danger)
0.00%
0 / 1
20.00
0.00% covered (danger)
0.00%
0 / 7
 preConvertPlural
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 embedBidi
100.00% covered (success)
100.00%
1 / 1
3
100.00% covered (success)
100.00%
6 / 6
 translateBlockExpiry
0.00% covered (danger)
0.00%
0 / 1
10.02
94.44% covered (success)
94.44%
17 / 18
 segmentForDiff
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 unsegmentForDiff
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 newConverter
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getConverter
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 autoConvert
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 autoConvertToAllVariants
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 convert
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 convertTitle
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 convertNamespace
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 hasVariants
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 hasVariant
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
1 / 1
 convertHtml
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 convertCategoryKey
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getVariants
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getPreferredVariant
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getDefaultVariant
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getURLVariant
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 findVariantLink
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 2
 getExtraHashOptions
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 updateConversionTable
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 2
 linkTrail
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 linkPrefixCharset
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getParentLanguage
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 equals
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
1 / 1
 getCode
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getHtmlCode
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 3
 getCodeFromFileName
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 6
 classFromCode
0.00% covered (danger)
0.00%
0 / 1
12.00
0.00% covered (danger)
0.00%
0 / 4
 getFileName
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 getMessagesFileName
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 getJsonMessagesFileName
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 getFallbackFor
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 getFallbacksFor
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 getFallbacksIncludingSiteLanguage
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 getMessagesFor
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getMessageFor
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getMessageKeysFor
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 fixVariableInNamespace
0.00% covered (danger)
0.00%
0 / 1
2.00
90.00% covered (success)
90.00%
9 / 10
 formatExpiry
0.00% covered (danger)
0.00%
0 / 1
56.00
0.00% covered (danger)
0.00%
0 / 10
 formatTimePeriod
100.00% covered (success)
100.00%
1 / 1
23
100.00% covered (success)
100.00%
77 / 77
 formatBitrate
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 formatComputingNumbers
0.00% covered (danger)
0.00%
0 / 1
30.00
0.00% covered (danger)
0.00%
0 / 16
 formatSize
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 specialList
0.00% covered (danger)
0.00%
0 / 1
12.00
0.00% covered (danger)
0.00%
0 / 6
 viewPrevNext
0.00% covered (danger)
0.00%
0 / 1
20.00
0.00% covered (danger)
0.00%
0 / 17
 numLink
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 5
 getConvRuleTitle
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 getCompiledPluralRules
0.00% covered (danger)
0.00%
0 / 1
20.00
0.00% covered (danger)
0.00%
0 / 9
 getPluralRules
0.00% covered (danger)
0.00%
0 / 1
20.00
0.00% covered (danger)
0.00%
0 / 9
 getPluralRuleTypes
0.00% covered (danger)
0.00%
0 / 1
20.00
0.00% covered (danger)
0.00%
0 / 9
 getPluralRuleIndexNumber
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 3
 getPluralRuleType
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
3 / 3
<?php
/**
 * Internationalisation code.
 * See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more information.
 *
 * This 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.
 *
 * This 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. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @file
 * @ingroup Language
 */
/**
 * @defgroup Language Language
 */
use CLDRPluralRuleParser\Evaluator;
use MediaWiki\Languages\LanguageFallback;
use MediaWiki\Languages\LanguageNameUtils;
use MediaWiki\MediaWikiServices;
use Wikimedia\Assert\Assert;
/**
 * Internationalisation code
 * @ingroup Language
 */
class Language {
    /**
     * Return autonyms in fetchLanguageName(s).
     * @since 1.32
     * @deprecated since 1.34, LanguageNameUtils::AUTONYMS
     */
    const AS_AUTONYMS = LanguageNameUtils::AUTONYMS;
    /**
     * Return all known languages in fetchLanguageName(s).
     * @since 1.32
     * @deprecated since 1.34, use LanguageNameUtils::ALL
     */
    const ALL = LanguageNameUtils::ALL;
    /**
     * Return in fetchLanguageName(s) only the languages for which we have at
     * least some localisation.
     * @since 1.32
     * @deprecated since 1.34, use LanguageNameUtils::SUPPORTED
     */
    const SUPPORTED = LanguageNameUtils::SUPPORTED;
    /**
     * @var LanguageConverter|FakeConverter
     */
    public $mConverter;
    public $mVariants, $mCode, $mLoaded = false;
    public $mMagicExtensions = [];
    private $mHtmlCode = null;
    /** @var Language|false */
    private $mParentLanguage = false;
    public $dateFormatStrings = [];
    public $mExtendedSpecialPageAliases;
    /** @var array|null */
    protected $namespaceNames;
    protected $mNamespaceIds, $namespaceAliases;
    /**
     * ReplacementArray object caches
     */
    public $transformData = [];
    /** @var LocalisationCache */
    private $localisationCache;
    /** @var LanguageNameUtils */
    private $langNameUtils;
    /** @var LanguageFallback */
    private $langFallback;
    /** @var array[]|null */
    private $grammarTransformCache;
    /**
     * @deprecated since 1.35, use LanguageFactory
     * @var array
     */
    public static $mLangObjCache = [];
    /**
     * Return a fallback chain for messages in getFallbacksFor
     * @since 1.32
     * @deprecated since 1.35, use LanguageFallback::MESSAGES
     */
    const MESSAGES_FALLBACKS = LanguageFallback::MESSAGES;
    /**
     * Return a strict fallback chain in getFallbacksFor
     * @since 1.32
     * @deprecated since 1.35, use LanguageFallback::STRICT
     */
    const STRICT_FALLBACKS = LanguageFallback::STRICT;
    // TODO Make these const once we drop HHVM support (T192166)
    public static $mWeekdayMsgs = [
        'sunday', 'monday', 'tuesday', 'wednesday', 'thursday',
        'friday', 'saturday'
    ];
    public static $mWeekdayAbbrevMsgs = [
        'sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'
    ];
    public static $mMonthMsgs = [
        'january', 'february', 'march', 'april', 'may_long', 'june',
        'july', 'august', 'september', 'october', 'november',
        'december'
    ];
    public static $mMonthGenMsgs = [
        'january-gen', 'february-gen', 'march-gen', 'april-gen', 'may-gen', 'june-gen',
        'july-gen', 'august-gen', 'september-gen', 'october-gen', 'november-gen',
        'december-gen'
    ];
    public static $mMonthAbbrevMsgs = [
        'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug',
        'sep', 'oct', 'nov', 'dec'
    ];
    public static $mIranianCalendarMonthMsgs = [
        'iranian-calendar-m1', 'iranian-calendar-m2', 'iranian-calendar-m3',
        'iranian-calendar-m4', 'iranian-calendar-m5', 'iranian-calendar-m6',
        'iranian-calendar-m7', 'iranian-calendar-m8', 'iranian-calendar-m9',
        'iranian-calendar-m10', 'iranian-calendar-m11', 'iranian-calendar-m12'
    ];
    public static $mHebrewCalendarMonthMsgs = [
        'hebrew-calendar-m1', 'hebrew-calendar-m2', 'hebrew-calendar-m3',
        'hebrew-calendar-m4', 'hebrew-calendar-m5', 'hebrew-calendar-m6',
        'hebrew-calendar-m7', 'hebrew-calendar-m8', 'hebrew-calendar-m9',
        'hebrew-calendar-m10', 'hebrew-calendar-m11', 'hebrew-calendar-m12',
        'hebrew-calendar-m6a', 'hebrew-calendar-m6b'
    ];
    public static $mHebrewCalendarMonthGenMsgs = [
        'hebrew-calendar-m1-gen', 'hebrew-calendar-m2-gen', 'hebrew-calendar-m3-gen',
        'hebrew-calendar-m4-gen', 'hebrew-calendar-m5-gen', 'hebrew-calendar-m6-gen',
        'hebrew-calendar-m7-gen', 'hebrew-calendar-m8-gen', 'hebrew-calendar-m9-gen',
        'hebrew-calendar-m10-gen', 'hebrew-calendar-m11-gen', 'hebrew-calendar-m12-gen',
        'hebrew-calendar-m6a-gen', 'hebrew-calendar-m6b-gen'
    ];
    public static $mHijriCalendarMonthMsgs = [
        'hijri-calendar-m1', 'hijri-calendar-m2', 'hijri-calendar-m3',
        'hijri-calendar-m4', 'hijri-calendar-m5', 'hijri-calendar-m6',
        'hijri-calendar-m7', 'hijri-calendar-m8', 'hijri-calendar-m9',
        'hijri-calendar-m10', 'hijri-calendar-m11', 'hijri-calendar-m12'
    ];
    /**
     * @since 1.20
     * @var array
     */
    public static $durationIntervals = [
        'millennia' => 31556952000,
        'centuries' => 3155695200,
        'decades' => 315569520,
        'years' => 31556952, // 86400 * ( 365 + ( 24 * 3 + 25 ) / 400 )
        'weeks' => 604800,
        'days' => 86400,
        'hours' => 3600,
        'minutes' => 60,
        'seconds' => 1,
    ];
    /**
     * Unicode directional formatting characters, for embedBidi()
     */
    private const LRE = "\u{202A}"; // U+202A LEFT-TO-RIGHT EMBEDDING
    private const RLE = "\u{202B}"; // U+202B RIGHT-TO-LEFT EMBEDDING
    private const PDF = "\u{202C}"; // U+202C POP DIRECTIONAL FORMATTING
    /**
     * Directionality test regex for embedBidi(). Matches the first strong directionality codepoint:
     * - in group 1 if it is LTR
     * - in group 2 if it is RTL
     * Does not match if there is no strong directionality codepoint.
     *
     * The form is '/(?:([strong ltr codepoint])|([strong rtl codepoint]))/u' .
     *
     * Generated by UnicodeJS (see tools/strongDir) from the UCD; see
     * https://phabricator.wikimedia.org/diffusion/GUJS/ .
     */
    // @codeCoverageIgnoreStart
    // phpcs:ignore Generic.Files.LineLength
    private static $strongDirRegex = '/(?:([\x{41}-\x{5a}\x{61}-\x{7a}\x{aa}\x{b5}\x{ba}\x{c0}-\x{d6}\x{d8}-\x{f6}\x{f8}-\x{2b8}\x{2bb}-\x{2c1}\x{2d0}\x{2d1}\x{2e0}-\x{2e4}\x{2ee}\x{370}-\x{373}\x{376}\x{377}\x{37a}-\x{37d}\x{37f}\x{386}\x{388}-\x{38a}\x{38c}\x{38e}-\x{3a1}\x{3a3}-\x{3f5}\x{3f7}-\x{482}\x{48a}-\x{52f}\x{531}-\x{556}\x{559}-\x{55f}\x{561}-\x{587}\x{589}\x{903}-\x{939}\x{93b}\x{93d}-\x{940}\x{949}-\x{94c}\x{94e}-\x{950}\x{958}-\x{961}\x{964}-\x{980}\x{982}\x{983}\x{985}-\x{98c}\x{98f}\x{990}\x{993}-\x{9a8}\x{9aa}-\x{9b0}\x{9b2}\x{9b6}-\x{9b9}\x{9bd}-\x{9c0}\x{9c7}\x{9c8}\x{9cb}\x{9cc}\x{9ce}\x{9d7}\x{9dc}\x{9dd}\x{9df}-\x{9e1}\x{9e6}-\x{9f1}\x{9f4}-\x{9fa}\x{a03}\x{a05}-\x{a0a}\x{a0f}\x{a10}\x{a13}-\x{a28}\x{a2a}-\x{a30}\x{a32}\x{a33}\x{a35}\x{a36}\x{a38}\x{a39}\x{a3e}-\x{a40}\x{a59}-\x{a5c}\x{a5e}\x{a66}-\x{a6f}\x{a72}-\x{a74}\x{a83}\x{a85}-\x{a8d}\x{a8f}-\x{a91}\x{a93}-\x{aa8}\x{aaa}-\x{ab0}\x{ab2}\x{ab3}\x{ab5}-\x{ab9}\x{abd}-\x{ac0}\x{ac9}\x{acb}\x{acc}\x{ad0}\x{ae0}\x{ae1}\x{ae6}-\x{af0}\x{af9}\x{b02}\x{b03}\x{b05}-\x{b0c}\x{b0f}\x{b10}\x{b13}-\x{b28}\x{b2a}-\x{b30}\x{b32}\x{b33}\x{b35}-\x{b39}\x{b3d}\x{b3e}\x{b40}\x{b47}\x{b48}\x{b4b}\x{b4c}\x{b57}\x{b5c}\x{b5d}\x{b5f}-\x{b61}\x{b66}-\x{b77}\x{b83}\x{b85}-\x{b8a}\x{b8e}-\x{b90}\x{b92}-\x{b95}\x{b99}\x{b9a}\x{b9c}\x{b9e}\x{b9f}\x{ba3}\x{ba4}\x{ba8}-\x{baa}\x{bae}-\x{bb9}\x{bbe}\x{bbf}\x{bc1}\x{bc2}\x{bc6}-\x{bc8}\x{bca}-\x{bcc}\x{bd0}\x{bd7}\x{be6}-\x{bf2}\x{c01}-\x{c03}\x{c05}-\x{c0c}\x{c0e}-\x{c10}\x{c12}-\x{c28}\x{c2a}-\x{c39}\x{c3d}\x{c41}-\x{c44}\x{c58}-\x{c5a}\x{c60}\x{c61}\x{c66}-\x{c6f}\x{c7f}\x{c82}\x{c83}\x{c85}-\x{c8c}\x{c8e}-\x{c90}\x{c92}-\x{ca8}\x{caa}-\x{cb3}\x{cb5}-\x{cb9}\x{cbd}-\x{cc4}\x{cc6}-\x{cc8}\x{cca}\x{ccb}\x{cd5}\x{cd6}\x{cde}\x{ce0}\x{ce1}\x{ce6}-\x{cef}\x{cf1}\x{cf2}\x{d02}\x{d03}\x{d05}-\x{d0c}\x{d0e}-\x{d10}\x{d12}-\x{d3a}\x{d3d}-\x{d40}\x{d46}-\x{d48}\x{d4a}-\x{d4c}\x{d4e}\x{d57}\x{d5f}-\x{d61}\x{d66}-\x{d75}\x{d79}-\x{d7f}\x{d82}\x{d83}\x{d85}-\x{d96}\x{d9a}-\x{db1}\x{db3}-\x{dbb}\x{dbd}\x{dc0}-\x{dc6}\x{dcf}-\x{dd1}\x{dd8}-\x{ddf}\x{de6}-\x{def}\x{df2}-\x{df4}\x{e01}-\x{e30}\x{e32}\x{e33}\x{e40}-\x{e46}\x{e4f}-\x{e5b}\x{e81}\x{e82}\x{e84}\x{e87}\x{e88}\x{e8a}\x{e8d}\x{e94}-\x{e97}\x{e99}-\x{e9f}\x{ea1}-\x{ea3}\x{ea5}\x{ea7}\x{eaa}\x{eab}\x{ead}-\x{eb0}\x{eb2}\x{eb3}\x{ebd}\x{ec0}-\x{ec4}\x{ec6}\x{ed0}-\x{ed9}\x{edc}-\x{edf}\x{f00}-\x{f17}\x{f1a}-\x{f34}\x{f36}\x{f38}\x{f3e}-\x{f47}\x{f49}-\x{f6c}\x{f7f}\x{f85}\x{f88}-\x{f8c}\x{fbe}-\x{fc5}\x{fc7}-\x{fcc}\x{fce}-\x{fda}\x{1000}-\x{102c}\x{1031}\x{1038}\x{103b}\x{103c}\x{103f}-\x{1057}\x{105a}-\x{105d}\x{1061}-\x{1070}\x{1075}-\x{1081}\x{1083}\x{1084}\x{1087}-\x{108c}\x{108e}-\x{109c}\x{109e}-\x{10c5}\x{10c7}\x{10cd}\x{10d0}-\x{1248}\x{124a}-\x{124d}\x{1250}-\x{1256}\x{1258}\x{125a}-\x{125d}\x{1260}-\x{1288}\x{128a}-\x{128d}\x{1290}-\x{12b0}\x{12b2}-\x{12b5}\x{12b8}-\x{12be}\x{12c0}\x{12c2}-\x{12c5}\x{12c8}-\x{12d6}\x{12d8}-\x{1310}\x{1312}-\x{1315}\x{1318}-\x{135a}\x{1360}-\x{137c}\x{1380}-\x{138f}\x{13a0}-\x{13f5}\x{13f8}-\x{13fd}\x{1401}-\x{167f}\x{1681}-\x{169a}\x{16a0}-\x{16f8}\x{1700}-\x{170c}\x{170e}-\x{1711}\x{1720}-\x{1731}\x{1735}\x{1736}\x{1740}-\x{1751}\x{1760}-\x{176c}\x{176e}-\x{1770}\x{1780}-\x{17b3}\x{17b6}\x{17be}-\x{17c5}\x{17c7}\x{17c8}\x{17d4}-\x{17da}\x{17dc}\x{17e0}-\x{17e9}\x{1810}-\x{1819}\x{1820}-\x{1877}\x{1880}-\x{18a8}\x{18aa}\x{18b0}-\x{18f5}\x{1900}-\x{191e}\x{1923}-\x{1926}\x{1929}-\x{192b}\x{1930}\x{1931}\x{1933}-\x{1938}\x{1946}-\x{196d}\x{1970}-\x{1974}\x{1980}-\x{19ab}\x{19b0}-\x{19c9}\x{19d0}-\x{19da}\x{1a00}-\x{1a16}\x{1a19}\x{1a1a}\x{1a1e}-\x{1a55}\x{1a57}\x{1a61}\x{1a63}\x{1a64}\x{1a6d}-\x{1a72}\x{1a80}-\x{1a89}\x{1a90}-\x{1a99}\x{1aa0}-\x{1aad}\x{1b04}-\x{1b33}\x{1b35}\x{1b3b}\x{1b3d}-\x{1b41}\x{1b43}-\x{1b4b}\x{1b50}-\x{1b6a}\x{1b74}-\x{1b7c}\x{1b82}-\x{1ba1}\x{1ba6}\x{1ba7}\x{1baa}\x{1bae}-\x{1be5}\x{1be7}\x{1bea}-\x{1bec}\x{1bee}\x{1bf2}\x{1bf3}\x{1bfc}-\x{1c2b}\x{1c34}\x{1c35}\x{1c3b}-\x{1c49}\x{1c4d}-\x{1c7f}\x{1cc0}-\x{1cc7}\x{1cd3}\x{1ce1}\x{1ce9}-\x{1cec}\x{1cee}-\x{1cf3}\x{1cf5}\x{1cf6}\x{1d00}-\x{1dbf}\x{1e00}-\x{1f15}\x{1f18}-\x{1f1d}\x{1f20}-\x{1f45}\x{1f48}-\x{1f4d}\x{1f50}-\x{1f57}\x{1f59}\x{1f5b}\x{1f5d}\x{1f5f}-\x{1f7d}\x{1f80}-\x{1fb4}\x{1fb6}-\x{1fbc}\x{1fbe}\x{1fc2}-\x{1fc4}\x{1fc6}-\x{1fcc}\x{1fd0}-\x{1fd3}\x{1fd6}-\x{1fdb}\x{1fe0}-\x{1fec}\x{1ff2}-\x{1ff4}\x{1ff6}-\x{1ffc}\x{200e}\x{2071}\x{207f}\x{2090}-\x{209c}\x{2102}\x{2107}\x{210a}-\x{2113}\x{2115}\x{2119}-\x{211d}\x{2124}\x{2126}\x{2128}\x{212a}-\x{212d}\x{212f}-\x{2139}\x{213c}-\x{213f}\x{2145}-\x{2149}\x{214e}\x{214f}\x{2160}-\x{2188}\x{2336}-\x{237a}\x{2395}\x{249c}-\x{24e9}\x{26ac}\x{2800}-\x{28ff}\x{2c00}-\x{2c2e}\x{2c30}-\x{2c5e}\x{2c60}-\x{2ce4}\x{2ceb}-\x{2cee}\x{2cf2}\x{2cf3}\x{2d00}-\x{2d25}\x{2d27}\x{2d2d}\x{2d30}-\x{2d67}\x{2d6f}\x{2d70}\x{2d80}-\x{2d96}\x{2da0}-\x{2da6}\x{2da8}-\x{2dae}\x{2db0}-\x{2db6}\x{2db8}-\x{2dbe}\x{2dc0}-\x{2dc6}\x{2dc8}-\x{2dce}\x{2dd0}-\x{2dd6}\x{2dd8}-\x{2dde}\x{3005}-\x{3007}\x{3021}-\x{3029}\x{302e}\x{302f}\x{3031}-\x{3035}\x{3038}-\x{303c}\x{3041}-\x{3096}\x{309d}-\x{309f}\x{30a1}-\x{30fa}\x{30fc}-\x{30ff}\x{3105}-\x{312d}\x{3131}-\x{318e}\x{3190}-\x{31ba}\x{31f0}-\x{321c}\x{3220}-\x{324f}\x{3260}-\x{327b}\x{327f}-\x{32b0}\x{32c0}-\x{32cb}\x{32d0}-\x{32fe}\x{3300}-\x{3376}\x{337b}-\x{33dd}\x{33e0}-\x{33fe}\x{3400}-\x{4db5}\x{4e00}-\x{9fd5}\x{a000}-\x{a48c}\x{a4d0}-\x{a60c}\x{a610}-\x{a62b}\x{a640}-\x{a66e}\x{a680}-\x{a69d}\x{a6a0}-\x{a6ef}\x{a6f2}-\x{a6f7}\x{a722}-\x{a787}\x{a789}-\x{a7ad}\x{a7b0}-\x{a7b7}\x{a7f7}-\x{a801}\x{a803}-\x{a805}\x{a807}-\x{a80a}\x{a80c}-\x{a824}\x{a827}\x{a830}-\x{a837}\x{a840}-\x{a873}\x{a880}-\x{a8c3}\x{a8ce}-\x{a8d9}\x{a8f2}-\x{a8fd}\x{a900}-\x{a925}\x{a92e}-\x{a946}\x{a952}\x{a953}\x{a95f}-\x{a97c}\x{a983}-\x{a9b2}\x{a9b4}\x{a9b5}\x{a9ba}\x{a9bb}\x{a9bd}-\x{a9cd}\x{a9cf}-\x{a9d9}\x{a9de}-\x{a9e4}\x{a9e6}-\x{a9fe}\x{aa00}-\x{aa28}\x{aa2f}\x{aa30}\x{aa33}\x{aa34}\x{aa40}-\x{aa42}\x{aa44}-\x{aa4b}\x{aa4d}\x{aa50}-\x{aa59}\x{aa5c}-\x{aa7b}\x{aa7d}-\x{aaaf}\x{aab1}\x{aab5}\x{aab6}\x{aab9}-\x{aabd}\x{aac0}\x{aac2}\x{aadb}-\x{aaeb}\x{aaee}-\x{aaf5}\x{ab01}-\x{ab06}\x{ab09}-\x{ab0e}\x{ab11}-\x{ab16}\x{ab20}-\x{ab26}\x{ab28}-\x{ab2e}\x{ab30}-\x{ab65}\x{ab70}-\x{abe4}\x{abe6}\x{abe7}\x{abe9}-\x{abec}\x{abf0}-\x{abf9}\x{ac00}-\x{d7a3}\x{d7b0}-\x{d7c6}\x{d7cb}-\x{d7fb}\x{e000}-\x{fa6d}\x{fa70}-\x{fad9}\x{fb00}-\x{fb06}\x{fb13}-\x{fb17}\x{ff21}-\x{ff3a}\x{ff41}-\x{ff5a}\x{ff66}-\x{ffbe}\x{ffc2}-\x{ffc7}\x{ffca}-\x{ffcf}\x{ffd2}-\x{ffd7}\x{ffda}-\x{ffdc}\x{10000}-\x{1000b}\x{1000d}-\x{10026}\x{10028}-\x{1003a}\x{1003c}\x{1003d}\x{1003f}-\x{1004d}\x{10050}-\x{1005d}\x{10080}-\x{100fa}\x{10100}\x{10102}\x{10107}-\x{10133}\x{10137}-\x{1013f}\x{101d0}-\x{101fc}\x{10280}-\x{1029c}\x{102a0}-\x{102d0}\x{10300}-\x{10323}\x{10330}-\x{1034a}\x{10350}-\x{10375}\x{10380}-\x{1039d}\x{1039f}-\x{103c3}\x{103c8}-\x{103d5}\x{10400}-\x{1049d}\x{104a0}-\x{104a9}\x{10500}-\x{10527}\x{10530}-\x{10563}\x{1056f}\x{10600}-\x{10736}\x{10740}-\x{10755}\x{10760}-\x{10767}\x{11000}\x{11002}-\x{11037}\x{11047}-\x{1104d}\x{11066}-\x{1106f}\x{11082}-\x{110b2}\x{110b7}\x{110b8}\x{110bb}-\x{110c1}\x{110d0}-\x{110e8}\x{110f0}-\x{110f9}\x{11103}-\x{11126}\x{1112c}\x{11136}-\x{11143}\x{11150}-\x{11172}\x{11174}-\x{11176}\x{11182}-\x{111b5}\x{111bf}-\x{111c9}\x{111cd}\x{111d0}-\x{111df}\x{111e1}-\x{111f4}\x{11200}-\x{11211}\x{11213}-\x{1122e}\x{11232}\x{11233}\x{11235}\x{11238}-\x{1123d}\x{11280}-\x{11286}\x{11288}\x{1128a}-\x{1128d}\x{1128f}-\x{1129d}\x{1129f}-\x{112a9}\x{112b0}-\x{112de}\x{112e0}-\x{112e2}\x{112f0}-\x{112f9}\x{11302}\x{11303}\x{11305}-\x{1130c}\x{1130f}\x{11310}\x{11313}-\x{11328}\x{1132a}-\x{11330}\x{11332}\x{11333}\x{11335}-\x{11339}\x{1133d}-\x{1133f}\x{11341}-\x{11344}\x{11347}\x{11348}\x{1134b}-\x{1134d}\x{11350}\x{11357}\x{1135d}-\x{11363}\x{11480}-\x{114b2}\x{114b9}\x{114bb}-\x{114be}\x{114c1}\x{114c4}-\x{114c7}\x{114d0}-\x{114d9}\x{11580}-\x{115b1}\x{115b8}-\x{115bb}\x{115be}\x{115c1}-\x{115db}\x{11600}-\x{11632}\x{1163b}\x{1163c}\x{1163e}\x{11641}-\x{11644}\x{11650}-\x{11659}\x{11680}-\x{116aa}\x{116ac}\x{116ae}\x{116af}\x{116b6}\x{116c0}-\x{116c9}\x{11700}-\x{11719}\x{11720}\x{11721}\x{11726}\x{11730}-\x{1173f}\x{118a0}-\x{118f2}\x{118ff}\x{11ac0}-\x{11af8}\x{12000}-\x{12399}\x{12400}-\x{1246e}\x{12470}-\x{12474}\x{12480}-\x{12543}\x{13000}-\x{1342e}\x{14400}-\x{14646}\x{16800}-\x{16a38}\x{16a40}-\x{16a5e}\x{16a60}-\x{16a69}\x{16a6e}\x{16a6f}\x{16ad0}-\x{16aed}\x{16af5}\x{16b00}-\x{16b2f}\x{16b37}-\x{16b45}\x{16b50}-\x{16b59}\x{16b5b}-\x{16b61}\x{16b63}-\x{16b77}\x{16b7d}-\x{16b8f}\x{16f00}-\x{16f44}\x{16f50}-\x{16f7e}\x{16f93}-\x{16f9f}\x{1b000}\x{1b001}\x{1bc00}-\x{1bc6a}\x{1bc70}-\x{1bc7c}\x{1bc80}-\x{1bc88}\x{1bc90}-\x{1bc99}\x{1bc9c}\x{1bc9f}\x{1d000}-\x{1d0f5}\x{1d100}-\x{1d126}\x{1d129}-\x{1d166}\x{1d16a}-\x{1d172}\x{1d183}\x{1d184}\x{1d18c}-\x{1d1a9}\x{1d1ae}-\x{1d1e8}\x{1d360}-\x{1d371}\x{1d400}-\x{1d454}\x{1d456}-\x{1d49c}\x{1d49e}\x{1d49f}\x{1d4a2}\x{1d4a5}\x{1d4a6}\x{1d4a9}-\x{1d4ac}\x{1d4ae}-\x{1d4b9}\x{1d4bb}\x{1d4bd}-\x{1d4c3}\x{1d4c5}-\x{1d505}\x{1d507}-\x{1d50a}\x{1d50d}-\x{1d514}\x{1d516}-\x{1d51c}\x{1d51e}-\x{1d539}\x{1d53b}-\x{1d53e}\x{1d540}-\x{1d544}\x{1d546}\x{1d54a}-\x{1d550}\x{1d552}-\x{1d6a5}\x{1d6a8}-\x{1d6da}\x{1d6dc}-\x{1d714}\x{1d716}-\x{1d74e}\x{1d750}-\x{1d788}\x{1d78a}-\x{1d7c2}\x{1d7c4}-\x{1d7cb}\x{1d800}-\x{1d9ff}\x{1da37}-\x{1da3a}\x{1da6d}-\x{1da74}\x{1da76}-\x{1da83}\x{1da85}-\x{1da8b}\x{1f110}-\x{1f12e}\x{1f130}-\x{1f169}\x{1f170}-\x{1f19a}\x{1f1e6}-\x{1f202}\x{1f210}-\x{1f23a}\x{1f240}-\x{1f248}\x{1f250}\x{1f251}\x{20000}-\x{2a6d6}\x{2a700}-\x{2b734}\x{2b740}-\x{2b81d}\x{2b820}-\x{2cea1}\x{2f800}-\x{2fa1d}\x{f0000}-\x{ffffd}\x{100000}-\x{10fffd}])|([\x{590}\x{5be}\x{5c0}\x{5c3}\x{5c6}\x{5c8}-\x{5ff}\x{7c0}-\x{7ea}\x{7f4}\x{7f5}\x{7fa}-\x{815}\x{81a}\x{824}\x{828}\x{82e}-\x{858}\x{85c}-\x{89f}\x{200f}\x{fb1d}\x{fb1f}-\x{fb28}\x{fb2a}-\x{fb4f}\x{10800}-\x{1091e}\x{10920}-\x{10a00}\x{10a04}\x{10a07}-\x{10a0b}\x{10a10}-\x{10a37}\x{10a3b}-\x{10a3e}\x{10a40}-\x{10ae4}\x{10ae7}-\x{10b38}\x{10b40}-\x{10e5f}\x{10e7f}-\x{10fff}\x{1e800}-\x{1e8cf}\x{1e8d7}-\x{1edff}\x{1ef00}-\x{1efff}\x{608}\x{60b}\x{60d}\x{61b}-\x{64a}\x{66d}-\x{66f}\x{671}-\x{6d5}\x{6e5}\x{6e6}\x{6ee}\x{6ef}\x{6fa}-\x{710}\x{712}-\x{72f}\x{74b}-\x{7a5}\x{7b1}-\x{7bf}\x{8a0}-\x{8e2}\x{fb50}-\x{fd3d}\x{fd40}-\x{fdcf}\x{fdf0}-\x{fdfc}\x{fdfe}\x{fdff}\x{fe70}-\x{fefe}\x{1ee00}-\x{1eeef}\x{1eef2}-\x{1eeff}]))/u';
    // @codeCoverageIgnoreEnd
    /**
     * Get a cached or new language object for a given language code
     * @deprecated since 1.35, use LanguageFactory
     * @param string $code
     * @throws MWException
     * @return Language
     */
    static function factory( $code ) {
        return MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( $code );
    }
    /**
     * Intended for tests that may change configuration in a way that invalidates caches.
     *
     * @since 1.32
     * @deprecated since 1.35. Instead, reset all services and set Language::$mLangObjCache = [].
     */
    public static function clearCaches() {
        wfDeprecated( __METHOD__, '1.35' );
        $services = MediaWikiServices::getInstance();
        $services->resetServiceForTesting( 'LanguageFallback' );
        $services->resetServiceForTesting( 'LanguageNameUtils' );
        $services->resetServiceForTesting( 'LocalisationCache' );
        $services->resetServiceForTesting( 'LanguageFactory' );
        self::$mLangObjCache = [];
    }
    /**
     * Checks whether any localisation is available for that language tag
     * in MediaWiki (MessagesXx.php exists).
     *
     * @deprecated since 1.34, use LanguageNameUtils
     * @param string $code Language tag (in lower case)
     * @return bool Whether language is supported
     * @since 1.21
     */
    public static function isSupportedLanguage( $code ) {
        return MediaWikiServices::getInstance()->getLanguageNameUtils()
            ->isSupportedLanguage( $code );
    }
    /**
     * Returns true if a language code string is a well-formed language tag
     * according to RFC 5646.
     * This function only checks well-formedness; it doesn't check that
     * language, script or variant codes actually exist in the repositories.
     *
     * Based on regexes by Mark Davis of the Unicode Consortium:
     * https://www.unicode.org/repos/cldr/trunk/tools/java/org/unicode/cldr/util/data/langtagRegex.txt
     *
     * @param string $code
     * @param bool $lenient Whether to allow '_' as separator. The default is only '-'.
     *
     * @return bool
     * @since 1.21
     */
    public static function isWellFormedLanguageTag( $code, $lenient = false ) {
        $alpha = '[a-z]';
        $digit = '[0-9]';
        $alphanum = '[a-z0-9]';
        $x = 'x'; # private use singleton
        $singleton = '[a-wy-z]'; # other singleton
        $s = $lenient ? '[-_]' : '-';
        $language = "$alpha{2,8}|$alpha{2,3}$s$alpha{3}";
        $script = "$alpha{4}"; # ISO 15924
        $region = "(?:$alpha{2}|$digit{3})"; # ISO 3166-1 alpha-2 or UN M.49
        $variant = "(?:$alphanum{5,8}|$digit$alphanum{3})";
        $extension = "$singleton(?:$s$alphanum{2,8})+";
        $privateUse = "$x(?:$s$alphanum{1,8})+";
        # Define certain grandfathered codes, since otherwise the regex is pretty useless.
        # Since these are limited, this is safe even later changes to the registry --
        # the only oddity is that it might change the type of the tag, and thus
        # the results from the capturing groups.
        # https://www.iana.org/assignments/language-subtag-registry
        $grandfathered = "en{$s}GB{$s}oed"
            . "|i{$s}(?:ami|bnn|default|enochian|hak|klingon|lux|mingo|navajo|pwn|tao|tay|tsu)"
            . "|no{$s}(?:bok|nyn)"
            . "|sgn{$s}(?:BE{$s}(?:fr|nl)|CH{$s}de)"
            . "|zh{$s}min{$s}nan";
        $variantList = "$variant(?:$s$variant)*";
        $extensionList = "$extension(?:$s$extension)*";
        $langtag = "(?:($language)"
            . "(?:$s$script)?"
            . "(?:$s$region)?"
            . "(?:$s$variantList)?"
            . "(?:$s$extensionList)?"
            . "(?:$s$privateUse)?)";
        # The final breakdown, with capturing groups for each of these components
        # The variants, extensions, grandfathered, and private-use may have interior '-'
        $root = "^(?:$langtag|$privateUse|$grandfathered)$";
        return (bool)preg_match( "/$root/", strtolower( $code ) );
    }
    /**
     * Returns true if a language code string is of a valid form, whether or
     * not it exists. This includes codes which are used solely for
     * customisation via the MediaWiki namespace.
     *
     * @deprecated since 1.34, use LanguageNameUtils
     *
     * @param string $code
     *
     * @return bool
     */
    public static function isValidCode( $code ) {
        return MediaWikiServices::getInstance()->getLanguageNameUtils()->isValidCode( $code );
    }
    /**
     * Returns true if a language code is of a valid form for the purposes of
     * internal customisation of MediaWiki, via Messages*.php or *.json.
     *
     * @deprecated since 1.34, use LanguageNameUtils
     *
     * @param string $code
     *
     * @since 1.18
     * @return bool
     */
    public static function isValidBuiltInCode( $code ) {
        return MediaWikiServices::getInstance()->getLanguageNameUtils()
            ->isValidBuiltInCode( $code );
    }
    /**
     * Returns true if a language code is an IETF tag known to MediaWiki.
     *
     * @deprecated since 1.34, use LanguageNameUtils
     *
     * @param string $tag
     *
     * @since 1.21
     * @return bool
     */
    public static function isKnownLanguageTag( $tag ) {
        return MediaWikiServices::getInstance()->getLanguageNameUtils()
            ->isKnownLanguageTag( $tag );
    }
    /**
     * Get the LocalisationCache instance
     *
     * @deprecated since 1.34, use MediaWikiServices
     * @return LocalisationCache
     */
    public static function getLocalisationCache() {
        return MediaWikiServices::getInstance()->getLocalisationCache();
    }
    /**
     * Calling this directly is deprecated. Use LanguageFactory instead.
     *
     * @param string|null $code Which code to use. Passing null is deprecated in 1.35.
     * @param LocalisationCache|null $localisationCache
     * @param LanguageNameUtils|null $langNameUtils
     * @param LanguageFallback|null $langFallback
     */
    public function __construct(
        $code = null,
        LocalisationCache $localisationCache = null,
        LanguageNameUtils $langNameUtils = null,
        LanguageFallback $langFallback = null
    ) {
        $this->mConverter = $this->newConverter();
        if ( !func_num_args() ) {
            // Old calling convention, deprecated
            if ( static::class === 'Language' ) {
                $this->mCode = 'en';
            } else {
                $this->mCode = str_replace( '_', '-', strtolower( substr( static::class, 8 ) ) );
            }
            $services = MediaWikiServices::getInstance();
            $this->localisationCache = $services->getLocalisationCache();
            $this->langNameUtils = $services->getLanguageNameUtils();
            $this->langFallback = $services->getLanguageFallback();
            return;
        }
        Assert::parameter( $code !== null, '$code',
            'Parameters cannot be null unless all are omitted' );
        Assert::parameter( $localisationCache !== null, '$localisationCache',
            'Parameters cannot be null unless all are omitted' );
        Assert::parameter( $langNameUtils !== null, '$langNameUtils',
            'Parameters cannot be null unless all are omitted' );
        Assert::parameter( $langFallback !== null, '$langFallback',
            'Parameters cannot be null unless all are omitted' );
        $this->mCode = $code;
        $this->localisationCache = $localisationCache;
        $this->langNameUtils = $langNameUtils;
        $this->langFallback = $langFallback;
    }
    /**
     * Reduce memory usage
     * @suppress PhanTypeSuspiciousNonTraversableForeach
     */
    function __destruct() {
        foreach ( $this as $name => $value ) {
            unset( $this->$name );
        }
    }
    /**
     * Hook which will be called if this is the content language.
     * Descendants can use this to register hook functions or modify globals
     */
    function initContLang() {
    }
    /**
     * @return array
     * @since 1.19
     */
    public function getFallbackLanguages() {
        return $this->langFallback->getAll( $this->mCode );
    }
    /**
     * Exports $wgBookstoreListEn
     * @return array
     */
    public function getBookstoreList() {
        return $this->localisationCache->getItem( $this->mCode, 'bookstoreList' );
    }
    /**
     * Returns an array of localised namespaces indexed by their numbers. If the namespace is not
     * available in localised form, it will be included in English.
     *
     * @return string[] List of localized namespace names, indexed by numeric namespace ID.
     */
    public function getNamespaces() {
        if ( is_null( $this->namespaceNames ) ) {
            global $wgMetaNamespace, $wgMetaNamespaceTalk, $wgExtraNamespaces;
            $validNamespaces = MediaWikiServices::getInstance()->getNamespaceInfo()->
                getCanonicalNamespaces();
            $this->namespaceNames = $wgExtraNamespaces +
                $this->localisationCache->getItem( $this->mCode, 'namespaceNames' );
            $this->namespaceNames += $validNamespaces;
            $this->namespaceNames[NS_PROJECT] = $wgMetaNamespace;
            if ( $wgMetaNamespaceTalk ) {
                $this->namespaceNames[NS_PROJECT_TALK] = $wgMetaNamespaceTalk;
            } else {
                $talk = $this->namespaceNames[NS_PROJECT_TALK];
                $this->namespaceNames[NS_PROJECT_TALK] =
                    $this->fixVariableInNamespace( $talk );
            }
            # Sometimes a language will be localised but not actually exist on this wiki.
            foreach ( $this->namespaceNames as $key => $text ) {
                if ( !isset( $validNamespaces[$key] ) ) {
                    unset( $this->namespaceNames[$key] );
                }
            }
            # The above mixing may leave namespaces out of canonical order.
            # Re-order by namespace ID number...
            ksort( $this->namespaceNames );
            Hooks::run( 'LanguageGetNamespaces', [ &$this->namespaceNames ] );
        }
        return $this->namespaceNames;
    }
    /**
     * Arbitrarily set all of the namespace names at once. Mainly used for testing
     * @param array $namespaces Array of namespaces (id => name)
     */
    public function setNamespaces( array $namespaces ) {
        $this->namespaceNames = $namespaces;
        $this->mNamespaceIds = null;
    }
    /**
     * Resets all of the namespace caches. Mainly used for testing
     */
    public function resetNamespaces() {
        $this->namespaceNames = null;
        $this->mNamespaceIds = null;
        $this->namespaceAliases = null;
    }
    /**
     * A convenience function that returns getNamespaces() with spaces instead of underscores
     * in values. Useful for producing output to be displayed e.g. in `<select>` forms.
     *
     * @return array
     */
    public function getFormattedNamespaces() {
        $ns = $this->getNamespaces();
        foreach ( $ns as $k => $v ) {
            $ns[$k] = strtr( $v, '_', ' ' );
        }
        return $ns;
    }
    /**
     * Get a namespace value by key
     *
     * <code>
     * $mw_ns = $lang->getNsText( NS_MEDIAWIKI );
     * echo $mw_ns; // prints 'MediaWiki'
     * </code>
     *
     * @param int $index The array key of the namespace to return
     * @return string|bool String if the namespace value exists, otherwise false
     */
    public function getNsText( $index ) {
        $ns = $this->getNamespaces();
        return $ns[$index] ?? false;
    }
    /**
     * A convenience function that returns the same thing as
     * getNsText() except with '_' changed to ' ', useful for
     * producing output.
     *
     * <code>
     * $mw_ns = $lang->getFormattedNsText( NS_MEDIAWIKI_TALK );
     * echo $mw_ns; // prints 'MediaWiki talk'
     * </code>
     *
     * @param int $index The array key of the namespace to return
     * @return string Namespace name without underscores (empty string if namespace does not exist)
     */
    public function getFormattedNsText( $index ) {
        $ns = $this->getNsText( $index );
        return strtr( $ns, '_', ' ' );
    }
    /**
     * Returns gender-dependent namespace alias if available.
     * See https://www.mediawiki.org/wiki/Manual:$wgExtraGenderNamespaces
     * @param int $index Namespace index
     * @param string $gender Gender key (male, female... )
     * @return string
     * @since 1.18
     */
    public function getGenderNsText( $index, $gender ) {
        global $wgExtraGenderNamespaces;
        $ns = $wgExtraGenderNamespaces +
            (array)$this->localisationCache->getItem( $this->mCode, 'namespaceGenderAliases' );
        return $ns[$index][$gender] ?? $this->getNsText( $index );
    }
    /**
     * Whether this language uses gender-dependent namespace aliases.
     * See https://www.mediawiki.org/wiki/Manual:$wgExtraGenderNamespaces
     * @return bool
     * @since 1.18
     */
    public function needsGenderDistinction() {
        global $wgExtraGenderNamespaces, $wgExtraNamespaces;
        if ( count( $wgExtraGenderNamespaces ) > 0 ) {
            // $wgExtraGenderNamespaces overrides everything
            return true;
        } elseif ( isset( $wgExtraNamespaces[NS_USER] ) && isset( $wgExtraNamespaces[NS_USER_TALK] ) ) {
            /// @todo There may be other gender namespace than NS_USER & NS_USER_TALK in the future
            // $wgExtraNamespaces overrides any gender aliases specified in i18n files
            return false;
        } else {
            // Check what is in i18n files
            $aliases = $this->localisationCache->getItem( $this->mCode, 'namespaceGenderAliases' );
            return count( $aliases ) > 0;
        }
    }
    /**
     * Get a namespace key by value, case insensitive.
     * Only matches namespace names for the current language, not the
     * canonical ones defined in Namespace.php.
     *
     * @param string $text
     * @return int|bool An integer if $text is a valid value otherwise false
     */
    function getLocalNsIndex( $text ) {
        $lctext = $this->lc( $text );
        $ids = $this->getNamespaceIds();
        return $ids[$lctext] ?? false;
    }
    /**
     * @return array
     */
    public function getNamespaceAliases() {
        if ( is_null( $this->namespaceAliases ) ) {
            $aliases = $this->localisationCache->getItem( $this->mCode, 'namespaceAliases' );
            if ( !$aliases ) {
                $aliases = [];
            } else {
                foreach ( $aliases as $name => $index ) {
                    if ( $index === NS_PROJECT_TALK ) {
                        unset( $aliases[$name] );
                        $name = $this->fixVariableInNamespace( $name );
                        $aliases[$name] = $index;
                    }
                }
            }
            global $wgExtraGenderNamespaces;
            $genders = $wgExtraGenderNamespaces + (array)$this->localisationCache
                ->getItem( $this->mCode, 'namespaceGenderAliases' );
            foreach ( $genders as $index => $forms ) {
                foreach ( $forms as $alias ) {
                    $aliases[$alias] = $index;
                }
            }
            # Also add converted namespace names as aliases, to avoid confusion.
            $convertedNames = [];
            foreach ( $this->getVariants() as $variant ) {
                if ( $variant === $this->mCode ) {
                    continue;
                }
                foreach ( $this->getNamespaces() as $ns => $_ ) {
                    $convertedNames[$this->getConverter()->convertNamespace( $ns, $variant )] = $ns;
                }
            }
            $this->namespaceAliases = $aliases + $convertedNames;
            # Filter out aliases to namespaces that don't exist, e.g. from extensions
            # that aren't loaded here but are included in the l10n cache.
            # (array_intersect preserves keys from its first argument)
            $this->namespaceAliases = array_intersect(
                $this->namespaceAliases,
                array_keys( $this->getNamespaces() )
            );
        }
        return $this->namespaceAliases;
    }
    /**
     * @return array
     */
    public function getNamespaceIds() {
        if ( is_null( $this->mNamespaceIds ) ) {
            global $wgNamespaceAliases;
            # Put namespace names and aliases into a hashtable.
            # If this is too slow, then we should arrange it so that it is done
            # before caching. The catch is that at pre-cache time, the above
            # class-specific fixup hasn't been done.
            $this->mNamespaceIds = [];
            foreach ( $this->getNamespaces() as $index => $name ) {
                $this->mNamespaceIds[$this->lc( $name )] = $index;
            }
            foreach ( $this->getNamespaceAliases() as $name => $index ) {
                $this->mNamespaceIds[$this->lc( $name )] = $index;
            }
            if ( $wgNamespaceAliases ) {
                foreach ( $wgNamespaceAliases as $name => $index ) {
                    $this->mNamespaceIds[$this->lc( $name )] = $index;
                }
            }
        }
        return $this->mNamespaceIds;
    }
    /**
     * Get a namespace key by value, case insensitive.  Canonical namespace
     * names override custom ones defined for the current language.
     *
     * @param string $text
     * @return int|bool An integer if $text is a valid value otherwise false
     */
    public function getNsIndex( $text ) {
        $lctext = $this->lc( $text );
        $ns = MediaWikiServices::getInstance()->getNamespaceInfo()->
            getCanonicalIndex( $lctext );
        if ( $ns !== null ) {
            return $ns;
        }
        $ids = $this->getNamespaceIds();
        return $ids[$lctext] ?? false;
    }
    /**
     * short names for language variants used for language conversion links.
     *
     * @param string $code
     * @param bool $usemsg Use the "variantname-xyz" message if it exists
     * @return string
     */
    public function getVariantname( $code, $usemsg = true ) {
        $msg = "variantname-$code";
        if ( $usemsg && wfMessage( $msg )->exists() ) {
            return $this->getMessageFromDB( $msg );
        }
        $name = $this->langNameUtils->getLanguageName( $code );
        if ( $name ) {
            return $name; # if it's defined as a language name, show that
        } else {
            # otherwise, output the language code
            return $code;
        }
    }
    /**
     * @return string[]|bool List of date format preference keys, or false if disabled.
     */
    public function getDatePreferences() {
        return $this->localisationCache->getItem( $this->mCode, 'datePreferences' );
    }
    /**
     * @return array
     */
    function getDateFormats() {
        return $this->localisationCache->getItem( $this->mCode, 'dateFormats' );
    }
    /**
     * @return array|string
     */
    public function getDefaultDateFormat() {
        $df = $this->localisationCache->getItem( $this->mCode, 'defaultDateFormat' );
        if ( $df === 'dmy or mdy' ) {
            global $wgAmericanDates;
            return $wgAmericanDates ? 'mdy' : 'dmy';
        } else {
            return $df;
        }
    }
    /**
     * @return array
     */
    public function getDatePreferenceMigrationMap() {
        return $this->localisationCache->getItem( $this->mCode, 'datePreferenceMigrationMap' );
    }
    /**
     * @return array
     */
    public function getExtraUserToggles() {
        wfDeprecated( __METHOD__, '1.34' );
        return [];
    }
    /**
     * @param string $tog
     * @return string
     */
    function getUserToggle( $tog ) {
        return $this->getMessageFromDB( "tog-$tog" );
    }
    /**
     * Get an array of language names, indexed by code.
     *
     * @deprecated since 1.34, use LanguageNameUtils::getLanguageNames
     * @param null|string $inLanguage Code of language in which to return the names
     *         Use self::AS_AUTONYMS for autonyms (native names)
     * @param string $include One of:
     *         self::ALL all available languages
     *         'mw' only if the language is defined in MediaWiki or wgExtraLanguageNames (default)
     *         self::SUPPORTED only if the language is in 'mw' *and* has a message file
     * @return array Language code => language name (sorted by key)
     * @since 1.20
     */
    public static function fetchLanguageNames( $inLanguage = self::AS_AUTONYMS, $include = 'mw' ) {
        return MediaWikiServices::getInstance()->getLanguageNameUtils()
            ->getLanguageNames( $inLanguage, $include );
    }
    /**
     * @deprecated since 1.34, use LanguageNameUtils::getLanguageName
     * @param string $code The code of the language for which to get the name
     * @param null|string $inLanguage Code of language in which to return the name
     *   (SELF::AS_AUTONYMS for autonyms)
     * @param string $include See fetchLanguageNames()
     * @return string Language name or empty
     * @since 1.20
     */
    public static function fetchLanguageName(
        $code,
        $inLanguage = self::AS_AUTONYMS,
        $include = self::ALL
    ) {
        return MediaWikiServices::getInstance()->getLanguageNameUtils()
            ->getLanguageName( $code, $inLanguage, $include );
    }
    /**
     * Get a message from the MediaWiki namespace.
     *
     * @param string $msg Message name
     * @return string
     */
    public function getMessageFromDB( $msg ) {
        return $this->msg( $msg )->text();
    }
    /**
     * Get message object in this language. Only for use inside this class.
     *
     * @param string $msg Message name
     * @return Message
     */
    protected function msg( $msg ) {
        return wfMessage( $msg )->inLanguage( $this );
    }
    /**
     * @param string $key
     * @return string
     */
    public function getMonthName( $key ) {
        return $this->getMessageFromDB( self::$mMonthMsgs[$key - 1] );
    }
    /**
     * @return array
     */
    public function getMonthNamesArray() {
        $monthNames = [ '' ];
        for ( $i = 1; $i < 13; $i++ ) {
            $monthNames[] = $this->getMonthName( $i );
        }
        return $monthNames;
    }
    /**
     * @param string $key
     * @return string
     */
    public function getMonthNameGen( $key ) {
        return $this->getMessageFromDB( self::$mMonthGenMsgs[$key - 1] );
    }
    /**
     * @param string $key
     * @return string
     */
    public function getMonthAbbreviation( $key ) {
        return $this->getMessageFromDB( self::$mMonthAbbrevMsgs[$key - 1] );
    }
    /**
     * @return array
     */
    public function getMonthAbbreviationsArray() {
        $monthNames = [ '' ];
        for ( $i = 1; $i < 13; $i++ ) {
            $monthNames[] = $this->getMonthAbbreviation( $i );
        }
        return $monthNames;
    }
    /**
     * @param string $key
     * @return string
     */
    public function getWeekdayName( $key ) {
        return $this->getMessageFromDB( self::$mWeekdayMsgs[$key - 1] );
    }
    /**
     * @param string $key
     * @return string
     */
    public function getWeekdayAbbreviation( $key ) {
        return $this->getMessageFromDB( self::$mWeekdayAbbrevMsgs[$key - 1] );
    }
    /**
     * @param string $key
     * @return string
     */
    private function getIranianCalendarMonthName( $key ) {
        return $this->getMessageFromDB( self::$mIranianCalendarMonthMsgs[$key - 1] );
    }
    /**
     * @param string $key
     * @return string
     */
    private function getHebrewCalendarMonthName( $key ) {
        return $this->getMessageFromDB( self::$mHebrewCalendarMonthMsgs[$key - 1] );
    }
    /**
     * @param string $key
     * @return string
     */
    private function getHebrewCalendarMonthNameGen( $key ) {
        return $this->getMessageFromDB( self::$mHebrewCalendarMonthGenMsgs[$key - 1] );
    }
    /**
     * @param string $key
     * @return string
     */
    private function getHijriCalendarMonthName( $key ) {
        return $this->getMessageFromDB( self::$mHijriCalendarMonthMsgs[$key - 1] );
    }
    /**
     * Pass through result from $dateTimeObj->format()
     * @param DateTime|bool|null &$dateTimeObj
     * @param string $ts
     * @param DateTimeZone|bool|null $zone
     * @param string $code
     * @return string
     */
    private static function dateTimeObjFormat( &$dateTimeObj, $ts, $zone, $code ) {
        if ( !$dateTimeObj ) {
            $dateTimeObj = DateTime::createFromFormat(
                'YmdHis', $ts, $zone ?: new DateTimeZone( 'UTC' )
            );
        }
        return $dateTimeObj->format( $code );
    }
    /**
     * This is a workalike of PHP's date() function, but with better
     * internationalisation, a reduced set of format characters, and a better
     * escaping format.
     *
     * Supported format characters are dDjlNwzWFmMntLoYyaAgGhHiscrUeIOPTZ. See
     * the PHP manual for definitions. There are a number of extensions, which
     * start with "x":
     *
     *    xn   Do not translate digits of the next numeric format character
     *    xN   Toggle raw digit (xn) flag, stays set until explicitly unset
     *    xr   Use roman numerals for the next numeric format character
     *    xh   Use hebrew numerals for the next numeric format character
     *    xx   Literal x
     *    xg   Genitive month name
     *
     *    xij  j (day number) in Iranian calendar
     *    xiF  F (month name) in Iranian calendar
     *    xin  n (month number) in Iranian calendar
     *    xiy  y (two digit year) in Iranian calendar
     *    xiY  Y (full year) in Iranian calendar
     *    xit  t (days in month) in Iranian calendar
     *    xiz  z (day of the year) in Iranian calendar
     *
     *    xjj  j (day number) in Hebrew calendar
     *    xjF  F (month name) in Hebrew calendar
     *    xjt  t (days in month) in Hebrew calendar
     *    xjx  xg (genitive month name) in Hebrew calendar
     *    xjn  n (month number) in Hebrew calendar
     *    xjY  Y (full year) in Hebrew calendar
     *
     *    xmj  j (day number) in Hijri calendar
     *    xmF  F (month name) in Hijri calendar
     *    xmn  n (month number) in Hijri calendar
     *    xmY  Y (full year) in Hijri calendar
     *
     *    xkY  Y (full year) in Thai solar calendar. Months and days are
     *                       identical to the Gregorian calendar
     *    xoY  Y (full year) in Minguo calendar or Juche year.
     *                       Months and days are identical to the
     *                       Gregorian calendar
     *    xtY  Y (full year) in Japanese nengo. Months and days are
     *                       identical to the Gregorian calendar
     *
     * Characters enclosed in double quotes will be considered literal (with
     * the quotes themselves removed). Unmatched quotes will be considered
     * literal quotes. Example:
     *
     * "The month is" F       => The month is January
     * i's"                   => 20'11"
     *
     * Backslash escaping is also supported.
     *
     * Input timestamp is assumed to be pre-normalized to the desired local
     * time zone, if any. Note that the format characters crUeIOPTZ will assume
     * $ts is UTC if $zone is not given.
     *
     * @param string $format
     * @param string $ts 14-character timestamp
     *      YYYYMMDDHHMMSS
     *      01234567890123
     * @param DateTimeZone|null $zone Timezone of $ts
     * @param int &$ttl The amount of time (in seconds) the output may be cached for.
     * Only makes sense if $ts is the current time.
     * @todo handling of "o" format character for Iranian, Hebrew, Hijri & Thai?
     *
     * @throws MWException
     * @return string
     * @return-taint tainted
     */
    public function sprintfDate( $format, $ts, DateTimeZone $zone = null, &$ttl = 'unused' ) {
        $s = '';
        $raw = false;
        $roman = false;
        $hebrewNum = false;
        $dateTimeObj = false;
        $rawToggle = false;
        $iranian = false;
        $hebrew = false;
        $hijri = false;