Token
class Token
Constants
| private DEFAULT_LANGUAGE |
|
Methods
Token constructor
Add a new occurence of this token in the sources
Adds a new translation for the given locale
Returns the Domain of the token (e.g. default)
Returns an array with all occurences of this token in the source
Returns a plural tokenId if set or FALS if not
Returns the token including the domain prefix
Returns an array with all available translations and the locale as array key
Returns true if a translation for the passed locale exists
No description
No description
Merges the passed Token object into this token. This will add additional translations as well as occurences from merged token into this
Sets the domain for this token
Adds a connected plural token
Details
at line 35
__construct(string $token)
Token constructor
at line 45
void
addOccurence(string $file, int $line)
Add a new occurence of this token in the sources
at line 61
void
addTranslation(string $locale, string $translatedToken)
Adds a new translation for the given locale
at line 100
bool
getDomain()
Returns the Domain of the token (e.g. default)
at line 141
array
getOccurence()
Returns an array with all occurences of this token in the source
at line 149
string|bool
getPluralToken()
Returns a plural tokenId if set or FALS if not
at line 117
string
getTokenId($includeDomain = false)
Returns the token including the domain prefix
at line 129
array|string
getTranslation($locale = false)
Returns an array with all available translations and the locale as array key
at line 83
bool
hasTranslation($locale)
Returns true if a translation for the passed locale exists
at line 181
bool|string
isEmpty($language = 'de_de')
No description
at line 168
bool
isProbablyUntranslated($excludes = [], $language = 'de_de')
No description
at line 159
mergeToken(Token $token)
Merges the passed Token object into this token. This will add additional translations as well as occurences from merged token into this
at line 92
void
setDomain(string $domain)
Sets the domain for this token
at line 109
setPluralToken($tokenId)
Adds a connected plural token