Language class

The following sections explain each method of the class.


public static void set_language ( string $lng)

Sets the user language in the system

Parameter list

The language like for example de_DE for German in the German space or en_US for American English.

Warning: It should be noted that the proper locale is installed on the server.


public static string get_language ( )

Returns the currently set user language.


public static void set_language_path ( string $path )

The path for the language folders. Each language code must have a folder. This folder, in turn, is a the LC_MESSAGES folder called. And then in there are the language abbreviation .mo and .po files.

Parameter list

The absolute path to the locale folders


public static string get_language_path ( )

Returns the absolute path back to the locale language folders.


public static void set_default_language ( string $lng)

Sets the system default locale.

Parameter list

The locale language code.


public static string get_default_language ( )

Returns the default locale language code back.


public static void load_lang ( )

If carried out to initialize the languages. Here locales and folders are set.


public static string translate( string $text)

Translated the given string for the current locale. Here, the term has in the locale .po occur file.

Parameter list

The string to be translated to the current locale. If the string in the .po file not found, it returns the given string untouched.


public static array getAllSystemLocales( )

Are all locales back that are installed on the server.

Note: Only works on UNIX systems. Windows systems do not support the reading of the locales.