0.1.1 • Published 8 years ago

i18n-tag v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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