How to use the umi-plugin-locale.getLocale function in umi-plugin-locale

To help you get started, we’ve selected a few umi-plugin-locale 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 umijs / umi / packages / umi-plugin-locale / examples / base / src / page / index.js View on Github external
export default () => {
  console.log(
    getLocale(),
    formatMessage(
      {
        id: 'test',
      },
      {
        name: 'antd',
      },
    ),
  );
  return (
    <div style="{{">
      <button style="{{"> {
          setLocale('en-US');
        }}</button></div>