Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

With Dothraki-JS you can start translating your app.

Getting started

$ npm install https://github.com/anderson-cubo/dothraki-js

Creating dictionary

import { settings } from 'dothraki-js'

const PT_BR_dictionary = {
  'Hi': 'Olá',
  'Welcome', 'Bem-Vindo'
}

settings.setDictionary('PT_BR', PT_BR_dictionary)

Using Dictionary

import { settings } from 'dothraki-js'

settings.set('language', 'PT_BR')

Getting words that are not being translated

import { settings } from 'dothraki-js'

settings.getDictionaryWithoutTranslation()

Disabling Warnings

import { settings } from 'dothraki-js'

settings.set('_ENABLE_WARNINGS', false)

Translating words

import dothraki from 'dothraki-js'

console.log(dothraki`Hi`)

Setting params inside dictionary

import { settings } from 'dothraki-js'

const PT_BR_dictionary = {
  'Welcome, {{0}}': 'Bem-Vindo, {{0}}'
}

settings.setDictionary('PT_BR', PT_BR_dictionary)

Using params

import dothraki from 'dothraki-js'

const user = 'John'

dothraki`Welcome, ${user}`

Using JSX in Params

import dothraki from 'dothraki-js'

const user = 'John'

dothraki`Welcome, ${<span>{user}</span>}`

About

Javascript translation built for REACT

Resources

Releases

No releases published

Packages

No packages published