Class JLanguage

Description

Languages/translation handler class

Located in /i18n/language.php (line 85)

JObject
   |
   --JLanguage
Variable Summary
 boolean $_debug
 string $_identifyer
 string $_lang
 array $_metadata
 array $_strings
Method Summary
 JLanguage __construct ([mixed $lang = null])
 mixed get (string $property, [mixed $default = null])
 boolean getDebug ()
 JLanguage &getInstance (string $lang)
 array getKnownLanguages ([string $basePath = JPATH_BASE])
 string getLanguagePath ([string $basePath = JPATH_BASE], [string $language = null], [boolean $addTrailingSlash = true])
 string getLocale ()
 mixed getMetadata (string $lang)
 string getName ([string $value = null])
 string getPdfFontName ()
 string getTag ()
 boolean hasKey (key $key)
 boolean isRTL ([mixed $value = null])
 void load ([string $prefix = ''], [string $basePath = JPATH_BASE])
 void setDebug (mixed $debug)
 string _ (string $string, [boolean $jsSafe = false])
 mixed _load (string $filename)
 array _parseINILanguageFiles ([string $dir = null])
 array _parseLanguageFiles ([string $dir = null])
 array _parseXMLLanguageFile (string $path)
 array _parseXMLLanguageFiles ([string $dir = null])
Variables
boolean $_debug = false (line 88)
  • var: If true, highlights string not found
string $_identifyer = null (line 92)
  • var: Identifying string of the language
string $_lang = null (line 94)
  • var: The language to load
array $_metadata = null (line 90)
  • var: Array holding the language metadata
array $_strings = null (line 96)
  • var: Transaltions
Methods
Constructor __construct (line 103)

Constructor activating the default information of the language

  • access: protected
JLanguage __construct ([mixed $lang = null])

Redefinition of:
JObject::__construct()
Class constructor, overridden in descendant classes.
get (line 244)

Get a matadata language property

  • return: The value of the property
  • access: public
mixed get (string $property, [mixed $default = null])
  • string $property: The name of the property
  • mixed $default: The default value

Redefinition of:
JObject::get()
getDebug (line 328)

Get the Debug property

  • return: True is in debug mode
  • access: public
boolean getDebug ()
getInstance (line 134)

Returns a reference to the global Language object, only creating it if it doesn't already exist.

This method must be invoked as:

  $browser = &JLanguage::getInstance([$lang);

  • return: The Language object.
  • access: public
JLanguage &getInstance (string $lang)
  • string $lang: The language to use.
getKnownLanguages (line 372)

Returns a list of known languages for an area

  • return: key/value pair with the language file and real name
  • access: public
array getKnownLanguages ([string $basePath = JPATH_BASE])
  • string $basePath: The basepath to use
getLanguagePath (line 389)

Get the path to a language

  • return: language related path or null
  • access: public
string getLanguagePath ([string $basePath = JPATH_BASE], [string $language = null], [boolean $addTrailingSlash = true])
  • string $basePath: The basepath to use
  • string $language: The language tag
  • boolean $addTrailingSlash: Add a trailing slash to the pathname
getLocale (line 289)

Get locale property

  • return: The locale property
  • access: public
string getLocale ()
getMetadata (line 352)

Returns a associative array holding the metadata

  • return: If $lang exists return key/value pair with the language metadata, otherwise return NULL
  • access: public
mixed getMetadata (string $lang)
  • string $lang: The name of the language
getName (line 259)

Getter for Name

  • return: Official name element of the language
  • access: public
string getName ([string $value = null])
  • string $value: An optional value
getPdfFontName (line 269)

Getter for PDF Font Name

  • return: name of pdf font to be used
  • access: public
string getPdfFontName ()
getTag (line 279)

Get for the langauge tag (as defined in RFC 3066)

  • return: The language tag
  • access: public
string getTag ()
hasKey (line 339)

Determines is a key exists

  • return: True, if the key exists
  • access: public
boolean hasKey (key $key)
  • key $key: The key to check
isRTL (line 309)

Get the RTL property

  • return: True is it an RTL language
  • access: public
boolean isRTL ([mixed $value = null])
load (line 185)

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

  • access: public
void load ([string $prefix = ''], [string $basePath = JPATH_BASE])
  • string $prefix: The prefix
  • string $basePath: The basepath to use $return boolean True, if the file has succesfully loaded.
setDebug (line 318)

Set the Debug property

  • access: public
void setDebug (mixed $debug)
_ (line 157)

Translator function, mimics the php gettext (alias _) function

  • return: The translation of the string
  • access: public
string _ (string $string, [boolean $jsSafe = false])
  • string $string: The string to translate
  • boolean $jsSafe: Make the result javascript safe
_load (line 219)

Loads a language file and returns the parsed values

  • return: Array of parsed values if successful, boolean False if failed
  • access: private
mixed _load (string $filename)
  • string $filename: The name of the file
_parseINILanguageFiles (line 423)

parses INI type of files for language information

  • return: Array holding the found languages as filename => real name pairs
  • access: public
array _parseINILanguageFiles ([string $dir = null])
  • string $dir: Directory of files
_parseLanguageFiles (line 404)

Searches for language directories within a certain base dir

  • return: Array holding the found languages as filename => real name pairs
  • access: public
array _parseLanguageFiles ([string $dir = null])
  • string $dir: directory of files
_parseXMLLanguageFile (line 476)

Parse XML file for language information

  • return: Array holding the found metadat as a key => value pair
  • access: public
array _parseXMLLanguageFile (string $path)
  • string $path: Path to the xml files
_parseXMLLanguageFiles (line 451)

Parses XML files for language information

  • return: Array holding the found languages as filename => metadata array
  • access: public
array _parseXMLLanguageFiles ([string $dir = null])
  • string $dir: Directory of files

Inherited Methods

Inherited From JObject

 JObject::__construct()
 JObject::JObject()
 JObject::get()
 JObject::set()
 JObject::toString()
 JObject::__destruct()

Documentation generated on Sat, 4 Feb 2006 14:24:11 +0100 by phpDocumentor 1.3.0RC4