ojii / gettext.js

gettext in javascript for the browser, and a mo file compiler.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

gettext in javascript for the browser, and a mo file compiler.

License:Other


Languages

Language:JavaScript 100.0%