How to use the umi-plugin-react/locale.setLocale function in umi-plugin-react

To help you get started, we’ve selected a few umi-plugin-react 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 crawlab-team / artipub / src / layouts / BasicLayout.tsx View on Github external
});
    }
  }, []);

  /**
   * init variables
   */
  const handleMenuCollapse = (payload: boolean): void =>
    dispatch &&
    dispatch({
      type: 'global/changeLayoutCollapsed',
      payload,
    });

  // set locale default as zh-CN
  setLocale('zh-CN');

  return (
     {
        if (menuItemProps.isUrl) {
          return defaultDom;
        }
        return {defaultDom};
      }}
      breadcrumbRender={(routers = []) => [
        {
          path: '/',
          breadcrumbName: formatMessage({
            id: 'menu.home',
github Jkanon / webmagician-ui / src / components / SelectLang / index.tsx View on Github external
  const changeLang = ({ key }: ClickParam): void => setLocale(key, false);
  const locales = ['zh-CN', 'zh-TW', 'en-US', 'ja-JP'];
github XiaoMi / thain / thain-fe / src / components / SelectLang / index.tsx View on Github external
  const changeLang = ({ key }: ClickParam): void => setLocale(key);
  const locales = ['zh-CN', 'en-US'];
github tangtanglove / fullstack-backend / resources / frontend / src / components / SelectLang / index.tsx View on Github external
  const changeLang = ({ key }: ClickParam) => setLocale(key, false);
  const locales = ['zh-CN', 'zh-TW', 'en-US', 'pt-BR'];
github umijs / umi / packages / umi-ui / client / src / layouts / Layout.tsx View on Github external
setLocale = (locale: ILocale, reload = false) => {
    if (Object.keys(LOCALES).indexOf(locale as string) > -1) {
      setLocale(locale, reload);
    }
  };
github umijs / umi-plugin-block-dev / layouts / ant-design-pro / SelectLang / index.jsx View on Github external
  const changeLang = ({ key }) => setLocale(key);
  const locales = ['zh-CN', 'zh-TW', 'en-US', 'pt-BR'];
github tangtanglove / fullstack-frontend / src / components / SelectLang / index.tsx View on Github external
  const changeLang = ({ key }: ClickParam): void => setLocale(key, false);
  const locales = ['zh-CN', 'zh-TW', 'en-US', 'pt-BR'];
github ant-design / ant-design-pro-layout / example / src / components / SelectLang / index.tsx View on Github external
  const changeLang = ({ key }: ClickParam): void => setLocale(key, false);
  const locales = ['zh-CN', 'zh-TW', 'en-US', 'pt-BR'];

umi-plugin-react

React plugin set for umi.

MIT
Latest version published 2 years ago

Package Health Score

48 / 100
Full package analysis

Similar packages