This project was formely named c-3po and later on renamed to ttag. Some of the talks, presentations, and documentation may still reference it by the old name. All new features will be applied to ttag package, the old c-3po packages will be supported only with bugfixes. Follow this simple migration guide

Modern javascript i18n localization library based on ES6 tagged templates and the good old GNU gettext

Key features

Live example


The whole solution consists of 2 parts:

  1. ttag library -
  2. ttag babel plugin -

How it looks like in the code:

Here is a usage of some ttag functions:

import { t, nt, ngettext, msgid } from 'ttag'

// simple string literals
const hello = t`Hello ttag`;

// formatted strings
const name = 'Mike';
const helloMike = t`Hello ${name}`;

// plurals (works for default locale out of the box)
const n = 5;
const msg = ngettext(msgid`${ n } task left`, `${ n } tasks left`, n)

The ttag library aims to provide the most natural and reliable way to translate strings in JavaScript sources. It provides some helper functions (tags) for making JavaScript templates as translatable with all their shiny features like string interpolation, multiline etc.


Slides from talks


results matching ""

    No results matching ""