Language
class Language
Languages/translation handler class
Methods
Constructor activating the default information of the language.
Returns a language object.
Translate function, mimics the php gettext (alias _) function.
Transliterate function
Getter for transliteration function
Set the transliteration function.
Returns an array of suffixes for plural rules.
Getter for pluralSuffixesCallback function.
Set the pluralSuffixes function.
Returns an array of ignored search words
Getter for ignoredSearchWordsCallback function.
Setter for the ignoredSearchWordsCallback function
Returns a lower limit integer for length of search words
Getter for lowerLimitSearchWordCallback function
Setter for the lowerLimitSearchWordCallback function.
Returns an upper limit integer for length of search words
Getter for upperLimitSearchWordCallback function
Setter for the upperLimitSearchWordCallback function
Returns the number of characters displayed in search results.
Getter for searchDisplayedCharactersNumberCallback function
Setter for the searchDisplayedCharactersNumberCallback function.
Checks if a language exists.
Loads a single language file and appends the results to the existing strings
Debugs a language file
Get a metadata language property.
Getter for Name.
Get a list of language files that have been loaded.
Get a list of language files that are in error state.
Getter for the language tag (as defined in RFC 3066)
Getter for the calendar type
Get the RTL property.
Set the Debug property.
Get the Debug property.
Get the default language code.
Set the default language code.
Get the list of orphaned strings if being tracked.
Get the list of used strings.
Determines is a key exists.
Returns an associative array holding the metadata.
Returns a list of known languages for an area
Get the path to a language
Set the language attributes to the given language.
Get the language locale based on current language.
Get the first day of the week for this language.
Get the weekends days for this language.
Searches for language directories within a certain base dir.
Parse XML file for language information.
Details
__construct(
string $lang = null,
boolean $debug = false)
Constructor activating the default information of the language.
string
_(
string $string,
boolean $jsSafe = false,
boolean $interpretBackSlashes = true)
Translate function, mimics the php gettext (alias _) function.
The function checks if $jsSafe is true, then if $interpretBackslashes is true.
string
transliterate(
string $string)
Transliterate function
This method processes a string and replaces all accented UTF-8 characters by unaccented ASCII-7 "equivalents".
callable
setIgnoredSearchWordsCallback(
callable $function)
Setter for the ignoredSearchWordsCallback function
callable
setLowerLimitSearchWordCallback(
callable $function)
Setter for the lowerLimitSearchWordCallback function.
callable
setUpperLimitSearchWordCallback(
callable $function)
Setter for the upperLimitSearchWordCallback function
integer
getSearchDisplayedCharactersNumber()
Returns the number of characters displayed in search results.
callable
getSearchDisplayedCharactersNumberCallback()
Getter for searchDisplayedCharactersNumberCallback function
callable
setSearchDisplayedCharactersNumberCallback(
callable $function)
Setter for the searchDisplayedCharactersNumberCallback function.
static
boolean
exists(
string $lang,
string $basePath = JPATH_BASE)
Checks if a language exists.
This is a simple, quick check for the directory that should contain language files for the given user.
boolean
load(
string $extension = 'joomla',
string $basePath = JPATH_BASE,
string $lang = null,
boolean $reload = false,
boolean $default = true)
Loads a single language file and appends the results to the existing strings
array
getUsed()
Get the list of used strings.
Used strings are those strings requested and found either as a string or a constant.
static
array
getKnownLanguages(
string $basePath = JPATH_BASE)
Returns a list of known languages for an area
static
string
getLanguagePath(
string $basePath = JPATH_BASE,
string $language = null)
Get the path to a language
string
setLanguage(
string $lang)
Set the language attributes to the given language.
Once called, the language still needs to be loaded using Language::load().