Repository URL to install this package:
|
Version:
5.0.1 ▾
|
@doodle/i18n
/
docs
|
|---|
| .. |
| README.md |
Interact with the OneSky API
Retrieve the defined languages in the OneSky project
Kind: inner method of @doodle/i18n/disty/onesky/api
| Param | Type |
|---|---|
| projectId | string |
| credentials | OneSkyCredentials |
Upload messages to a OneSky project for one language
Kind: inner method of @doodle/i18n/disty/onesky/api
| Param | Type |
|---|---|
| projectTranslation | OneSkyTranslationOptions |
| messages | object |
| credentials | OneSkyCredentials |
| syncOptions | OneSkySyncOptions |
Download messages from a OneSky project by one language
Kind: inner method of @doodle/i18n/disty/onesky/api
| Param | Type |
|---|---|
| projectTranslationOptions | OneSkyTranslationOptions |
| credentials | OneSkyCredentials |
OneSky credentials
Kind: inner typedef of @doodle/i18n/disty/onesky/api
Properties
OneSky Translation
Kind: inner typedef of @doodle/i18n/disty/onesky/api
Properties
OneSky translation upload options
Kind: inner typedef of @doodle/i18n/disty/onesky/api
Properties
OneSky Language object
Kind: inner typedef of @doodle/i18n/disty/onesky/api
Properties
Compare translation files
Return an array containing an array of new keys based on the difference between source and OneSky base translation
Kind: inner method of @doodle/i18n/disty/onesky/diff
Returns: Array.<string> - an array of new keys
| Param | Type | Description |
|---|---|---|
| sourceMessages | object | hierarchical messages extracted from source files |
| baseMessages | object | hierarchical messages from the base OneSky translation |
Return an array containing an array of keys for changed values based on the difference between source and OneSky base translation
Kind: inner method of @doodle/i18n/disty/onesky/diff
Returns: Array.<string> - an array of keys for changed valeus
| Param | Type | Description |
|---|---|---|
| sourceMessages | object | hierarchical messages extracted from source files |
| baseMessages | object | hierarchical messages from the base OneSky translation |
Return an array containing a [fromKey, toKey] tuple for renaming translation keys based on the difference between source and OneSky base translation
Kind: inner method of @doodle/i18n/disty/onesky/diff
Returns: Array.<array> - a [fromKey, toKey] tuple for renaming keys
| Param | Type | Description |
|---|---|---|
| sourceMessages | object | hierarchical messages extracted from source files |
| baseMessages | object | hierarchical messages from the base OneSky translation |
Return an array containing an array of deleted keys based on the difference between source and OneSky base translation
Kind: inner method of @doodle/i18n/disty/onesky/diff
Returns: Array.<string> - an array of deleted keys
| Param | Type | Description |
|---|---|---|
| sourceMessages | object | hierarchical messages extracted from source files |
| baseMessages | object | hierarchical messages from the base OneSky translation |
Return a new flat message object according to modification instructions. This can be used to modify message objects from other languages based on modification instructions from the base language
Kind: inner method of @doodle/i18n/disty/onesky/diff
| Param | Type |
|---|---|
| messages | object |
| modifications | object |
| modifications.added | Array.<array> |
| modifications.changed | Array.<array> |
| modifications.renamed | Array.<array> |
| modifications.deleted | Array.<string> |
Extract translations from source code
Extract react-intl's defineMessages message definition from Javascript file by parsing the AST
Kind: inner method of @doodle/i18n/disty/onesky/extract
| Param | Type |
|---|---|
| file | String |
Extract react-intl's defineMessages message definitions from source files
Kind: inner method of @doodle/i18n/disty/onesky/extract
| Param | Type |
|---|---|
| sourcePattern | string |
Main module for managing translations
Get combined configuration from parameters, .oneskyrc and environment variables
Kind: inner method of @doodle/i18n/disty/onesky
| Param | Type |
|---|---|
| options | object |
| options.credentials | Credentials |
| options.projectId | string |
| options.dependentProjectIds | Array.<string> |
Download all translation files for all defined languages of multiple OneSky projects
Kind: inner method of @doodle/i18n/disty/onesky
| Param | Type |
|---|---|
| options | object |
| options.credentials | Credentials |
| options.projectId | string |
| options.dependentProjectIds | Array.<string> |
Upload directly the translation from the default messages defined in the source code
Kind: inner method of @doodle/i18n/disty/onesky
| Param | Type |
|---|---|
| options | object |
| options.credentials | Credentials |
| options.projectId | string |
| options.dependentProjectIds | Array.<string> |
Update translations files
Kind: inner method of @doodle/i18n/disty/onesky
| Param | Type |
|---|---|
| options | object |
| options.credentials | Credentials |
| options.projectId | string |
| options.srcPath | string |
| options.i18nPath | string |
Upload all translations files
Kind: inner method of @doodle/i18n/disty/onesky
| Param | Type |
|---|---|
| options | object |
| options.credentials | Credentials |
| options.projectId | string |
| options.srcPath | string |
| options.i18nPath | string |
Legacy credentials object interface
Kind: inner typedef of @doodle/i18n/disty/onesky
Properties
Transform translation files between flat JSON and hierarchical JSON
Unflatten a messages object
Kind: inner method of @doodle/i18n/disty/onesky/transform
Returns: object - a hierarchical messages object
| Param | Type | Description |
|---|---|---|
| messages | object | a flat messages object |
Flatten a messages object
Kind: inner method of @doodle/i18n/disty/onesky/transform
Returns: object - a flat messages object
| Param | Type | Description |
|---|---|---|
| messages | object | hierarchical object |
Manage translations for OneSky
Download translations from a OneSky project for all defined languages in the project
Kind: inner method of @doodle/i18n/disty/onesky/translations
| Param | Type |
|---|---|
| projectId | string |
| credentials | OneSkyCredentials |
Download translations from multiple OneSky projects for all defined languages in the respective projects and combine the message translations
Kind: inner method of @doodle/i18n/disty/onesky/translations
| Param | Type |
|---|---|
| projectIds | Array.<string> |
| credentials | OneSkyCredentials |
Download all translations from multiple OneSky projects and write them to JSON files by language
Kind: inner method of @doodle/i18n/disty/onesky/translations
| Param | Type |
|---|---|
| projectIds | Array.<string> |
| targetPath | string |
| credentials | OneSkyCredentials |
Update a translation file containing hierarchical messages with changes from source messages
Kind: inner method of @doodle/i18n/disty/onesky/translations
| Param | Type | Default |
|---|---|---|
| file | string | |
| sourceMessages | object | |
| includeValues | bool | false |
Update local translation files with changes from the source for all languages defined by the OneSky project
Kind: inner method of @doodle/i18n/disty/onesky/translations
| Param | Type | Default |
|---|---|---|
| projectId | string | |
| credentials | OneSkyCredentials | |
| sourcePattern | string | |
| targetPath | string | |
| includeValues | string | false |
Upload translation files for all languages of the project, not only the base language!
Kind: inner method of @doodle/i18n/disty/onesky/translations
| Param | Type | Description |
|---|---|---|
| path | string | path to folder containing the hierarchical ${language}.json translation files |
| translationOptions | OneSkyTranslationOptions | |
| credentials | OneSkyCredentials | |
| syncOptions | OneSkySyncOptions |
File utilities
Write a JSON object to a file
Kind: inner method of @doodle/i18n/onesky/dist/utils
| Param | Type |
|---|---|
| file | String |
| messages | object |
Read a JSON file and parse the contents
Kind: inner method of @doodle/i18n/onesky/dist/utils
| Param | Type |
|---|---|
| file | string |
Read OneSky resource configuration file, .oneskyrc
Kind: inner method of @doodle/i18n/onesky/dist/utils
| Param | Type |
|---|---|
| file | string |