Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 867 Bytes

README.md

File metadata and controls

38 lines (24 loc) · 867 Bytes

Build Status

Documentation Status

gettext.js

gettext.js provides a GNU gettext like interface for use in browsers, a MO file to JS transpiler and a webpack loader for MO files.

Full Docs: http://gettextjs.readthedocs.org/

Usage

Webpack

import English from 'locales/en/LC_MESSAGES/messages.mo';

English.gettext('hello world');
English.ngettext('bug', 'bugs', 4);

Runtime

import {gettext as _, ngettext, set_catalog} from "gettextjs";

set_catalog(...);

_("hello world");
ngettext("bug", "bugs", 4);

Compile

gettextjs <input> <output> turns the input MO file int a JS file.