How to use the umi/locale.setLocale function in umi

To help you get started, we’ve selected a few umi 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 VKSRC / Github-Monitor / client / src / components / GlobalHeader / RightContent.js View on Github external
changLang = () => {
    const locale = getLocale();
    if (!locale || locale === 'zh-CN') {
      setLocale('en-US');
    } else {
      setLocale('zh-CN');
    }
  };
github umijs / umi-plugin-locale / examples / base / src / pages / index.js View on Github external
<button> {
        setLocale('en-US');
      }}&gt;en-US</button>
      <button> {</button>
github VKSRC / Github-Monitor / client / src / components / GlobalHeader / RightContent.js View on Github external
changLang = () => {
    const locale = getLocale();
    if (!locale || locale === 'zh-CN') {
      setLocale('en-US');
    } else {
      setLocale('zh-CN');
    }
  };