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


Manual Reference Pages  -  OPENXPKI::I18N (3)

.ds Aq ’

Name

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

CONTENTS

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.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 OPENXPKI::I18N (3) 2016-04-03

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