@nitra/tf
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

@nitra/tf

usage with Vite (set import.meta.env.VITE_T to activate translation):

import tf from '@nitra/tf'

const tr = {
  'Привіт': 'Hello',
}

const t = tf.bind({ tr })

t`Привіт` // Hello

usage node (set process.env.VITE_T to activate translation):

import tf from '@nitra/tf'

const tr = {
  'Привіт': 'Hello',
}

const t = tf.bind({ tr })

t`Привіт` // Hello

usage webpack (set process.env.VITE_T to activate translation):

import tf from '@nitra/tf/webpack'

const tr = {
  'Привіт': 'Hello',
}

const t = tf.bind({ tr })

t`Привіт` // Hello

usage without environment variable:

import tf from '@nitra/tf/t'

const tr = {
  'Привіт': 'Hello',
}

const t = tf.bind({ tr, t: 1 })

t`Привіт` // Hello

Readme

Keywords

Package Sidebar

Install

npm i @nitra/tf

Weekly Downloads

115

Version

1.3.0

License

MIT

Unpacked Size

3.01 kB

Total Files

7

Last publish

Collaborators

  • vitaliytv