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

Picker and SearchBar do not pick up LocaleProvider context #2502

Closed
1 task done
jumpinjackie opened this issue Apr 30, 2018 · 3 comments
Closed
1 task done

Picker and SearchBar do not pick up LocaleProvider context #2502

jumpinjackie opened this issue Apr 30, 2018 · 3 comments
Assignees

Comments

@jumpinjackie
Copy link

jumpinjackie commented Apr 30, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.1.8

Environment

Windows 10, Chrome

Reproduction link

https://codepen.io/anon/pen/JvEqXM

Steps to reproduce

  1. Modify start script in package.json to use preact instead of react for DEMO_ENV in both start configurations
cross-env NODE_ENV=development concurrently \"cross-env DEMO_ENV=react bisheng start -c ./site/bisheng.desktop.config.js\" \"cross-env DEMO_ENV=react bisheng start -c ./site/bisheng.kitchen.config.js\"
  1. Open LocaleProvider demo
  2. Switch to English (hit 切换到英文 button)

What is expected?

All displayed components should be using english strings in en_US locale

What is actually happening?

The Picker and SearchBar components still use chinese strings


This does not happen on the demo site because it is using Preact (not React) and the components in question must have used some preact-specific context API. The Picker and SearchBar components are missing contextTypes to pull in the current locale from the parent LocaleProvider

static contextTypes = {
  antLocale: PropTypes.object,
};
@CJY0208
Copy link

CJY0208 commented May 9, 2018

+1 看起来其他的组件可能也会有这样的问题,数字键盘中的“确定”按钮文案表现也有问题

@doxiaodong
Copy link
Contributor

数字键盘, #2538

@doxiaodong
Copy link
Contributor

@KgTong , 关联 pr 已经合并,这个修复了么

@KgTong KgTong closed this as completed Jun 4, 2018
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

4 participants