Migrating from the old InContext editor
The InContext Editor feature has been fundamentally changed. Now the InContext Editor is part of the locize UI and not a separate web component anymore.
tl;dr: Make sure to load this script and paste your website url in the in-built InContext view of the locize UI.
Migration should be straight forward...
import { locizePlugin } from 'locize';
i18next.use(locizePlugin)
// Using react-i18next you might want to bind the editorSaved event to trigger a rerender:
i18next.init({
// ...
react: {
bindI18n: 'languageChanged editorSaved'
}
})
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
})
});
<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
})
};
Last modified 11mo ago