|
NameOpenXPKI::i18n - internationalization (i18n) handling class.Exported functionsExported function are function which can be imported by every other object. All i18n functions are static functions and work in global context.debugYou should call the function in the following way:i18nGettext ("I18N_OPENXPKI_MY_CLASS_MY_FUNCTION_MY_MESSAGE");> DescriptionThis module manages all i18n stuff for the OpenXPKi system. The main job is the implementation of the translation function and the storage of the activated language.All functions work in static mode (static member functions). This means that they are to be invoked directly and not via an object instance. Functionsset_locale_prefixThe only parameter is a directory in the filesystem. The function is used to set the path to the directory with the mo databases.i18nGettextThe first parameter is the i18n code string that should be looked up in the translation table. Usually this identifier should look like "I18N_OPENXPKI_MODULE_FUNCTION_SPECIFIC_STUFF". If the first parameter is undefined or has the length zero then the function returns the first parameter itself. Optionally there may follow a hash or a hash reference that maps parameter keywords to values that should be replaced in the original string. A parameter should have the format "__NAME__", but in fact every keyword is possible.The function obtains the translation for the code string (if available) and then replaces each parameter keyword in the code string with the corresponding replacement value. The function always returns an UTF8 string. Examples: my $text; $text = i18nGettext("I18N_OPENXPKI_FOO_BAR"); $text = i18nGettext("I18N_OPENXPKI_FOO_BAR", "__COUNT__" => 1, "__ORDER__" => "descending", ); %translation = ( "__COUNT__" => 1, "__ORDER__" => "descending" ); $text = i18nGettext("I18N_OPENXPKI_FOO_BAR", %translation); $translation_ref = { "__COUNT__" => 1, "__ORDER__" => "descending" }; $text = i18nGettext("I18N_OPENXPKI_FOO_BAR", $translation_ref); set_languageSwitch complete language setup to the specified language. If no language is specified then the default language C is activated. This deactivates all translation databases.get_languagereturns the actually configured language.
Visit the GSP FreeBSD Man Page Interface. |