Skip to content

Tangerine-Community/tangy-translate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

tangy-translate

A window.t function for translating strings. t('translate this string')

installation

Install into your project:

npm install tangy-translate

Import into your JS:

import `tangy-translate`

Provide a translation:

fetch('translation.json')
  .then(response => response.json())
  .then(json => {
    window.translation = json
  })

Provide translations to strings by attaching a window.translations object where the keys are the string to translate and the value is the translation.

Example:

{
  "foo": "foo",
  "bar": "bar"
}

About

Provides a `t` function for translating strings in JS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published