I18n
class I18n
Language Tools
Properties
$language | |||
$culture | |||
$locale | |||
string | $timezone | ||
$locale_set | Last locale that has been set |
||
$conventions | |||
$template_vars | |||
string | $last_template_loaded_from | after load_template is called, you can get the location, the template is loaded from via this property |
|
string | $last_template_is_custom | after load_template is called, you can get if the template is a custum template or not |
Methods
No description
Clear Message Vars
Converts given SQL containing i18n fields with user specific user language fields Example: SELECT name_i18n FROM test is converted to SELECT name_DE_DE as name_i18n FROM test Example2: SELECT name_i18n AS name FROM test is converted to SELECT name_DE_DE AS name FROM test
Retuns all translations for the passed locale and optional domain, tokenprefix
gets languages found in tbl|system_i18n_language.
Returns the conventions of the current locale
querys tbl|system_lib_country and returns array with list of countries.
No description
No description
Get language selection menu
No description
No description
No description
Returns an array with all translated tokens during this page call
Returns the translation for the passed token.
No description
Generates an array of all timezones, using their identifier as the key and including their offset in the label
No description
Creates an i18n lookup array containing mappings from tokens to translations
saves a template to db different language and kulture has to be set by i18n->set_languag and i18n->set_culture custom is as default false
No description
No description
No description
No description
Details
at line 91
bool
check_i18n_support(bool $force = false)
No description
at line 524
void
clear_message_vars()
Clear Message Vars
at line 941
string
convert_i18n_sql(string $sql)
Converts given SQL containing i18n fields with user specific user language fields Example: SELECT name_i18n FROM test is converted to SELECT name_DE_DE as name_i18n FROM test Example2: SELECT name_i18n AS name FROM test is converted to SELECT name_DE_DE AS name FROM test
at line 441
mixed
getTranslations($locale, false $domain = false, $tokenPrefix = false, $onlyCustom = false)
Retuns all translations for the passed locale and optional domain, tokenprefix
at line 851
array
get_available_languages(bool $with_captions = false, bool $show_only_active = true, $show_only_published = true)
gets languages found in tbl|system_i18n_language.
concats language and culture. i.e.: DE_DE, EN_GB
at line 321
array|string
get_conventions(bool|string $param = false)
Returns the conventions of the current locale
See php localeconv() for return values http://de2.php.net/manual/de/function.localeconv.php
at line 908
array
get_country_list(string $key = 'iCountryCode', string $value = 'cCountryName', $translateValue = false)
querys tbl|system_lib_country and returns array with list of countries.
Valid parameter values: iCountryCode cCountryName Array will be mapped with given parameters for $key and $value
at line 307
string
get_culture()
No description
at line 299
string
get_language()
No description
at line 1059
string
get_language_select(array $linkParams = [])
Get language selection menu
at line 291
string
get_locale()
No description
at line 535
string
get_parsed_message(string $template_name, string $section, string $module = 'system')
No description
at line 335
mixed|string
get_timezone(bool $pretty = true)
No description
at line 461
array
get_translated_tokens()
Returns an array with all translated tokens during this page call
at line 349
string
get_translation(string $token, string $domain = 'default')
Returns the translation for the passed token.
Optionally define domain to search in passed domain first. If token is not translated in passed domain the default domain will be used.
at line 82
init()
No description
at line 246
list_timezones()
Generates an array of all timezones, using their identifier as the key and including their offset in the label
at line 631
string
load_template(string $template_file, bool|string $language = false, bool|string $culture = false, bool $custom_allowed = true)
No description
at line 1044
array
make_i18n_lookup_array(mixed $array)
Creates an i18n lookup array containing mappings from tokens to translations
at line 752
save_template(mixed $module, mixed $template_filename, mixed $template_content, mixed $language = false, mixed $culture = false, bool $custom = false, bool $is_vars_template = false)
saves a template to db different language and kulture has to be set by i18n->set_languag and i18n->set_culture custom is as default false
at line 113
set_language(bool|string $locale = false)
No description
at line 497
bool
set_message_vars(mixed $values)
No description
at line 211
set_timezone(bool|string $timezone = false)
No description
at line 468
string_to_number($string)
No description