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

1.3.1 • 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

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @nitra/tf

      Weekly Downloads

      59

      Version

      1.3.1

      License

      MIT

      Unpacked Size

      3.04 kB

      Total Files

      7

      Last publish

      Collaborators

      • vitaliytv