locize
Version:
This package adds the incontext editor to your i18next setup.
19 lines (13 loc) • 411 B
JavaScript
import { api } from './postMessage.js'
function handler (payload, e) {
// console.warn('here', payload, e.source, e.origin)
// set source
api.source = e.source
api.origin = e.origin
// no longer supported
// if (!payload || payload.version !== 'v2') api.legacy = true
// done
api.sendLocizeIsEnabled(payload)
api.requestInitialize(api.config)
}
api.addHandler('isLocizeEnabled', handler)