@ied/onesky
v0.0.13
Published
Import/export translations from/to **OneSky** and use them to translate text directly in your app. No dependency, it runs at frontend and backend.
Downloads
20
Readme
onesky
Import/export translations from/to OneSky and use them to translate text directly in your app. No dependency, it runs at frontend and backend.
How to ?
Use translation algorithm
import OneSky from '@ied/onesky'
import translations from './translations.json'
const i18n = new OneSky(translations, 'fr')
// translate "completed" to french feminine plural
i18n.translate('completed', 'fp')
// translate with variables
i18n.translate('hi ${firstName} ${lastName}', null, {
firstName: Bruce,
lastName: Wayne
})
Convert
You can see an overview of the format in this issue or browsing project files.
npm i -g @ied/onesky
Import
en.json
, fr.json
, de.json
, da.json
, es.json
, fr_CA.json
→ translations.json
onesky import
Export
translations.json
→ en.json
, fr.json
, de.json
, da.json
, es.json
, fr_CA.json
onesky export