i18n Tagged Template Literals
Overview
This template literal tag adds support for i18n and l10n (translation and internationalization) to your JavaScript project. It provides the following benefits:
- Very small footprint
- Powerful ES2015 standard template literal syntax
- Internationalization based on ECMA-402 standard Intl browser API
- JSON Schema powered translations
- Tools that can be integrated into your build pipeline and IDE
Features
- Translate and internationalize your JavaScript project
- Translate your JavaScript library at buildtime
- Generate a schema of all i18n tagged template literals in your project for easy JSON based translations
Compatibility
This library is using the ECMAScript Internationalization API. ES Internationalization API is implemented in all modern Browsers. For node.js projects you can use Andy Earnshaw's excellent Intl.js polyfill:
Examples
Installation
$ npm install es2015-i18n-tag --save
Usage
Tools
Build time translation
- babel-plugin-i18n-tag-translate: Translate your template literals at build time or add filename groups
JSON Schema
- i18n-tag-schema: JSON Schema based translation validation and tools
- vscode-18n-tag-schema: Visual Studio Code Extension for JSON Schema based translation validation and tools
Credits
Thanks to Jack Hsu for his initial draft of an i18n template literal.
License
Copyright (c) 2016 Steffen Kolmer
This software is licensed under the MIT license. See the LICENSE
file
accompanying this software for terms of use.