GitXplorerGitXplorer
d

gettext-js

public
9 stars
1 forks
0 issues

Commits

List of commits on branch master.
Unverified
8d17556842a3ae9c3d35c5edc9aed625548d1f7e

Better plural function extraction.

committed 14 years ago
Unverified
de67fbaf056f1f073e0d3a832a1643fcfc58f7b2

Adding declaration for undeclared variable

committed 14 years ago
Unverified
02bb9f90711b17ab5a479587f8f1dd98953728fb

Original gettext behaviour for missing translations

committed 14 years ago
Unverified
094dbcb03874359931d090a19c74c140236820d2

Removing `valueOf()` from `LazyTranslation`

committed 14 years ago
Unverified
98edb953fa2db5661638acb96154dd01d202c8ea

Removing copy-and-paste leftovers.

committed 14 years ago
Unverified
f8f3de98cff990825380f6375b69917f977b1c87

Removing `Catalog` and `CatalogLibrary`:

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).