ttag

ttag

  • Docs
  • Blog
  • Github

›Recent Posts

Recent Posts

  • 1.4.2
  • 1.3.x release
  • Why there must be a msgid tag in ngettext?
  • Localization setup with babel-plugin-ttag and webpack (the hard way)

1.3.x release

September 17, 2018

Alexander Mostovenko

Alexander Mostovenko

1.3.x release comes with a couple important changes. All changes are not breaking, but here are a couple of things you should now before upgrade.

@babel 7

babel-plugin-ttag and babel-cli were updated to use the newest version of babel. There is some changes in how babel handles configs in the new version. You can look through this issue for the details. The details on how to upgrade to the new babel version is here.

_ is now a default alias for the gettext func

As it is a common scenario to use global _ function for your translation workflow, we decided to add default alias for the gettext function.

Override default extract/update behavior for the ttag-cli

There were a couple of feature requests (#39, #46) to have an ability to extend babel-plugin-ttag config with CLI arguments. So, now ttag-cli update/check/extract/resolve supports 2 new CLI options: discover, numberedExpressions.

More about babel-plugin-ttag settings here

Usage Example:

For instance, previously, your translation workflow was relying on the global _ function and you were using xgettext to extract translations. The new ttag-cli version will be able to recognize global _ function by providing discover option to the update cmd (without explicit import or require).

ttag update --discover=_ my.po src/
Recent Posts
  • @babel 7
  • _ is now a default alias for the gettext func
  • Override default extract/update behavior for the ttag-cli
ttag
Docs
Quick Startttag APIbabel-plugin-ttag API
Community
User ShowcaseStack OverflowTwitter
More
BlogGitHubStar
Copyright © 2024 ttag