FreeBSD Manual Pages
OpenXPKI::i18n(3) User Contributed Perl Documentation OpenXPKI::i18n(3) Name OpenXPKI::i18n - internationalization (i18n) handling class. Exported functions Exported function are function which can be imported by every other object. All i18n functions are static functions and work in global context. debug You should call the function in the following way: i18nGettext ("I18N_OPENXPKI_MY_CLASS_MY_FUNCTION_MY_MESSAGE");> Description This 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. Functions set_locale_prefix The only parameter is a directory in the filesystem. The function is used to set the path to the directory with the mo databases. i18nGettext The 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_language Switch 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_language returns the actually configured language. perl v5.32.0 2020-08-29 OpenXPKI::i18n(3)
Name | Exported functions | Description | Functions
Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=OpenXPKI::i18n&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>