Object creating TermLanguageFallbackChain objects in Wikibase.
More...
|
| __construct (?ContentLanguages $termsLanguages=null, ?LanguageFactory $languageFactory=null, ?LanguageConverterFactory $languageConverterFactory=null, ?LanguageFallback $languageFallback=null) |
|
| newFromLanguage (Language $language) |
| Get the fallback chain based a single language.
|
|
| newFromLanguageCode ( $languageCode) |
| Get the fallback chain based a single language code.
|
|
| newFromContext (IContextSource $context) |
| Construct the fallback chain based on a context.
|
|
| newFromContextAndLanguageCode (IContextSource $context, $languageCode) |
| Construct the fallback chain based on a context, but ignore the language info in it and use a specified one instead.
|
|
| newFromUserAndLanguageCode (User $user, $languageCode) |
| Construct the fallback chain based on a user and a language, currently from data provided by Extension:Babel.
|
|
| buildFromBabel (array $babel) |
| Build fallback chain array for a given babel array.
|
|
|
| addLanguageToChain ( $language, array &$chain, array &$fetched) |
| Add the given language to the chain (if it’s not included already).
|
|
| addLanguageAndVariantsToChain ( $language, array &$chain, array &$fetched) |
| Add the given language and its variants to the chain (if not included already).
|
|
| addLanguageAndVariantsAndFallbacksToChain ( $language, array &$chain, array &$fetched) |
| Add the given language, its variants and its explicit fallbacks to the chain (if not included already).
|
|
| addImplicitFallbacksToChain (array &$chain, array &$fetched) |
| Add the implicit fallbacks for any language to the chain (if not included already).
|
|
| buildFromLanguage ( $language) |
| Build a full fallback chain from the single given language, its variants and fallbacks.
|
|
| getBabel ( $languageCode, $user) |
|
| getBabelCategoryNames () |
|
Object creating TermLanguageFallbackChain objects in Wikibase.
- Copyright
- GPL-2.0-or-later
- Author
- Liangent < liang.nosp@m.ent@.nosp@m.gmail.nosp@m..com >
◆ __construct()
Wikibase\Lib\LanguageFallbackChainFactory::__construct |
( |
?ContentLanguages | $termsLanguages = null, |
|
|
?LanguageFactory | $languageFactory = null, |
|
|
?LanguageConverterFactory | $languageConverterFactory = null, |
|
|
?LanguageFallback | $languageFallback = null ) |
◆ addImplicitFallbacksToChain()
Wikibase\Lib\LanguageFallbackChainFactory::addImplicitFallbacksToChain |
( |
array & | $chain, |
|
|
array & | $fetched ) |
|
private |
Add the implicit fallbacks for any language to the chain (if not included already).
For the explicit fallbacks (of a specific language), see addLanguageAndVariantsAndFallbacksToChain
.
- Parameters
-
LanguageWithConversion[] | &$chain | the resulting chain |
bool[] | &$fetched | language codes (as keys) that are already in the chain |
◆ addLanguageAndVariantsAndFallbacksToChain()
Wikibase\Lib\LanguageFallbackChainFactory::addLanguageAndVariantsAndFallbacksToChain |
( |
| $language, |
|
|
array & | $chain, |
|
|
array & | $fetched ) |
|
private |
Add the given language, its variants and its explicit fallbacks to the chain (if not included already).
For the implicit (non-strict) fallbacks, see addImplicitFallbacksToChain
.
- Parameters
-
Language | string | $language | language (code) |
LanguageWithConversion[] | &$chain | the resulting chain |
bool[] | &$fetched | language codes (as keys) that are already in the chain |
◆ addLanguageAndVariantsToChain()
Wikibase\Lib\LanguageFallbackChainFactory::addLanguageAndVariantsToChain |
( |
| $language, |
|
|
array & | $chain, |
|
|
array & | $fetched ) |
|
private |
Add the given language and its variants to the chain (if not included already).
- Parameters
-
Language | string | $language | language (code) |
LanguageWithConversion[] | &$chain | the resulting chain |
bool[] | &$fetched | language codes (as keys) that are already in the chain |
◆ addLanguageToChain()
Wikibase\Lib\LanguageFallbackChainFactory::addLanguageToChain |
( |
| $language, |
|
|
array & | $chain, |
|
|
array & | $fetched ) |
|
private |
Add the given language to the chain (if it’s not included already).
- Parameters
-
Language | string | $language | language (code) |
LanguageWithConversion[] | &$chain | the resulting chain |
bool[] | &$fetched | language codes (as keys) that are already in the chain |
◆ buildFromBabel()
Wikibase\Lib\LanguageFallbackChainFactory::buildFromBabel |
( |
array | $babel | ) |
|
Build fallback chain array for a given babel array.
- Parameters
-
- Returns
- LanguageWithConversion[]
◆ buildFromLanguage()
Wikibase\Lib\LanguageFallbackChainFactory::buildFromLanguage |
( |
| $language | ) |
|
|
private |
Build a full fallback chain from the single given language, its variants and fallbacks.
- Parameters
-
Language | string | $language | (code) |
- Returns
- LanguageWithConversion[] the resulting chain
◆ getBabel()
Wikibase\Lib\LanguageFallbackChainFactory::getBabel |
( |
| $languageCode, |
|
|
| $user ) |
|
private |
◆ getBabelCategoryNames()
Wikibase\Lib\LanguageFallbackChainFactory::getBabelCategoryNames |
( |
| ) |
|
|
private |
◆ newFromContext()
Wikibase\Lib\LanguageFallbackChainFactory::newFromContext |
( |
IContextSource | $context | ) |
|
Construct the fallback chain based on a context.
Currently it just uses user and language info in it.
- Parameters
-
- Returns
- TermLanguageFallbackChain
◆ newFromContextAndLanguageCode()
Wikibase\Lib\LanguageFallbackChainFactory::newFromContextAndLanguageCode |
( |
IContextSource | $context, |
|
|
| $languageCode ) |
Construct the fallback chain based on a context, but ignore the language info in it and use a specified one instead.
- Parameters
-
IContextSource | $context | |
string | $languageCode | |
- Returns
- TermLanguageFallbackChain
◆ newFromLanguage()
Wikibase\Lib\LanguageFallbackChainFactory::newFromLanguage |
( |
Language | $language | ) |
|
Get the fallback chain based a single language.
- Parameters
-
- Returns
- TermLanguageFallbackChain
◆ newFromLanguageCode()
Wikibase\Lib\LanguageFallbackChainFactory::newFromLanguageCode |
( |
| $languageCode | ) |
|
Get the fallback chain based a single language code.
- Parameters
-
- Returns
- TermLanguageFallbackChain
◆ newFromUserAndLanguageCode()
Wikibase\Lib\LanguageFallbackChainFactory::newFromUserAndLanguageCode |
( |
User | $user, |
|
|
| $languageCode ) |
Construct the fallback chain based on a user and a language, currently from data provided by Extension:Babel.
- Parameters
-
User | $user | |
string | $languageCode | |
- Returns
- TermLanguageFallbackChain
◆ $languageCache
Wikibase\Lib\LanguageFallbackChainFactory::$languageCache = [] |
|
private |
◆ $languageConverterFactory
Wikibase\Lib\LanguageFallbackChainFactory::$languageConverterFactory |
|
private |
◆ $languageFactory
Wikibase\Lib\LanguageFallbackChainFactory::$languageFactory |
|
private |
◆ $languageFallback
Wikibase\Lib\LanguageFallbackChainFactory::$languageFallback |
|
private |
◆ $termsLanguages
Wikibase\Lib\LanguageFallbackChainFactory::$termsLanguages |
|
private |
◆ $userLanguageCache
Wikibase\Lib\LanguageFallbackChainFactory::$userLanguageCache = [] |
|
private |
The documentation for this class was generated from the following file: