Skip to main content

UNKNOWN

Project description

https://travis-ci.org/ojii/gettext.js.svg?branch=master Documentation Status

gettext.js

GNU gettext in Javascript. Compile your mo files to JSON/JS and then use them directly from Javascript in your browser.

Demo: https://cdn.rawgit.com/ojii/gettext.js/master/demo/index.html

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

Usage

Compiling

Usage:
    gettextjs [-i] [-v] [--js] <locale-path> [<out-dir>]

Options:
    -h --help       Show this screen.
    --version       Show version.
    -i --indent     Indent JSON file.
    -v --verbose    Print stuff while doing work.
    --js            Compile to JS instead of JSON.

Javascript

Async from JSON
Gettext.load('/base/url/to/locale', 'en', 'messages').then(function(gettext){
    var msgstr = gettext.gettext('msgid');
});
Sync from JS
var gettext = new Gettext(EN_MESSAGES);
var msgstr = gettext.gettext('msgid');

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gettextjs-1.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

gettextjs-1.0-py2-none-any.whl (3.4 kB view details)

Uploaded Python 2

File details

Details for the file gettextjs-1.0.tar.gz.

File metadata

  • Download URL: gettextjs-1.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gettextjs-1.0.tar.gz
Algorithm Hash digest
SHA256 9f3d3defbdf0371b7c6d1a090d337ae92451ff788b624d199c87b0b261ba3a6c
MD5 9e0c5c6e486c47b8c4623ac705a779b2
BLAKE2b-256 421be1f130b188bdbe259c70da7c42774fbb2c2d3b59985c009d2dad7dede09b

See more details on using hashes here.

File details

Details for the file gettextjs-1.0-py2-none-any.whl.

File metadata

File hashes

Hashes for gettextjs-1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 6316d9022d7e4efcfb046f7c2e36777a1e34395983d65696f2f95b536dd61f58
MD5 70850ccde38d666fadd0fcc7a012a901
BLAKE2b-256 647525c0106737e0658672982408dec797bb4b1e423b85e21b7af10163e38c9e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page