How to use fusion-plugin-i18n - 1 common examples

To help you get started, we’ve selected a few fusion-plugin-i18n examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fusionjs / fusionjs / fusion-plugin-rpc / src / browser.js View on Github external
const pluginFactory: () => RPCPluginType = () =>
  createPlugin({
    deps: {
      fetch: FetchToken,
      emitter: UniversalEventsToken,
      i18n: I18nToken.optional,
      rpcConfig: RPCHandlersConfigToken.optional,
    },
    provides: deps => {
      const {fetch = window.fetch, emitter, rpcConfig, i18n} = deps;

      return {
        from: ctx => {
          const locale = (i18n && i18n.from(ctx).locale) || '';
          const localeCode = typeof locale === 'string' ? locale : locale.code;
          return new RPC({
            fetch,
            emitter,
            rpcConfig,
            localeCode,
          });
        },

fusion-plugin-i18n

Adds I18n (Internationalization) support to a FusionJS app

MIT
Latest version published 1 year ago

Package Health Score

60 / 100
Full package analysis

Popular fusion-plugin-i18n functions

Similar packages