packages/react-live/src/createReactI18nLive.js
// Overwrites `tinyI18n.i18n` for inject some data.
Overwrites `tinyI18n.i18n` for inject some data.
Overwrites ` tinyI18n . i18n ` for inject some data .
function createWrappedI18n(i18n, { setting = defaultSetting } = {}) {
  return function wrappedI18n(key, ...args) {
    const argumentArray = [].slice.call(arguments)
    if (!setting.enabled) {
      return i18n.apply(this, argumentArray)
    }
    const rawTranslated = i18n.apply(this, argumentArray)
    const hideDataString = JSON.stringify([key, args])
    return wrapString(rawTranslated + RAW_DATA_SEP + encode(hideDataString), {
    })
  }
}
function createWrappedI18n ( i18n , { setting = defaultSetting } = { } ) { return function wrappedI18n ( key , ... args ) { const argumentArray = [ ] . slice . call ( arguments ) if ( ! setting . enabled ) { return i18n . apply ( this , argumentArray ) } const rawTranslated = i18n . apply ( this , argumentArray ) const hideDataString = JSON . stringify ( [ key , args ] ) return wrapString ( rawTranslated + RAW_DATA_SEP + encode ( hideDataString ) , { } ) } }
Overwrites `tinyI18n.i18n` for inject some data.
Overwrites ` tinyI18n . i18n ` for inject some data .