Namespace: DuTranslator

DuTranslator

The ExtendScript translator part of the Dutranslator Framework
see https://github.com/Rainbox-dev/Dutranslator

Namespaces

Settings

Members

static,readonlyDuTranslator.currentstring

The current language id (fr, en, ..)

static,readonlyDuTranslator.currentNamestring

The current language name

Methods

staticDuTranslator.generateTranslationFile(translations, file, appName, version, languageId, languageName)

D:/DEV_SRC/RxOT/DuAEF/DuESF/tools/build/output/DuESF.jsxinc, line 2044
Creates a file for translation with the given base strings.
Name Type Default Description
translations Array.<DuTranslation> | strings DuTranslator.localizedStrings optional The translations or source strings to be included in the translation file.
file File | string The file or URI
appName string "dutranslator" optional A name for the app using this translation file.
version string "0.0" optional A version (as a string) for this translation file or app.
languageId string DuTranslator.current optional A version (as a string) for this translation file or app.
languageName string DuTranslator.currentName optional A version (as a string) for this translation file or app.

staticDuTranslator.generateTranslations(strings){Array.<DuTranslation>}

D:/DEV_SRC/RxOT/DuAEF/DuESF/tools/build/output/DuESF.jsxinc, line 2078
Converts an Array of strings to an Array of empty translations
Name Type Description
strings Array.<string> The base strings to convert.
Returns:
Type Description
Array.<DuTranslation> The empty translations

staticDuTranslator.getAvailable(){int}

D:/DEV_SRC/RxOT/DuAEF/DuESF/tools/build/output/DuESF.jsxinc, line 1868
Load the list of available languages.

If the language id and or the language name can't be found in the file, the file name will be used
to determine the language id and the name will be set as the id.
Returns:
Type Description
int A success code
0 Success
1 One of the file haven't been correctly opened

staticDuTranslator.getLanguageId(prettyName){string}

D:/DEV_SRC/RxOT/DuAEF/DuESF/tools/build/output/DuESF.jsxinc, line 1950
Returns the language id of a given language name
Name Type Description
prettyName string The pretty name of the request language
Returns:
Type Description
string

staticDuTranslator.getPrettyName(langId){string}

D:/DEV_SRC/RxOT/DuAEF/DuESF/tools/build/output/DuESF.jsxinc, line 1939
Returns the pretty name of a given language
Name Type Description
langId string The id of the request language
Returns:
Type Description
string

staticDuTranslator.getPrettyNames(langId){Array.<string>}

D:/DEV_SRC/RxOT/DuAEF/DuESF/tools/build/output/DuESF.jsxinc, line 1964
Returns a list containing pretty names of all languages
Name Type Description
langId string The id of the request language
Returns:
Type Description
Array.<string>

staticDuTranslator.setLanguage(languageId){int}

D:/DEV_SRC/RxOT/DuAEF/DuESF/tools/build/output/DuESF.jsxinc, line 1985
Set the current language
Name Type Description
languageId string The id of the language to set
Returns:
Type Description
int success code
0 Everything went ok
1 The file linked to the given id can't be opened
2 The json content doesn't match a translation file

staticDuTranslator.setPrettyLanguage(languageName){int}

D:/DEV_SRC/RxOT/DuAEF/DuESF/tools/build/output/DuESF.jsxinc, line 2025
Set the current language with a given pretty name
Name Type Description
languageName string The pretty name of the language to set
Returns:
Type Description
int success code
0 Everything went ok
-1 Can't find any language with the given pretty name
>0 Call to setLanguage(languageId) failed