lang::util::convert_to_i18n (public)
lang::util::convert_to_i18n [ -locale locale ] \ [ -package_key package_key ] [ -message_key message_key ] \ [ -prefix prefix ] -text text [ -object_id object_id ]
Defined in packages/acs-lang/tcl/lang-util-procs.tcl
Internationalising of Attributes. This is done by storing the attribute with its acs-lang key
- Switches:
- -locale (optional, defaults to
"en_US"
)- -package_key (optional, defaults to
"acs-translations"
)- -message_key (optional)
- -prefix (optional)
- -text (required)
- -object_id (optional)
- bind the newly created message key to this acs_object id. Upon object's deletion, the message key will be deleted as well.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- lang_test__convert_to_i18n, group_localization
Source code: # If the package acs-translations is installed do the conversion # magic, otherwise just return the text again. if {[apm_package_id_from_key acs-translations]} { if {$message_key eq ""} { if {$prefix eq ""} { # Having no prefix or message_key is discouraged as it # might have interesting side effects due to double # meanings of the same english string in multiple contexts # but for the time being we should still allow this. set message_key [lang::util::suggest_key $text] } else { set message_key "${prefix}_[lang::util::suggest_key $text]" } } # Register the language keys lang::message::register -object_id $object_id $locale $package_key $message_key $text return "#${package_key}.${message_key}#" } else { return "$text" }XQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-lang/tcl/lang-util-procs.xql