i18n-tag

Simple i18n tagged template strings


Keywords
i18n, internationalization, translation, template strings, tagged template strings
License
MIT
Install
npm install i18n-tag@0.1.1

Documentation

i18n tag

Simple i18n tagged template strings. Inspired by Jack Hsu's blog post.

Installation

npm install --save i18n-tag

Usage

i18n.js

import { createI18n } from 'i18n-tag';

const vocabulary_ru = {
  '{0} parrots': '{0} попугаев'
};

export default createI18n(vocabulary_ru);

index.js

import i18n from './i18n';

const n = 38;

console.log(i18n`${n} parrots`);