The ExtendScript translator part of the Dutranslator Framework
see https://github.com/Rainbox-dev/Dutranslator
see https://github.com/Rainbox-dev/Dutranslator
Namespaces
Members
Methods
# static generateTranslationFile(translationsopt, file, appNameopt, versionopt, languageIdopt, languageNameopt, mergeScriptuiStringsopt)
Creates a file for translation with the given base strings.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
translations |
Array.<DuTranslation>
|
DuList.<string>
|
Array.<string>
|
<optional> |
DuTranslator.originalStrings | The translations or source strings to be included in the translation file. |
file |
File
|
string
|
The file or URI | ||
appName |
string
|
<optional> |
DuESF.scriptName | A name for the app using this translation file. |
version |
string
|
<optional> |
DuESF.scriptVersion.fullVersion | A version (as a string) for this translation file or app. |
languageId |
string
|
<optional> |
DuTranslator.current | A version (as a string) for this translation file or app. |
languageName |
string
|
<optional> |
DuTranslator.currentName | A version (as a string) for this translation file or app. |
mergeScriptuiStrings |
Boolean
|
<optional> |
true | Merges the strings declared in DuScriptui to the translations. |
# static generateTranslations(strings, mergeScriptuiStringsopt) → {Array.<string>}
Converts an Array of strings to an Array of empty translations
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
strings |
Array.<string>
|
DuList.<string>
|
The base strings to convert. | ||
mergeScriptuiStrings |
Boolean
|
<optional> |
true | Merges the strings declared in DuScriptui to the translations. |
The translations
Array.<string>
# static getAvailable() → {int}
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.
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.
A success code
0 Success
1 One of the file haven't been correctly opened
0 Success
1 One of the file haven't been correctly opened
int
# static getLanguageId(prettyName) → {string}
Returns the language id of a given language name
Parameters:
Name | Type | Description |
---|---|---|
prettyName |
string
|
The pretty name of the request language |
string
# static getPrettyName(langId) → {string}
Returns the pretty name of a given language
Parameters:
Name | Type | Description |
---|---|---|
langId |
string
|
The id of the request language |
string
# static getPrettyNames(langId) → {Array.<string>}
Returns a list containing pretty names of all languages
Parameters:
Name | Type | Description |
---|---|---|
langId |
string
|
The id of the request language |
Array.<string>
# static setLanguage(languageId) → {Boolean}
Set the current language
Parameters:
Name | Type | Description |
---|---|---|
languageId |
string
|
The id of the language to set |
Success
Boolean
# static setPrettyLanguage(languageName) → {Boolean}
Set the current language with a given pretty name
Parameters:
Name | Type | Description |
---|---|---|
languageName |
string
|
The pretty name of the language to set |
Success
Boolean