Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@doodle/i18n / docs
  ..
  README.md
Size: Mime:

Documentation

Modules

@doodle/i18n/disty/onesky/api

Interact with the OneSky API

@doodle/i18n/disty/onesky/api~getProjectLanguages(projectId, credentials) ⇒ Promise.<OneSkyLanguage>

Retrieve the defined languages in the OneSky project

Kind: inner method of @doodle/i18n/disty/onesky/api

Param Type
projectId string
credentials OneSkyCredentials

@doodle/i18n/disty/onesky/api~uploadProjectTranslation(projectTranslation, messages, credentials, syncOptions) ⇒ Promise

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

@doodle/i18n/disty/onesky/api~getProjectMessagesByLanguage(projectTranslationOptions, credentials) ⇒ Promise.<object>

Download messages from a OneSky project by one language

Kind: inner method of @doodle/i18n/disty/onesky/api

Param Type
projectTranslationOptions OneSkyTranslationOptions
credentials OneSkyCredentials

@doodle/i18n/disty/onesky/api~OneSkyCredentials : object

OneSky credentials

Kind: inner typedef of @doodle/i18n/disty/onesky/api
Properties

  • secret string
  • apiKey string

@doodle/i18n/disty/onesky/api~OneSkyTranslationOptions : object

OneSky Translation

Kind: inner typedef of @doodle/i18n/disty/onesky/api
Properties

  • projectId string
  • language string
  • fileName string

@doodle/i18n/disty/onesky/api~OneSkySyncOptions : object

OneSky translation upload options

Kind: inner typedef of @doodle/i18n/disty/onesky/api
Properties

  • format string
  • keepStrings string

@doodle/i18n/disty/onesky/api~OneSkyLanguage : object

OneSky Language object

Kind: inner typedef of @doodle/i18n/disty/onesky/api
Properties

  • code string - language code, i.e. en-US or de
  • english_name string - i.e. English (United States)
  • local_name string - i.e. English (United States)
  • locale string - i.e. en
  • region string - i.e. US
  • is_base_language bool
  • is_ready_to_publish bool
  • translation_progress string - i.e. 100%
  • uploaded_at string - i.e. 2013-10-07T15:27:10+0000
  • uploaded_at_timestamp number - i.e. 1381159630

@doodle/i18n/disty/onesky/diff

Compare translation files

@doodle/i18n/disty/onesky/diff~getAddedKeys(sourceMessages, baseMessages) ⇒ Array.<string>

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

@doodle/i18n/disty/onesky/diff~getChangedKeys(sourceMessages, baseMessages) ⇒ Array.<string>

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

@doodle/i18n/disty/onesky/diff~getRenamedKeys(sourceMessages, baseMessages) ⇒ Array.<array>

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

@doodle/i18n/disty/onesky/diff~getDeletedKeys(sourceMessages, baseMessages) ⇒ Array.<string>

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

@doodle/i18n/disty/onesky/diff~updateMessages(messages, modifications)

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>

@doodle/i18n/disty/onesky/extract

Extract translations from source code

@doodle/i18n/disty/onesky/extract~extractDefaultMessagesFromFile(file) ⇒ Promise.<object>

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

@doodle/i18n/disty/onesky/extract~extractDefaultMessages(sourcePattern) ⇒ Promise.<object>

Extract react-intl's defineMessages message definitions from source files

Kind: inner method of @doodle/i18n/disty/onesky/extract

Param Type
sourcePattern string

@doodle/i18n/disty/onesky

Main module for managing translations

@doodle/i18n/disty/onesky~getConfig(options) ⇒ Promise.<object>

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>

@doodle/i18n/disty/onesky~downloadAllTranslations(options) ⇒ Promise

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>

@doodle/i18n/disty/onesky~uploadBaseMessagesFromSource(options) ⇒ Promise

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>

@doodle/i18n/disty/onesky~updateTranslations(options) ⇒ Promise

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

@doodle/i18n/disty/onesky~uploadAllTranslations(options) ⇒ Promise

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

@doodle/i18n/disty/onesky~Credentials : object

Legacy credentials object interface

Kind: inner typedef of @doodle/i18n/disty/onesky
Properties

  • key string
  • secret string

@doodle/i18n/disty/onesky/transform

Transform translation files between flat JSON and hierarchical JSON

@doodle/i18n/disty/onesky/transform~unflatten(messages) ⇒ object

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

@doodle/i18n/disty/onesky/transform~flatten(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

@doodle/i18n/disty/onesky/translations

Manage translations for OneSky

@doodle/i18n/disty/onesky/translations~getProjectTranslations(projectId, credentials) ⇒ Promise.<object>

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

@doodle/i18n/disty/onesky/translations~getMergedProjectTranslations(projectIds, credentials) ⇒ Promise.<object>

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

@doodle/i18n/disty/onesky/translations~downloadMergedTranslationFiles(projectIds, targetPath, credentials) ⇒ Promise.<object>

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

@doodle/i18n/disty/onesky/translations~updateTranslationFile(file, sourceMessages, includeValues) ⇒ Promise

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

@doodle/i18n/disty/onesky/translations~updateTranslationFiles(projectId, credentials, sourcePattern, targetPath, includeValues) ⇒ Promise

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

@doodle/i18n/disty/onesky/translations~uploadTranslationFiles(path, translationOptions, credentials, syncOptions) ⇒ Promise

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

@doodle/i18n/onesky/dist/utils

File utilities

@doodle/i18n/onesky/dist/utils~writeJsonFile(file, messages) ⇒ Promise

Write a JSON object to a file

Kind: inner method of @doodle/i18n/onesky/dist/utils

Param Type
file String
messages object

@doodle/i18n/onesky/dist/utils~readJsonFile(file) ⇒ Promise.<object>

Read a JSON file and parse the contents

Kind: inner method of @doodle/i18n/onesky/dist/utils

Param Type
file string

@doodle/i18n/onesky/dist/utils~getResourceConfiguration(file) ⇒ Promise.<object>

Read OneSky resource configuration file, .oneskyrc

Kind: inner method of @doodle/i18n/onesky/dist/utils

Param Type
file string