ApSetTranslation()

Change the current translation to another language

Synopsis:

#include <Ap.h>

int ApSetTranslation( char const *lang_ext );

Arguments:

lang_ext
NULL, or the extension for the language that you want to switch to (e.g. ja_JP for Japanese).

Library:

Ap

Description:

ApSetTranslation() changes the current translation file to the one defined by lang_ext. If lang_ext is NULL, the translation is set to the default (i.e. the original language used in the application). If the extension pointed to by lang_ext is invalid, the translation file isn't changed.

When you run your application outside of PhAB, it looks for the translation files as follows:

  1. in the directories listed in the ABLPATH environment variable, if defined. This list takes the form:
    dir:dir:dir:dir
        

    Unlike the PATH environment variable, the current directory must be indicated by a period, not an empty string. An empty string in ABLPATH indicates the directory where the executable is.

  2. in the same directory as the executable, if the ABLPATH environment variable isn't defined

Note: In an application that loads PhAB DLLs, this function changes the current language for all registered contexts (i.e. the program and all DLLs). It first unloads any existing language translations for all the contexts, and then attempts to find a translation file for each context, using the name and location of the executable or DLL to perform the ABLPATH search described above.

Returns:

0
Successful completion.
-1
The translation extension is invalid.

Examples:

/* Set the current translation to German: */

ApSetTranslation( "de_DE");

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

ApAppendTranslation(), ApOpenDBase(), ApOpenDBaseFile(), ApGetTextRes()

International Language Support chapter of the Photon Programmer's Guide