| 
    Stud.IP
    jlu_3.3 Revision
    
   | 
  
Namespaces | |
| namespace | studip_core | 
Functions | |
| get_accepted_languages () | |
| init_i18n ($_language) | |
| getUserLanguage ($uid) | |
| getUserLanguagePath ($uid) | |
| setTempLanguage ($uid=FALSE, $temp_language="") | |
| restoreLanguage () | |
| setLocaleEnv ($language, $language_domain='') | |
| localePictureUrl ($filename) | |
| localeUrl ($filename, $category) | |
| get_accepted_languages | ( | ) | 
This function tries to find the preferred language
This function tries to find the preferred language. It returns the first accepted language from browser settings, which is installed.
@access public

| getUserLanguage | ( | $uid | ) | 
retrieves preferred language of user from database, falls back to default language
@access public
| string | the user_id of the user in question | 


| getUserLanguagePath | ( | $uid | ) | 
retrieves path to preferred language of user from database
Can be used for sending language specific mails to other users.
@access public
| string | the user_id of the recipient (function will try to get preferred language from database) | 


| init_i18n | ( | $_language | ) | 
This function starts output via i18n system in the given language
This function starts output via i18n system in the given language. It returns the path to the choosen language.
@access public
| string | the language to use for output, given in "en_GB"-style | 


| localePictureUrl | ( | $filename | ) | 

| localeUrl | ( | $filename, | |
| $category | |||
| ) | 


| restoreLanguage | ( | ) | 
switch i18n back to original language
This function switches i18n system back to the original language. Should be called after writing strings to other users via setTempLanguage().
@access public


| setLocaleEnv | ( | $language, | |
$language_domain = ''  | 
        |||
| ) | 
set locale to a given language and select translation domain
This function tries to set the appropriate environment variables and locale settings for the given language and also (optionally) sets the translation domain. Note: To support non-POSIX compliant systems (SuSE 9.x, OpenSolaris?), the environment variables LANG and LC_ALL are also set to $language.
@access public

| setTempLanguage | ( | $uid = FALSE,  | 
        |
$temp_language = ""  | 
        |||
| ) | 
switch i18n to different language
This function switches i18n system to a different language. Should be called before writing strings to other users into database. Use restoreLanguage() to switch back.
@access public
| string | the user_id of the recipient (function will try to get preferred language from database) | 
| string | explicit temporary language (set $uid to FALSE to switch to this language) | 

