STB SDK localization
This localization module is an instance of Emitter module. Contains localization messages data used by other modules and provides methods to requests these messages.
Installation
npm install cjs-gettext
Usage
Example data
format:
Add the constructor to the scope and create an instance with some data:
var Gettext = gettext = data;
Then it's possible to make direct calls to make simple replacement:
console;
Fetch a particular translation of the textual message:
console;
Native language translation of a textual message whose grammatical form depends on a number:
console;
Development mode
There is a global var
DEVELOP
which activates additional consistency checks and protection logic not available in release mode.
Contribution
If you have any problems or suggestions please open an issue according to the contribution rules.
License
cjs-gettext
is released under the MIT License.