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.
npm install cjs-gettext
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:
Fetch a particular translation of the textual message:
Native language translation of a textual message whose grammatical form depends on a number:
There is a global var
DEVELOPwhich activates additional consistency checks and protection logic not available in release mode.
If you have any problems or suggestions please open an issue according to the contribution rules.
cjs-gettext is released under the MIT License.