Stud.IP  2.0 Revision 48548
 All Data Structures Namespaces Files Functions Variables Pages
language.inc.php File Reference

Namespaces

namespace  studip_core

Functions

 get_accepted_languages ()
 init_i18n ($_language)
 makeButton ($name, $mode="img", $tooltip=false, $inputname=false)
 getUserLanguagePath ($uid)
 setTempLanguage ($uid=FALSE, $temp_language="")
 restoreLanguage ()
 setLocaleEnv ($language, $language_domain= '')
 localeButtonUrl ($filename)
 localePictureUrl ($filename)
 localeUrl ($filename, $category)

Function Documentation

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.

public

Returns
string preferred user language, given in "en_GB"-style

Here is the caller graph for this function:

getUserLanguagePath (   $uid)

retrieves path to preferred language of user from database

Can be used for sending language specific mails to other users.

public

Parameters
stringthe user_id of the recipient (function will try to get preferred language from database)
Returns
string the path to the language files, given in "en"-style

Here is the caller graph for this function:

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.

public

Parameters
stringthe language to use for output, given in "en_GB"-style
Returns
string the path to the language file, given in "en"-style

Here is the call graph for this function:

Here is the caller graph for this function:

localeButtonUrl (   $filename)

Here is the call graph for this function:

Here is the caller graph for this function:

localePictureUrl (   $filename)

Here is the call graph for this function:

localeUrl (   $filename,
  $category 
)

Here is the caller graph for this function:

makeButton (   $name,
  $mode = "img",
  $tooltip = false,
  $inputname = false 
)

create the img tag for graphic buttons

This function creates the html text for a button. Decides, which button (folder) is used for international buttons.

public

Parameters
stringthe (german) button name
stringif mode = img, the functions return the full tag, if mode = src, it return only the src-part , if mode = input returns full input tag
stringtooltip text, if tooltip should be included in tag
stringif mode=input this param defines the name attribut
Returns
string html output of the button

Here is the call graph for this function:

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().

public

Here is the call graph for this function:

Here is the caller graph for this function:

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.

public

Here is the caller graph for this function:

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.

public

Parameters
stringthe user_id of the recipient (function will try to get preferred language from database)
stringexplicit temporary language (set $uid to FALSE to switch to this language)

Here is the call graph for this function:

Here is the caller graph for this function: