Coder Social home page Coder Social logo

Comments (14)

kuckboy1994 avatar kuckboy1994 commented on July 26, 2024 4

我的场景是设置了国际化,实际的话我没用使用到。。
我把 config.ts 设置如下就好了

baseNavigator: false

默认会去读 localstorage 中的 umi-locale 字段。

from plugins.

gaollard avatar gaollard commented on July 26, 2024 2

没有人修复吗... 我也遇到了 umi 3.5.20

from plugins.

lhsaq2009 avatar lhsaq2009 commented on July 26, 2024 1

我的场景是设置了国际化,实际的话我没用使用到。。
我把 config.ts 设置如下就好了

baseNavigator: false

默认会去读 localstorage 中的 umi-locale 字段。

YES


baseNavigator
Default: true
开启浏览器语言检测。

默认情况下,当前语言环境的识别按照:localStorage 中 umi_locale 值 > 浏览器检测 > default 设置的默认语言 > 中文

from plugins.

sorrycc avatar sorrycc commented on July 26, 2024

给下复现。

from plugins.

RomaYang avatar RomaYang commented on July 26, 2024

image
image
配置完,启动项目,就会这样

from plugins.

RomaYang avatar RomaYang commented on July 26, 2024

给下复现。

@sorrycc 麻烦看下,谢谢

from plugins.

ycjcl868 avatar ycjcl868 commented on July 26, 2024

复现 demo 可以发我下吗?

from plugins.

RomaYang avatar RomaYang commented on July 26, 2024

复现 demo 可以发我下吗?

已发你的邮箱,麻烦了
@ycjcl868

from plugins.

ycjcl868 avatar ycjcl868 commented on July 26, 2024

复现 demo 可以发我下吗?

已发你的邮箱,麻烦了
@ycjcl868

看了下 demo,开启国际化是需要有 locales 目录的,加一个 locales 就好了

image

from plugins.

RomaYang avatar RomaYang commented on July 26, 2024

from plugins.

ycjcl868 avatar ycjcl868 commented on July 26, 2024

https://umijs.org/zh-CN/plugins/plugin-locale

from plugins.

LeoWang1991 avatar LeoWang1991 commented on July 26, 2024

@ycjcl868 在src下面加了locales 还是会有这个问题,版本是 "umi": "^3.2.8",
.umirc.ts如下

import { defineConfig } from 'umi';
import routes from './routes'

export default defineConfig({
  // ssr: {},
  layout: {
    name: 'Admin1',  
    logo: null,
    siderWidth: 220,        
  },
  locale: {
    default: 'zh-CN',
    antd: false,
    title: false,
    baseNavigator: true,
    baseSeparator: '-',
  },
  nodeModulesTransform: {
    type: 'none',
  },
  routes  
});

image
参考 https://umijs.org/zh-CN/plugins/plugin-locale 配置的。

麻烦有空看下 感谢

from plugins.

ycjcl868 avatar ycjcl868 commented on July 26, 2024

看下

from plugins.

WLyKan avatar WLyKan commented on July 26, 2024

我的场景是设置了国际化,实际的话我没用使用到。。
我把 config.ts 设置如下就好了

baseNavigator: false

默认会去读 localstorage 中的 umi-locale 字段。

我也是这么个情况,刚用yarn create umi初始化了一个项目,一运行就报错,设置为false能解决

from plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.