/orange-i18n

A Fantasy Farming: Orange Season's mod to allow the translation of the game to other languages.

Primary LanguageJavaScriptMIT LicenseMIT

Orange I18N

Build Status Maintainability Test Coverage Greenkeeper badge dependencies Status devDependencies Status GitHub issues License: MIT

A Fantasy Farming: Orange Season's mod to allow the translation of the game to other languages.

API Reference

Classes

GettextFormatter

Class used to encode and decode gettext data.

JsonFormatter

Class used to encode and decode JSON data.

GettextFormatter

Class used to encode and decode gettext data.

Kind: global class

GettextFormatter.ext

Kind: static property of GettextFormatter
Properties

Name Type Default Description
ext Object List of extensions used by the formatter file types.
ext.source string "pot" The file extension of the template data.
ext.main string "po" The file extension of the translations data.

GettextFormatter.encode(data) ⇒ string

Encode the translation data to the gettext format.

Kind: static method of GettextFormatter
Returns: string - The gettext formatted data.

Param Type Description
data Object.<string, string> A list with source and target for each translation as key and value.

GettextFormatter.decode(data) ⇒ Object.<string, string>

Decode the translation data in the gettext format.

Kind: static method of GettextFormatter
Returns: Object.<string, string> - An object with source and target translations as key and value.

Param Type Description
data string The gettext encoded translation data.

JsonFormatter

Class used to encode and decode JSON data.

Kind: global class

JsonFormatter.ext

Kind: static property of JsonFormatter
Properties

Name Type Default Description
ext Object List of extensions used by the formatter file types.
ext.source string "json" The file extension of the template data.
ext.main string "json" The file extension of the translations data.

JsonFormatter.encode(data) ⇒ string

Encode the translation data to the JSON format.

Kind: static method of JsonFormatter
Returns: string - The JSON formatted data.

Param Type Description
data Object.<string, string> A list with source and target for each translation as key and value.

JsonFormatter.decode(data) ⇒ Object.<string, string>

Decode the translation data in the JSON format.

Kind: static method of JsonFormatter
Returns: Object.<string, string> - An object with source and target translations as key and value.

Param Type Description
data string The JSON encoded translation data.