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

国际化 Form label 的冒号样式问题 #1877

Closed
afc163 opened this issue May 27, 2016 · 11 comments · Fixed by #1943
Closed

国际化 Form label 的冒号样式问题 #1877

afc163 opened this issue May 27, 2016 · 11 comments · Fixed by #1943
Assignees

Comments

@afc163
Copy link
Member

afc163 commented May 27, 2016

来自 @青栀

做国际化时我们需要将中文的冒号翻译成英文冒号,由于英文冒号不如种冒号来的长。。于是。。

建议

  1. 去掉所有的冒号,label 和 input 之间留固定一段空白间距
  2. 英文下特殊处理,增加空白间距

个人建议选择 1,比较简单

@afc163
Copy link
Member Author

afc163 commented May 27, 2016

解决方案

  1. 统一保留

  2. 表单组件使用时,不应需要手动写冒号。

    <FormItem label="姓名:" />   // 原来是这样

    改为 =>

    <FormItem label="姓名" />   // 应该是这样
  3. 国际化时,不需要对冒号做翻译处理,只针对具体文案翻译。

  4. 统一由 FormItem 组件来加这个冒号和相应的间距。建议用样式的 :after 伪类来加。

  5. 自带冒号改为 英文冒号

  6. 针对原来已经手动写了中文冒号的情况,组件检查并做兼容化处理。(把最后的冒号 replace 掉)

@superRaytin
Copy link
Contributor

这样的话,如果用户不想要这个冒号,是否有办法禁用

@afc163
Copy link
Member Author

afc163 commented May 27, 2016

再补个 colon={false}

@benjycui
Copy link
Contributor

或者干脆纳进设计规范。。就像 Button 两个中文中的空格。

@afc163
Copy link
Member Author

afc163 commented May 27, 2016

确实是设计规范,我们自己是不会修改这个的。

@afc163 afc163 self-assigned this Jun 1, 2016
@afc163
Copy link
Member Author

afc163 commented Jun 2, 2016

bf1cf10#diff-a854f46c9dd5d48ffcb8a5aeecae42c5R80

这里原来做过英文冒号的处理,只需要设置页面 <html lang="en"> 就行。

@afc163
Copy link
Member Author

afc163 commented Jun 2, 2016

不过还是需要写 号,略麻烦,还是按上面说的修改一遍。

@vimplus
Copy link

vimplus commented Sep 9, 2016

中文页面本来有冒号,升级了一下没有冒号是什么情况?

@afc163
Copy link
Member Author

afc163 commented Sep 9, 2016

@Lxyour 给代码。

@vimplus
Copy link

vimplus commented Sep 13, 2016

@afc163 解决了,谢谢

@lock
Copy link

lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants