## DuTranslator

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

View Source DuAEF_Duik_api.jsxinc, line 3179

### Namespaces

Settings

# Members

Type: `string`

#### # static readonly current

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

View Source DuAEF_Duik_api.jsxinc, line 3187

Type: `string`

#### # static readonly currentName

The current language name

View Source DuAEF_Duik_api.jsxinc, line 3195

# 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.

View Source DuAEF_Duik_api.jsxinc, line 3482

#### # 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.

View Source DuAEF_Duik_api.jsxinc, line 3518

Returns:
The translations
Type: `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.

View Source DuAEF_Duik_api.jsxinc, line 3287

Returns:
A success code
0 Success
1 One of the file haven't been correctly opened
Type: `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

View Source DuAEF_Duik_api.jsxinc, line 3368

Returns:
Type: `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

View Source DuAEF_Duik_api.jsxinc, line 3357

Returns:
Type: `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

View Source DuAEF_Duik_api.jsxinc, line 3382

Returns:
Type: `Array.<string>`

#### # static setLanguage(languageId) → {Boolean}

Set the current language

##### Parameters:

Name | Type | Description
--- | --- | ---
`languageId` | `string` | The id of the language to set

View Source DuAEF_Duik_api.jsxinc, line 3400

Returns:
Success
Type: `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

View Source DuAEF_Duik_api.jsxinc, line 3463

Returns:
Success
Type: `Boolean`