0.8.1 • Published 6 years ago
c-3po v0.8.1
c-3po
Modern javascript i18n localization library based on es6 tagged templates and the good old GNU gettext
Key features
- Uses es6 template literals for string formatting (no need for sprintf).
- Contexts support
- Can precompile translations on a build step.
- Plurals support ngettext.
- Can be integrated in any build tool that works with babel.
- Has options for both efficient development and production setups.
- Has a builtin validation for translated strings format.
- Can use any default locale in sources (not only English).
- Handles React (jsx) translations.
Usage example
import { t, ngettext, msgid } from 'c-3po'
// formatted strings
const name = 'Mike';
const helloMike = t`Hello ${name}`;
// plurals (works for en locale out of the box)
const n = 5;
const msg = ngettext(msgid`${ n } task left`, `${ n } tasks left`, n)
Installation
npm install --save c-3po
npm install --save-dev babel-plugin-c-3po
c-3po babel plugin - https://github.com/c-3po-org/babel-plugin-c-3po
Usage from CDN
https://unpkg.com/c-3po/dist/c3po.min.js
This project is designed to work in pair with babel-plugin-c-3po But you can also play with it without transpile. Here is the doc about how to use c-3po without babel transpilation.
Useful links
Tutorials
Slides from talks
Talks
Quick view on Jsfiddle playground - https://jsfiddle.net/AlexMost/9wuafbL5/11/
0.8.1
6 years ago
0.8.0
6 years ago
0.7.3
6 years ago
0.7.2
6 years ago
0.7.1
6 years ago
0.7.0
6 years ago
0.6.1
7 years ago
0.6.0
7 years ago
0.5.8
7 years ago
0.5.7
7 years ago
0.5.6
7 years ago
0.5.5
7 years ago
0.5.4
7 years ago
0.5.4-0
7 years ago
0.5.3
7 years ago
0.5.2
7 years ago
0.5.1
7 years ago
0.5.0
7 years ago
0.4.6
7 years ago
0.4.5
7 years ago
0.4.4
7 years ago
0.4.2
7 years ago
0.4.1
7 years ago
0.4.0
7 years ago
0.3.0
7 years ago
0.2.3
7 years ago
0.2.2
7 years ago
0.2.1
7 years ago
0.2.0
7 years ago
0.1.1
7 years ago
0.1.0
7 years ago
0.0.6
7 years ago
0.0.5
7 years ago
0.0.4
7 years ago
0.0.3
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago
1.0.0
7 years ago