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
Return the current translation version
Mimics localeconv() using Intl Library
Translates a token and replaces the placeholders in it.
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
Returns true if the passed token seems to be in the new JSON token format / technical token (e.g. "xelos.token.dialog.error.label")
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 96
bool
check_i18n_support(bool $force = false)
No description
at line 552
void
clear_message_vars()
Clear Message Vars
at line 998
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 1151
int
getCurrentTranslationVersion()
Return the current translation version
at line 311
array
getLocaleConv()
Mimics localeconv() using Intl Library
at line 643
string
getTranslation(string $token, array $placeholders = [], string $domain = 'default')
Translates a token and replaces the placeholders in it.
at line 908
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 349
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 965
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 335
string
get_culture()
No description
at line 327
string
get_language()
No description
at line 1114
string|null
get_language_select()
Get language selection menu
at line 303
string
get_locale()
No description
at line 563
string
get_parsed_message(string $template_name, string $section, string $module = 'system')
No description
at line 363
mixed|string
get_timezone(bool $pretty = true)
No description
at line 489
array
get_translated_tokens()
Returns an array with all translated tokens during this page call
at line 378
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 87
init()
No description
at line 434
bool
isJsonToken(string $token)
Returns true if the passed token seems to be in the new JSON token format / technical token (e.g. "xelos.token.dialog.error.label")
at line 258
list_timezones()
Generates an array of all timezones, using their identifier as the key and including their offset in the label
at line 680
string
load_template(string $template_file, bool|string $language = false, bool|string $culture = false, bool $custom_allowed = true)
No description
at line 1101
array
make_i18n_lookup_array(mixed $array)
Creates an i18n lookup array containing mappings from tokens to translations
at line 809
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 118
set_language(bool|string $locale = false)
No description
at line 525
bool
set_message_vars(mixed $values)
No description
at line 223
set_timezone(bool|string $timezone = false)
No description
at line 496
string_to_number($string)
No description