2.2.1 • Published 5 years ago
@autodisol/i18n v2.2.1
ads-npm-i18n
Server
const { setVocabulary } = require('@autodisol/i18n/server')
const { getVocabulary t, translate } = require('@autodisol/i18n')
setVocabulary('fr')
getVocabulary() // => { brand: 'Marque', model: 'Modèle' } (Pass it down to the client)
translate('brand') // => 'Marque'
t('brand') // => 'Marque'
Client
const { setVocabulary } = require('@autodisol/i18n/client')
const { t } = require('@autodisol/i18n')
setVocabulary({ brand: 'Marca' }) // (From the server)
t('brand') // => 'Marca'