A registry service for ZLanguage and language codes.
More...
|
| getLanguageCodeFromZid ( $zid) |
| Given a ZLanguage Zid, return its language code.
|
|
| getLanguageZidFromCode ( $code, $fallback=false) |
| Given a language code, return its ZLanguage Zid.
|
|
| isLanguageKnownGivenCode ( $code) |
| Check if a given language code, is a known ZLanguage Zid.
|
|
| isValidLanguageZid ( $zid) |
| Checks if the given Zid is a valid language Zid.
|
|
| getLanguageZids ( $languageCodes) |
| Returns an array of language Zids given an array of language codes.
|
|
| getListOfFallbackLanguageZids ( $languageFallback, $langCode) |
| Return the list of unique language Zids that correspond to the user's selected language, its fallbacks, and English if requested.
|
|
| register (string $zid, string $value) |
| Utility method to cache a key value in a registry instance, where the key is the Zid of the cached ZObject.
|
|
| unregister (string $zid) |
| Utility method to remove a given Zid from a registry instance.
|
|
| clear () |
| Utility method to clear the whole cache of a registry instance and set it to initial values.
|
|
| isZidCached (string $zid) |
| Utility method to check if the given Zid is cached in the registry.
|
|
|
const | MULTILINGUAL_VALUE = 'Z1360' |
|
|
static | singleton () |
|
static | unregisterZid (string $zid) |
| Unregisters the zid from any of the existing registry instances.
|
|
static | clearAll () |
| Clears and re-initializes all existing registry instances.
|
|
| $registry = [] |
|
| $type |
|
A registry service for ZLanguage and language codes.
◆ getLanguageCodeFromZid()
MediaWiki\Extension\WikiLambda\Registry\ZLangRegistry::getLanguageCodeFromZid |
( |
| $zid | ) |
|
Given a ZLanguage Zid, return its language code.
- Parameters
-
- Returns
- string
- Exceptions
-
◆ getLanguageZidFromCode()
MediaWiki\Extension\WikiLambda\Registry\ZLangRegistry::getLanguageZidFromCode |
( |
| $code, |
|
|
| $fallback = false ) |
Given a language code, return its ZLanguage Zid.
- Parameters
-
string | $code | |
bool | $fallback | If true, give the ZLanguage for English |
- Returns
- string
- Exceptions
-
◆ getLanguageZids()
MediaWiki\Extension\WikiLambda\Registry\ZLangRegistry::getLanguageZids |
( |
| $languageCodes | ) |
|
Returns an array of language Zids given an array of language codes.
- Parameters
-
- Returns
- string[]
◆ getListOfFallbackLanguageZids()
MediaWiki\Extension\WikiLambda\Registry\ZLangRegistry::getListOfFallbackLanguageZids |
( |
| $languageFallback, |
|
|
| $langCode ) |
Return the list of unique language Zids that correspond to the user's selected language, its fallbacks, and English if requested.
- Parameters
-
LanguageFallback | $languageFallback | |
string | $langCode | - Language BCP47 code |
- Returns
- string[]
◆ initialize()
MediaWiki\Extension\WikiLambda\Registry\ZLangRegistry::initialize |
( |
| ) |
|
|
protected |
◆ isLanguageKnownGivenCode()
MediaWiki\Extension\WikiLambda\Registry\ZLangRegistry::isLanguageKnownGivenCode |
( |
| $code | ) |
|
Check if a given language code, is a known ZLanguage Zid.
- Parameters
-
- Returns
- bool
◆ isValidLanguageZid()
MediaWiki\Extension\WikiLambda\Registry\ZLangRegistry::isValidLanguageZid |
( |
| $zid | ) |
|
Checks if the given Zid is a valid language Zid.
For that it first checks whether the Zid is registered, and if it's not, it fetches it from the database.
- Parameters
-
- Returns
- bool Is a valid ZLanguage Zid
The documentation for this class was generated from the following file: