Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5

 Class JLanguage

Description

Languages/translation handler class

Located in /joomla/i18n/language.php (line 86)

Class JObject   (Subpackage Base)

Class JLanguage   (Subpackage I18N)
Variable Summary
Variable boolean $_debug
Variable string $_default
Variable string $_identifyer
Variable string $_lang
Variable array $_metadata
Variable array $_orphans
Variable array $_strings
Method Summary
Constructor JLanguage __construct ([ $lang = null])
Method boolean exists (string $lang)
Method mixed get (string $property, [mixed $default = null])
Method string getBackwardLang ()
Method boolean getDebug ()
Method string getDefault ()
Method JLanguage &getInstance (string $lang)
Method array getKnownLanguages ([string $basePath = JPATH_BASE])
Method string getLanguagePath ([string $basePath = JPATH_BASE], [string $language = null])
Method string getLocale ()
Method mixed getMetadata (string $lang)
Method string getName ([string $value = null])
Method boolean getOrphans ()
Method string getPdfFontName ()
Method string getTag ()
Method string getWinCP ()
Method boolean hasKey (key $key)
Method boolean isRTL ([ $value = null])
Method boolean load ([string $prefix = ''], [string $basePath = JPATH_BASE])
Method void setDebug ( $debug)
Method void setDefault ( $lang)
Method void setLanguage (string $lang)
Method string _ (string $string, [boolean $jsSafe = false])
Method array _parseINILanguageFiles ([string $dir = null])
Method array _parseLanguageFiles ([string $dir = null])
Method array _parseXMLLanguageFile (string $path)
Method array _parseXMLLanguageFiles ([string $dir = null])
Variables
boolean $_debug = false (line 94)

Debug language, If true, highlights if string isn't found

  • access: protected
string $_default = 'en-GB' (line 104)

The default language

The default language is used when a language file in the requested language does not exist.

  • access: protected
string $_identifyer = null (line 128)

Identifying string of the language

  • access: protected
string $_lang = null (line 136)

The language to load

  • access: protected
array $_metadata = null (line 120)

Array holding the language metadata

  • access: protected
array $_orphans = array() (line 112)

An array of orphaned text

  • access: protected
array $_strings = null (line 144)

Transaltions

  • access: protected
Methods
Constructor __construct (line 151)

Constructor activating the default information of the language

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

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

Check if a language exists

This is a simple, quick check for the directory that should contain language files for the given user.

  • return: True if the language exists
  • since: 1.5
  • access: public
boolean exists (string $lang)
  • string $lang: Language to check
get (line 334)

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()
Returns a property of the object or the default value if the property is not set.
getBackwardLang (line 379)

Getter for backward compatible language name

  • return: backward compatible name
  • access: public
string getBackwardLang ()
getDebug (line 438)

Get the Debug property

  • return: True is in debug mode
  • access: public
boolean getDebug ()
getDefault (line 448)

Get the default language code

  • return: Language code
  • access: public
string getDefault ()
getInstance (line 174)

Returns a reference to a language object

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 511)

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 527)

Get the path to a language

  • return: language related path or null
  • access: public
string getLanguagePath ([string $basePath = JPATH_BASE], [string $language = null])
  • string $basePath: The basepath to use
  • string $language: The language tag
getLocale (line 399)

Get locale property

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

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 349)

Getter for Name

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

Get the list of orphaned strings if being tracked

  • return: True is in debug mode
  • access: public
boolean getOrphans ()
getPdfFontName (line 359)

Getter for PDF Font Name

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

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

  • return: The language tag
  • access: public
string getTag ()
getWinCP (line 369)

Getter for Windows locale code page

  • return: windows locale encoding
  • access: public
string getWinCP ()
hasKey (line 478)

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 419)

Get the RTL property

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

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

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

Set the Debug property

  • access: public
void setDebug ( $debug)
  • $debug
setDefault (line 457)

Set the default language code

  • access: public
void setDefault ( $lang)
  • $lang
setLanguage (line 544)

Set the language attributes to the given language

Once called, the language still needs to be loaded using JLanguage::load()

  • access: public
void setLanguage (string $lang)
  • string $lang: Language code
_ (line 189)

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
_parseINILanguageFiles (line 583)

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 561)

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 640)

Parse XML file for language information

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

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::JObject()
 JObject::__construct()
 JObject::get()
 JObject::getPublicProperties()
 JObject::set()
 JObject::toString()

Documentation generated on Mon, 05 Mar 2007 21:09:14 +0000 by phpDocumentor 1.3.1