GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
OpenXPKI::i18n(3) User Contributed Perl Documentation OpenXPKI::i18n(3)

OpenXPKI::i18n - internationalization (i18n) handling class.

Exported function are function which can be imported by every other object. All i18n functions are static functions and work in global context.

You should call the function in the following way:

i18nGettext ("I18N_OPENXPKI_MY_CLASS_MY_FUNCTION_MY_MESSAGE");>

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.

The only parameter is a directory in the filesystem. The function is used to set the path to the directory with the mo databases.

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);

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.

returns the actually configured language.
2022-05-14 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.