i18n-tag

Simple i18n tagged template strings.

Downloads
10
Stars
4

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`);