Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

要怎么关闭国际化这个功能? #2431

Closed
walker213 opened this issue Sep 28, 2018 · 9 comments
Closed

要怎么关闭国际化这个功能? #2431

walker213 opened this issue Sep 28, 2018 · 9 comments

Comments

@walker213
Copy link

walker213 commented Sep 28, 2018

在 config/config.js 中做如下配置

plugins:[
   ...,
   locale: {
        enable: false,
        default: 'zh-CN', 
        baseNavigator: true, 
    },
    ....
]

这不是关闭了国际化这个功能吗,为啥还是会报 [React Intl] Missing message: "menu.商品管理" for locale: "zh-CN" 这个错,而且菜单前面多了个'menu.' ? 还是要在其他地方配置?

@chenshuai2144
Copy link
Collaborator

chenshuai2144 commented Sep 28, 2018

代码中也需要关闭,不是删除插件就可以了

你需要删除所有引用了 umi/local 的代码

@lany44
Copy link

lany44 commented Feb 27, 2019

这着实令人难过。。

@tianyaxue
Copy link

嗯,确实是看着比较烦能一键关闭就好了

@imwubai
Copy link

imwubai commented Apr 2, 2019

// defaultSettings.js 里
menu: {
  disableLocal: true, // 禁用多语言功能
}

@xiaohuoni
Copy link
Member

关注 #3775

@A-birdFlyHigner
Copy link

国际化真让人有点头秃。。

@daixianceng
Copy link

移除国际化,我试了把所有关于local的代码全删了,后来发现报错了,我经过2小时漫长的debug,终于解决了:

<pro-layout
    :title="title"
    :menus="menus"
    :collapsed="collapsed"
    :mediaQuery="query"
    :isMobile="isMobile"
    :handleMediaQuery="handleMediaQuery"
    :handleCollapse="handleCollapse"
    :logo="logoRender"
+   :i18nRender="key => key"
    v-bind="settings"
  >

增加i18nRender玩意,为什么?
因为这个属性的默认值是key => undefined
!!!

@Jungbey
Copy link

Jungbey commented Jul 6, 2021

我今天也碰到了这样的问题,然后就看到了这个issue,后面自己也摸索着解决了,分享一下
config/config.ts:

export default defineConfig({
  ...
  layout: {
    locale: false,
    ...
  },
  locale: {},
  ...
});

然后locale的文件夹也可以删除掉
貌似这样就不会在控制台报错和警告了

@Wster11
Copy link

Wster11 commented Jul 22, 2021

locale: {
default: 'zh-CN',
baseNavigator: false // 目前把这玩意关了 让他走默认语言了
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants