public
|
#
__construct( string $lang = null, boolean $debug = false )
Constructor activating the default information of the language.
Constructor activating the default information of the language.
Parameters
- $lang
string - $lang The language
- $debug
boolean - $debug Indicates if language debugging is enabled.
Since
11.1
|
public static
JLanguage
|
#
getInstance( string $lang, boolean $debug = false )
Returns a language object.
Returns a language object.
Parameters
- $lang
string - $lang The language to use.
- $debug
boolean - $debug The debug mode.
Returns
Since
11.1
|
public
string
|
#
_( string $string, boolean $jsSafe = false, boolean $interpretBackSlashes = true )
Translate function, mimics the php gettext (alias _) function.
Translate function, mimics the php gettext (alias _) function.
The function checks if $jsSafe is true, then if $interpretBackslashes is
true.
Parameters
- $string
string - $string The string to translate
- $jsSafe
boolean - $jsSafe Make the result javascript safe
- $interpretBackSlashes
boolean - $interpretBackSlashes Interpret \t and \n
Returns
string - The translation of the string
Since
11.1
|
public
string
|
#
transliterate( string $string )
Transliterate function
This method processes a string and replaces all accented UTF-8 characters by
unaccented ASCII-7 "equivalents".
Parameters
- $string
string - $string The string to transliterate.
Returns
string - The transliteration of the string.
Since
11.1
|
public
callable
|
#
getTransliterator( )
Getter for transliteration function
Getter for transliteration function
Returns
callable - The transliterator function
Since
11.1
|
public
callable
|
#
setTransliterator( callable $function )
Set the transliteration function.
Set the transliteration function.
Parameters
- $function
callable - $function Function name or the actual function.
Returns
callable - The previous function.
Since
11.1
|
public
array
|
#
getPluralSuffixes( integer $count )
Returns an array of suffixes for plural rules.
Returns an array of suffixes for plural rules.
Parameters
- $count
integer - $count The count number the rule is for.
Returns
array - The array of suffixes.
Since
11.1
|
public
callable
|
#
getPluralSuffixesCallback( )
Getter for pluralSuffixesCallback function.
Getter for pluralSuffixesCallback function.
Returns
callable - Function name or the actual function.
Since
11.1
|
public
callable
|
#
setPluralSuffixesCallback( callable $function )
Set the pluralSuffixes function.
Set the pluralSuffixes function.
Parameters
- $function
callable - $function Function name or actual function.
Returns
callable - The previous function.
Since
11.1
|
public
array
|
#
getIgnoredSearchWords( )
Returns an array of ignored search words
Returns an array of ignored search words
Returns
array - The array of ignored search words.
Since
11.1
|
public
callable
|
#
getIgnoredSearchWordsCallback( )
Getter for ignoredSearchWordsCallback function.
Getter for ignoredSearchWordsCallback function.
Returns
callable - Function name or the actual function.
Since
11.1
|
public
callable
|
#
setIgnoredSearchWordsCallback( callable $function )
Setter for the ignoredSearchWordsCallback function
Setter for the ignoredSearchWordsCallback function
Parameters
- $function
callable - $function Function name or actual function.
Returns
callable - The previous function.
Since
11.1
|
public
integer
|
#
getLowerLimitSearchWord( )
Returns a lower limit integer for length of search words
Returns a lower limit integer for length of search words
Returns
integer - The lower limit integer for length of search words (3 if no value was set for a
specific language).
Since
11.1
|
public
callable
|
#
getLowerLimitSearchWordCallback( )
Getter for lowerLimitSearchWordCallback function
Getter for lowerLimitSearchWordCallback function
Returns
callable - Function name or the actual function.
Since
11.1
|
public
callable
|
#
setLowerLimitSearchWordCallback( callable $function )
Setter for the lowerLimitSearchWordCallback function.
Setter for the lowerLimitSearchWordCallback function.
Parameters
- $function
callable - $function Function name or actual function.
Returns
callable - The previous function.
Since
11.1
|
public
integer
|
#
getUpperLimitSearchWord( )
Returns an upper limit integer for length of search words
Returns an upper limit integer for length of search words
Returns
integer - The upper limit integer for length of search words (200 if no value was set or
if default value is < 200).
Since
11.1
|
public
callable
|
#
getUpperLimitSearchWordCallback( )
Getter for upperLimitSearchWordCallback function
Getter for upperLimitSearchWordCallback function
Returns
callable - Function name or the actual function.
Since
11.1
|
public
callable
|
#
setUpperLimitSearchWordCallback( callable $function )
Setter for the upperLimitSearchWordCallback function
Setter for the upperLimitSearchWordCallback function
Parameters
- $function
callable - $function Function name or the actual function.
Returns
callable - The previous function.
Since
11.1
|
public
integer
|
#
getSearchDisplayedCharactersNumber( )
Returns the number of characters displayed in search results.
Returns the number of characters displayed in search results.
Returns
integer - The number of characters displayed (200 if no value was set for a specific
language).
Since
11.1
|
public
callable
|
#
getSearchDisplayedCharactersNumberCallback( )
Getter for searchDisplayedCharactersNumberCallback function
Getter for searchDisplayedCharactersNumberCallback function
Returns
callable - Function name or the actual function.
Since
11.1
|
public
callable
|
#
setSearchDisplayedCharactersNumberCallback( callable $function )
Setter for the searchDisplayedCharactersNumberCallback function.
Setter for the searchDisplayedCharactersNumberCallback function.
Parameters
- $function
callable - $function Function name or the actual function.
Returns
callable - The previous function.
Since
11.1
|
public static
boolean
|
#
exists( string $lang, string $basePath = JPATH_BASE )
Checks if a language exists.
Checks if a language exists.
This is a simple, quick check for the directory that should contain language
files for the given user.
Deprecated
3.7.0, use JLanguageHelper::exists() instead.
Parameters
- $lang
string - $lang Language to check.
- $basePath
string - $basePath Optional path to check.
Returns
boolean - True if the language exists.
Since
11.1
|
public
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
Loads a single language file and appends the results to the existing
strings
Parameters
- $extension
string - $extension The extension for which a language file should be loaded.
- $basePath
string - $basePath The basepath to use.
- $lang
string - $lang The language to load, default null for the current language.
- $reload
boolean - $reload Flag that will force a language to be reloaded if set to true.
- $default
boolean - $default Flag that force the default language to be loaded if the current does
not exist.
Returns
boolean - True if the file has successfully loaded.
Since
11.1
|
protected
boolean
|
#
loadLanguage( string $filename, string $extension = 'unknown' )
Loads a language file.
This method will not note the successful loading of a file - use load()
instead.
Parameters
- $filename
string - $filename The name of the file.
- $extension
string - $extension The name of the extension.
Returns
boolean - True if new strings have been added to the language
Since
11.1
See
|
protected
array
|
#
parse( string $filename )
Parses a language file.
Parameters
- $filename
string - $filename The name of the file.
Returns
array - The array of parsed strings.
Since
11.1
|
public
integer
|
#
debugFile( string $filename )
Debugs a language file
Parameters
- $filename
string - $filename Absolute path to the file to debug
Returns
integer - A count of the number of parsing errors
Throws
Since
3.6.3
|
public
mixed
|
#
get( string $property, mixed $default = null )
Get a metadata language property.
Get a metadata language property.
Parameters
- $property
string - $property The name of the property.
- $default
mixed - $default The default value.
Returns
mixed - The value of the property.
Since
11.1
|
protected
array
|
#
getCallerInfo( )
Determine who called JLanguage or JText.
Determine who called JLanguage or JText.
Returns
array - Caller information.
Since
11.1
|
public
string
|
#
getName( )
Getter for Name.
Returns
string - Official name element of the language.
Since
11.1
|
public
array
|
#
getPaths( string $extension = null )
Get a list of language files that have been loaded.
Get a list of language files that have been loaded.
Parameters
- $extension
string - $extension An optional extension name.
Returns
array
Since
11.1
|
public
array
|
#
getErrorFiles( )
Get a list of language files that are in error state.
Get a list of language files that are in error state.
Returns
array
Since
11.1
|
public
string
|
#
getTag( )
Getter for the language tag (as defined in RFC 3066)
Getter for the language tag (as defined in RFC 3066)
Returns
string - The language tag.
Since
11.1
|
public
string
|
#
getCalendar( )
Getter for the calendar type
Getter for the calendar type
Returns
string - The calendar type.
Since
3.7.0
|
public
boolean
|
#
isRtl( )
Get the RTL property.
Returns
boolean - True is it an RTL language.
Since
11.1
|
public
boolean
|
#
setDebug( boolean $debug )
Set the Debug property.
Parameters
- $debug
boolean - $debug The debug setting.
Returns
boolean - Previous value.
Since
11.1
|
public
boolean
|
#
getDebug( )
Get the Debug property.
Returns
boolean - True is in debug mode.
Since
11.1
|
public
string
|
#
getDefault( )
Get the default language code.
Get the default language code.
Returns
string - Language code.
Since
11.1
|
public
string
|
#
setDefault( string $lang )
Set the default language code.
Set the default language code.
Parameters
- $lang
string - $lang The language code.
Returns
string - Previous value.
Since
11.1
|
public
array
|
#
getOrphans( )
Get the list of orphaned strings if being tracked.
Get the list of orphaned strings if being tracked.
Returns
array - Orphaned text.
Since
11.1
|
public
array
|
#
getUsed( )
Get the list of used strings.
Get the list of used strings.
Used strings are those strings requested and found either as a string or a
constant.
Returns
array - Used strings.
Since
11.1
|
public
boolean
|
#
hasKey( string $string )
Determines is a key exists.
Determines is a key exists.
Parameters
- $string
string - $string The key to check.
Returns
boolean - True, if the key exists.
Since
11.1
|
public static
mixed
|
#
getMetadata( string $lang )
Returns an associative array holding the metadata.
Returns an associative array holding the metadata.
Deprecated
3.7.0, use JLanguageHelper::getMetadata() instead.
Parameters
- $lang
string - $lang The name of the language.
Returns
mixed - If $lang exists return key/value pair with the language metadata, otherwise
return NULL.
Since
11.1
|
public static
array
|
#
getKnownLanguages( string $basePath = JPATH_BASE )
Returns a list of known languages for an area
Returns a list of known languages for an area
Deprecated
3.7.0, use JLanguageHelper::getKnownLanguages() instead.
Parameters
- $basePath
string - $basePath The basepath to use
Returns
array - key/value pair with the language file and real name.
Since
11.1
|
public static
string
|
#
getLanguagePath( string $basePath = JPATH_BASE, string $language = null )
Get the path to a language
Get the path to a language
Deprecated
3.7.0, use JLanguageHelper::getLanguagePath() instead.
Parameters
- $basePath
string - $basePath The basepath to use.
- $language
string - $language The language tag.
Returns
string - language related path or null.
Since
11.1
|
public
string
|
#
setLanguage( string $lang )
Set the language attributes to the given language.
Set the language attributes to the given language.
Once called, the language still needs to be loaded using
JLanguage::load().
Deprecated
4.0 (CMS) - Instantiate a new JLanguage object instead
Parameters
- $lang
string - $lang Language code.
Returns
string - Previous value.
Since
11.1
|
public
array
|
#
getLocale( )
Get the language locale based on current language.
Get the language locale based on current language.
Returns
array - The locale according to the language.
Since
11.1
|
public
integer
|
#
getFirstDay( )
Get the first day of the week for this language.
Get the first day of the week for this language.
Returns
integer - The first day of the week according to the language
Since
11.1
|
public
string
|
#
getWeekEnd( )
Get the weekends days for this language.
Get the weekends days for this language.
Returns
string - The weekend days of the week separated by a comma according to the language
Since
3.2
|
public static
array
|
#
parseLanguageFiles( string $dir = null )
Searches for language directories within a certain base dir.
Searches for language directories within a certain base dir.
Deprecated
3.7.0, use JLanguageHelper::parseLanguageFiles() instead.
Parameters
- $dir
string - $dir directory of files.
Returns
array - Array holding the found languages as filename => real name pairs.
Since
11.1
|
public static
array
|
#
parseXMLLanguageFile( string $path )
Parse XML file for language information.
Parse XML file for language information.
Deprecated
3.7.0, use JLanguageHelper::parseXMLLanguageFile() instead.
Parameters
- $path
string - $path Path to the XML files.
Returns
array - Array holding the found metadata as a key => value pair.
Throws
Since
11.1
|
protected static
JLanguage[]
|
$languages
|
#
Array of JLanguage objects
Array of JLanguage objects
Since
11.1
|
protected
boolean
|
$debug
|
#
Debug language, If true, highlights if string isn't found.
Debug language, If true, highlights if string isn't found.
Since
11.1
|
protected
string
|
$default
|
#
The default language, used when a language file in the requested language
does not exist.
The default language, used when a language file in the requested language
does not exist.
Since
11.1
|
protected
array
|
$orphans
|
#
An array of orphaned text.
An array of orphaned text.
Since
11.1
|
protected
array
|
$metadata
|
#
Array holding the language metadata.
Array holding the language metadata.
Since
11.1
|
protected
array|boolean
|
$locale
|
#
Array holding the language locale or boolean null if none.
Array holding the language locale or boolean null if none.
Since
11.1
|
protected
string
|
$lang
|
#
The language to load.
Since
11.1
|
protected
array
|
$paths
|
#
A nested array of language files that have been loaded
A nested array of language files that have been loaded
Since
11.1
|
protected
array
|
$errorfiles
|
#
List of language files that are in error state
List of language files that are in error state
Since
11.1
|
protected
array
|
$strings
|
|
protected
array
|
$used
|
#
An array of used text, used during debugging.
An array of used text, used during debugging.
Since
11.1
|
protected
integer
|
$counter
|
#
Counter for number of loads.
Counter for number of loads.
Since
11.1
|
protected
array
|
$override
|
#
An array used to store overrides.
An array used to store overrides.
Since
11.1
|
protected
string
|
$transliterator
|
#
Name of the transliterator function for this language.
Name of the transliterator function for this language.
Since
11.1
|
protected
callable
|
$pluralSuffixesCallback
|
#
Name of the pluralSuffixesCallback function for this language.
Name of the pluralSuffixesCallback function for this language.
Since
11.1
|
protected
callable
|
$ignoredSearchWordsCallback
|
#
Name of the ignoredSearchWordsCallback function for this language.
Name of the ignoredSearchWordsCallback function for this language.
Since
11.1
|
protected
callable
|
$lowerLimitSearchWordCallback
|
#
Name of the lowerLimitSearchWordCallback function for this language.
Name of the lowerLimitSearchWordCallback function for this language.
Since
11.1
|
protected
callable
|
$upperLimitSearchWordCallback
|
#
Name of the upperLimitSearchWordCallback function for this language.
Name of the upperLimitSearchWordCallback function for this language.
Since
11.1
|
protected
callable
|
$searchDisplayedCharactersNumberCallback
|
#
Name of the searchDisplayedCharactersNumberCallback function for this
language.
Name of the searchDisplayedCharactersNumberCallback function for this
language.
Since
11.1
|