Language

Extends Language

Languages/translation handler class

since

1.7.0

package

Joomla CMS

Methods

_

Translate function, mimics the php gettext (alias _) function.

_( string,  jsSafe = false,  interpretBackSlashes = true) : 

The function checks if $jsSafe is true, then if $interpretBackslashes is true.

since

1.7.0

Arguments

string

stringThe string to translate

jsSafe

boolParameter to add slashes to the string that will be rendered as JavaScript. However, set as "false" if the string is going to be encoded by json_encode().

interpretBackSlashes

boolInterpret \t and \n

Response

stringThe translation of the string

__construct

Constructor activating the default information of the language.

__construct( lang = null,  debug = false) : 
since

1.7.0

Arguments

lang

stringThe language

debug

boolIndicates if language debugging is enabled.

Response

mixed

debugFile

Debugs a language file

debugFile( filename) : 
since

3.6.3

throws

InvalidArgumentException

Arguments

filename

stringAbsolute path to the file to debug

Response

intA count of the number of parsing errors

getCalendar

Getter for the calendar type

getCalendar() : 
since

3.7.0

Response

stringThe calendar type.

getIgnoredSearchWords

Returns an array of ignored search words

getIgnoredSearchWords() : mixed||string|int
deprecated
since

1.7.0

deprecated

4.4 will be removed in 6.0 without replacement

Response

array<string|int, mixed>The array of ignored search words.

getIgnoredSearchWordsCallback

Getter for ignoredSearchWordsCallback function.

getIgnoredSearchWordsCallback() 
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
: |Array
deprecated
since

1.7.0

deprecated

4.4 will be removed in 6.0 without replacement

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Response

callableFunction name or the actual function.

getInstance

Returns a language object.

getInstance( lang,  debug = false) : \Joomla\CMS\Language\Language
static deprecated
since

1.7.0

deprecated

4.3 will be removed in 6.0 Use the language factory instead Example: Factory::getContainer()->get(LanguageFactoryInterface::class)->createLanguage($lang, $debug);

Arguments

lang

stringThe language to use.

debug

boolThe debug mode.

Response

LanguageThe Language object.

getLowerLimitSearchWord

Returns a lower limit integer for length of search words

getLowerLimitSearchWord() : 
deprecated
since

1.7.0

deprecated

4.4 will be removed in 6.0 without replacement

Response

intThe lower limit integer for length of search words (3 if no value was set for a specific language).

getLowerLimitSearchWordCallback

Getter for lowerLimitSearchWordCallback function

getLowerLimitSearchWordCallback() 
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
: |Array
deprecated
since

1.7.0

deprecated

4.4 will be removed in 6.0 without replacement

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Response

callableFunction name or the actual function.

getPaths

Get a list of language files that have been loaded.

getPaths( extension = null) : mixed||string|int
since

1.7.0

Arguments

extension

stringAn optional extension name.

Response

array<string|int, mixed>

getPluralSuffixes

Returns an array of suffixes for plural rules.

getPluralSuffixes( count) : mixed||string|int
since

1.7.0

Arguments

count

intThe count number the rule is for.

Response

array<string|int, mixed>The array of suffixes.

getPluralSuffixesCallback

Getter for pluralSuffixesCallback function.

getPluralSuffixesCallback() 
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
: |Array
since

1.7.0

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Response

callableFunction name or the actual function.

getSearchDisplayedCharactersNumber

Returns the number of characters displayed in search results.

getSearchDisplayedCharactersNumber() : 
deprecated
since

1.7.0

deprecated

4.4 will be removed in 6.0 without replacement

Response

intThe number of characters displayed (200 if no value was set for a specific language).

getSearchDisplayedCharactersNumberCallback

Getter for searchDisplayedCharactersNumberCallback function

getSearchDisplayedCharactersNumberCallback() 
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
: |Array
deprecated
since

1.7.0

deprecated

4.4 will be removed in 6.0 without replacement

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Response

callableFunction name or the actual function.

getTrace

Get a back trace.

getTrace() : mixed||string|int
since

4.0.0

Response

array<string|int, mixed>

getTransliterator

Getter for transliteration function

getTransliterator() 
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
: |Array
since

1.7.0

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Response

callableThe transliterator function

getUpperLimitSearchWord

Returns an upper limit integer for length of search words

getUpperLimitSearchWord() : 
deprecated
since

1.7.0

deprecated

4.4 will be removed in 6.0 without replacement

Response

intThe upper limit integer for length of search words (200 if no value was set or if default value is < 200).

getUpperLimitSearchWordCallback

Getter for upperLimitSearchWordCallback function

getUpperLimitSearchWordCallback() 
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
: |Array
deprecated
since

1.7.0

deprecated

4.4 will be removed in 6.0 without replacement

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Response

callableFunction name or the actual function.

hasKey

Determines is a key exists.

hasKey( string) : 
since

1.7.0

Arguments

string

stringThe key to check.

Response

boolTrue, if the key exists.

load

Loads a single language file and appends the results to the existing strings

load( extension = 'joomla',  basePath = JPATH_BASE,  lang = null,  reload = false,  default = true) : 
since

1.7.0

Arguments

extension

stringThe extension for which a language file should be loaded.

basePath

stringThe basepath to use.

lang

stringThe language to load, default null for the current language.

reload

boolFlag that will force a language to be reloaded if set to true.

default

boolFlag that force the default language to be loaded if the current does not exist.

Response

boolTrue if the file has successfully loaded.

loadLanguage

Loads a language file.

loadLanguage( fileName,  extension = 'unknown') : 

This method will not note the successful loading of a file - use load() instead.

see Language::load()
since

1.7.0

Arguments

fileName

stringThe name of the file.

extension

stringThe name of the extension.

Response

boolTrue if new strings have been added to the language

parse

Parses a language file.

parse( fileName) : mixed||string|int
since

1.7.0

Arguments

fileName

stringThe name of the file.

Response

array<string|int, mixed>The array of parsed strings.

setIgnoredSearchWordsCallback

Setter for the ignoredSearchWordsCallback function

setIgnoredSearchWordsCallback(
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
|Array function) 
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
: |Array
deprecated
since

1.7.0

deprecated

4.4 will be removed in 6.0 without replacement

Arguments

function

callableFunction name or actual function.

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Response

callableThe previous function.

setLowerLimitSearchWordCallback

Setter for the lowerLimitSearchWordCallback function.

setLowerLimitSearchWordCallback(
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
|Array function) 
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
: |Array
deprecated
since

1.7.0

deprecated

4.4 will be removed in 6.0 without replacement

Arguments

function

callableFunction name or actual function.

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Response

callableThe previous function.

setPluralSuffixesCallback

Set the pluralSuffixes function.

setPluralSuffixesCallback(
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
|Array function) 
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
: |Array
since

1.7.0

Arguments

function

callableFunction name or actual function.

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Response

callableThe previous function.

setSearchDisplayedCharactersNumberCallback

Setter for the searchDisplayedCharactersNumberCallback function.

setSearchDisplayedCharactersNumberCallback(
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
|Array function) 
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
: |Array
deprecated
since

1.7.0

deprecated

4.4 will be removed in 6.0 without replacement

Arguments

function

callableFunction name or the actual function.

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Response

callableThe previous function.

setTransliterator

Set the transliteration function.

setTransliterator(
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
|Array function) 
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
: |Array
since

1.7.0

Arguments

function

callableFunction name or the actual function.

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Response

callableThe previous function.

setUpperLimitSearchWordCallback

Setter for the upperLimitSearchWordCallback function

setUpperLimitSearchWordCallback(
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
|Array function) 
Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841
: |Array
deprecated
since

1.7.0

deprecated

4.4 will be removed in 6.0 without replacement

Arguments

function

callableFunction name or the actual function.

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Response

callableThe previous function.

transliterate

Transliterate function

transliterate( string) : 

This method processes a string and replaces all accented UTF-8 characters by unaccented ASCII-7 "equivalents".

since

1.7.0

Arguments

string

stringThe string to transliterate.

Response

stringThe transliteration of the string.

Properties

languages

Array of Language objects

static
since

1.7.0

Type(s)

array<string|int, Language>

strings

Translations

since

1.7.0

Type(s)

array<string|int, mixed>

transliterator

Name of the transliterator function for this language.

since

1.7.0

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Type(s)

callable

pluralSuffixesCallback

Name of the pluralSuffixesCallback function for this language.

since

1.7.0

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Type(s)

callable

ignoredSearchWordsCallback

Name of the ignoredSearchWordsCallback function for this language.

deprecated
since

1.7.0

deprecated

4.4 will be removed in 6.0 without replacement

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Type(s)

callable

lowerLimitSearchWordCallback

Name of the lowerLimitSearchWordCallback function for this language.

deprecated
since

1.7.0

deprecated

4.4 will be removed in 6.0 without replacement

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Type(s)

callable

upperLimitSearchWordCallback

Name of the upperLimitSearchWordCallback function for this language.

deprecated
since

1.7.0

deprecated

4.4 will be removed in 6.0 without replacement

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Type(s)

callable

searchDisplayedCharactersNumberCallback

Name of the searchDisplayedCharactersNumberCallback function for this language.

deprecated
since

1.7.0

deprecated

4.4 will be removed in 6.0 without replacement

Warning: Array to string conversion in /opt/phpdoc/vendor/twig/twig/src/Extension/CoreExtension.php on line 841

Type(s)

callable