Pomo, a gettext(and family) implementation for JS

What?

Pomo is a library that allows you to handle PO and MO files in pretty much the same way that gettext (and family) allow you to.

It exposes a single Pomo object whose Pomo.getText() method behaves like sprintf(gettext("string %s"), "placeholder") would for other languages.

Instead of returning a string upon finding the translation, Pomo gives you an object containing all the possible information about that translation; this object in turn can be casted to a string for ease of use, or can be used straight as a string by

While it DOES aim to be feature-complete, right now it is not. Below is a table showing exactly what is and what's not covered.

Feature PO files MO files Additional details
Read from literal string Yes No
Detailed feature Status
single line msgid/msgstr reading Yes
multiline msgid/msgstr reading Yes
context reading Yes
plurals Yes
Read from URL Yes No
Detailed feature Status
Everything you can do with a literal string Yes
Read from <link> Yes
Read from <URL> Yes
Support matrix

How?

Like this: