WikiLambda
MediaWiki WikiLambda extension
Loading...
Searching...
No Matches
MediaWiki\Extension\WikiLambda\ZObjects\StringForLanguageBuilder Class Reference

Builder of a string for a certain language. More...

Public Member Functions

 __construct (Language $lang, ZMultiLingualString $provider)
 
 fallbackWithEnglish ()
 If the string for the language passed to the constructor is not available, fallback to Engligh.
 
 placeholderWith (string $placeholderText)
 If we cannot find any string, return the passed placeholder.
 
 placeholderNoFallback ()
 If we cannot find any string, return the default placeholder.
 
 placeholderForTitle ()
 If we cannot find any string, return the placeholder for a title.
 
 getLanguageProvided ()
 
 getStringAndLanguageCode ()
 Return the string and the language code.
 
 getString ()
 Return the string.
 

Detailed Description

Builder of a string for a certain language.

Don't instantiate it directly, rather call MediaWiki\Extension\WikiLambda\ZObjects\ZMultilingualString->buildStringForLanguage( $lang )

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\WikiLambda\ZObjects\StringForLanguageBuilder::__construct ( Language $lang,
ZMultiLingualString $provider )
Parameters
Language$langThe language with build the string for
ZMultilingualString$providerObject that provides the localized strings.

Member Function Documentation

◆ fallbackWithEnglish()

MediaWiki\Extension\WikiLambda\ZObjects\StringForLanguageBuilder::fallbackWithEnglish ( )

If the string for the language passed to the constructor is not available, fallback to Engligh.

Returns
StringForLanguageBuilder

◆ getLanguageProvided()

MediaWiki\Extension\WikiLambda\ZObjects\StringForLanguageBuilder::getLanguageProvided ( )
Returns
?string The language code for which a string value is provided.

◆ getString()

MediaWiki\Extension\WikiLambda\ZObjects\StringForLanguageBuilder::getString ( )

Return the string.

Returns
?string

◆ getStringAndLanguageCode()

MediaWiki\Extension\WikiLambda\ZObjects\StringForLanguageBuilder::getStringAndLanguageCode ( )

Return the string and the language code.

Returns
array

◆ placeholderForTitle()

MediaWiki\Extension\WikiLambda\ZObjects\StringForLanguageBuilder::placeholderForTitle ( )

If we cannot find any string, return the placeholder for a title.

Returns
StringForLanguageBuilder

◆ placeholderNoFallback()

MediaWiki\Extension\WikiLambda\ZObjects\StringForLanguageBuilder::placeholderNoFallback ( )

If we cannot find any string, return the default placeholder.

Returns
StringForLanguageBuilder

◆ placeholderWith()

MediaWiki\Extension\WikiLambda\ZObjects\StringForLanguageBuilder::placeholderWith ( string $placeholderText)

If we cannot find any string, return the passed placeholder.

Parameters
string$placeholderTextKey of the placeholder
Returns
StringForLanguageBuilder

The documentation for this class was generated from the following file: