README
locize
The locize script enables you to directly connect content from your website / application with your content on your localization project on locize.
Getting started
Source can be loaded via npm, downloaded from this repo or loaded from the npm CDN unpkg.com/locize.
Adding the script or importing it is enough.
Hint: This module runs only in browser.
Using
with a bundler
Just init like:
import 'locize';
by including the script
<script src="https://unpkg.com/locize/locize.min.js" />
with i18next
import { locizePlugin } from 'locize';
i18next.use(locizePlugin)
with locizify
This plugin is already included in locizify >= v4.1.0
with other as module
import { addLocizeSavedHandler } from 'locize';
addLocizeSavedHandler((res) => {
res.updated.forEach((item) => {
const { lng, ns, key, data } = item;
// load the translations somewhere...
// and maybe rerender your UI
})
});
with other in vanilla javascript
<script src="https://unpkg.com/locize/locize.min.js" />
window.locizeSavedHandler = (res) => {
res.updated.forEach((item) => {
const { lng, ns, key, data } = item;
// load the translations somewhere...
// and maybe rerender your UI
})
};