LocaleComponent Class Reference


Public Member Functions

 startup (&$controller)
 getString ($id, $messageArgs=null)
 setCode ($code)
 getCode ()
 doesLanguageExist ($lang)
 getAcceptedLanguages ()
 findLanguage ()
 getBrowserLang ()
 getVhostLang ($useTld=false)
getMessageArray ()
 getMessages ()
 getTldFromLanguage ($langcode)

Data Fields

 $controller = false
 $components = array ()

Detailed Description

Definition at line 41 of file locale.php.


Member Function Documentation

doesLanguageExist ( lang  ) 

Definition at line 184 of file locale.php.

findLanguage (  ) 

find the startup-language by looking at the LANGUAGE define in core/config.php

Definition at line 197 of file locale.php.

Referenced by startup().

Here is the caller graph for this function:

getAcceptedLanguages (  ) 

Definition at line 189 of file locale.php.

getBrowserLang (  ) 

try to find an language that we have as a file and that has a high priority in the users browser. returns EN if anything fails

Returns:
string short iso-code

Definition at line 227 of file locale.php.

getCode (  ) 

Definition at line 150 of file locale.php.

& getMessageArray (  ) 

return the array containing all locale-codes by reference

Definition at line 308 of file locale.php.

getMessages (  ) 

load the message-array by loading controllers/lang/XX.php tries to cache the array via APC (if loaded)

Definition at line 319 of file locale.php.

Referenced by getString().

Here is the caller graph for this function:

getString ( id,
messageArgs = null 
)

return the translation for the given string-identifier

Parameters:
string $id identifier to look up translation
array $messageArgs optional parameters that will be formatted into the string with printf

Definition at line 87 of file locale.php.

References getMessages().

Here is the call graph for this function:

getTldFromLanguage ( langcode  ) 

map given DINISO to language-tld-code code for setLocale()

Parameters:
string DINISO-code
Returns:
string language-code

Definition at line 419 of file locale.php.

getVhostLang ( useTld = false  ) 

try to find an language that we have as a file depending on the current domain name foo.example.tr -> "tr" [foo.bar.]tr.example.com -> "tr"

Definition at line 281 of file locale.php.

setCode ( code  ) 

sets a language-code. writes the code into the session of the user and sets Lang_Code for all views

Parameters:
string $code short iso-code for language ("de" "en" "fr")

Definition at line 130 of file locale.php.

Referenced by startup().

Here is the caller graph for this function:

startup ( &$  controller  ) 

called by controller after the component was instanciated first

Parameters:
object $controller the calling controller

Definition at line 77 of file locale.php.

References $controller, findLanguage(), and setCode().

Here is the call graph for this function:


Field Documentation

$components = array ()

Definition at line 52 of file locale.php.

$controller = false

Definition at line 46 of file locale.php.

Referenced by startup().


The documentation for this class was generated from the following file:

Generated on Mon Apr 27 16:29:08 2009 for kata by  doxygen 1.5.8