GitXplorerGitXplorer
d

gettext-js

public
9 stars
1 forks
0 issues

Commits

List of commits on branch master.
Unverified
49207c2046fcf5a5a580ac4b9a0b4fd4cfae0c0c

moving source for refactoring

ddavidaurelio committed 14 years ago
Unverified
32128bb36a518c62b01160853bb248a69c892fab

lang parameters, documentation

committed 14 years ago
Unverified
469069e55816706a90418be20663ac7b25369a4d

Adding callback functions for catalog load.

committed 14 years ago
Unverified
1abadfd593480d4670e582cfe8d59e9f771393d9

Casting `n` arg to number in plural functions.

committed 14 years ago
Unverified
63770a41af400c231c7b7dd103cd3009906c22c2

Removing reference to prototype from constructor.

committed 14 years ago
Unverified
28283fe8caceb759a19b44a1547e26b2c3af12ad

Working on inline docs

committed 14 years ago

README

The README file for this repository.

gettext-js

About

gettext-js is an implementation of the gettext API in JavaScript, with adaptions to the characteristics of JavaScript. These adaptions arise from the asynchronous characteristics of the language, and the fact that it is used in non latency-free server/client-environments.

Status

Development has just started, and the code is far from beeing complete. The existing code only covers the parsing of PO files, and their serialization to JSON format.

Adaptions

Since JavaScript programs usually make use of asynchronous programming, gettext-js does not support setting a global state of the gettext module.

When binding a textdomain, an object with a defined state is returned, that may listen to language change events occurring higher in the hierarchy, but never changes the domain it has been bound to initially.

For browser-based JavaScript, gettext-js offers the possibility to execute a callback upon catalog/domain load for code that depends on it.

Other adaptions will include lazy evaluation and the possibility to translate DOM nodes (elements and text).