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

fix key for Chinese #166

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

fix key for Chinese #166

wants to merge 2 commits into from

Conversation

hongdeyuan
Copy link

@hongdeyuan hongdeyuan commented Aug 9, 2021

Signed-off-by: dehong [email protected]
📝 变更记录 📝

  • 替换 src/util/constant.js 的 DETECT_REGEXP,以此提供 getgetHtml 可以输入 中文 key

  • ([\w\.-]+) -> ([\s\S]+?)

  • 这样改了之后的好处: 可以解除开发人员的对key取名的忧虑,可以直接使用defaultMessage的内容作为 get的key,程序员在开发的时候,可以直接把需要翻译的内容当成key,极大缩短了开发人员的工作量和思考量;并提取的zhCN.json是以中文为key的上传到翻译平台 ,翻译人员可以直接看key的内容,即可翻译需要的语言内容
    -- 如:intl.get('我的收藏').d('我的收藏') ,在react-intl-universal-extract 提取的时候,可以使用中文key

    zhCN.json

    {
    ‘我的收藏':‘我的收藏'’
    }

Signed-off-by: dehong <[email protected]>
@CLAassistant
Copy link

CLAassistant commented Aug 9, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Successfully merging this pull request may close these issues.

2 participants