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

[FEATURE] 国际化-文本翻译补充 #1332

Closed
ZhuoZhuoCrayon opened this issue Dec 11, 2022 · 2 comments
Closed

[FEATURE] 国际化-文本翻译补充 #1332

ZhuoZhuoCrayon opened this issue Dec 11, 2022 · 2 comments

Comments

@ZhuoZhuoCrayon
Copy link
Member

你想要什么功能

为什么需要

建议如何实现

@ZhuoZhuoCrayon ZhuoZhuoCrayon changed the title [FEATURE] 文本翻译补充 [FEATURE] 国际化-文本翻译补充 Dec 11, 2022
@CohleRustW
Copy link
Collaborator

CohleRustW commented Jan 10, 2023

方案:

  1. 补充标记脚本,用于遍历整个项目目录中的所有文件,并且标记国际化文本
  2. 补充翻译步骤

补充标记脚本中需要根据项目特性适配

需要跳过标记的内容有

尽量缩小范围,标记跟前端交互的文本

  1. 所有相关路径关键词文件: ["tests", "test_", "_test", "migrations", "mock_data", "mock"]
  2. swagger相关文本说明
  3. 序列号器相关字段文本说明

特殊逻辑

  1. from django.utils.translation import ugettext_lazy as _from django.utils.translation import ugettext as _
    的选择中,如果出现其一,该文本就使用原有函数,如果没有默认使用from django.utils.translation import ugettext_lazy as _
  2. 模板类字符串长文本特殊处理
  3. format组装文本特殊处理
  4. 多行文本为同一语义时,不标记为多行国际化文本,特殊处理

CohleRustW added a commit to CohleRustW/bk-nodeman that referenced this issue Jan 11, 2023
@ZhuoZhuoCrayon
Copy link
Member Author

补充:

国际化翻译补充步骤

  1. 执行 django-admin makemessages -l en 更新 .po 文件
  2. 补充新增文案的翻译,不能全部机翻哦,之前每次做国际化翻译都是校准过的,增量的可以机翻,但话术要和存量的一致。举个例子,机器翻译作业平台,可能是 Job platform,但我们是翻成 Job
  3. 执行 django-admin compilemessages -l en 更新 .mo 文件

CohleRustW added a commit to CohleRustW/bk-nodeman that referenced this issue Jan 13, 2023
CohleRustW added a commit to CohleRustW/bk-nodeman that referenced this issue Jan 13, 2023
CohleRustW added a commit to CohleRustW/bk-nodeman that referenced this issue Jan 31, 2023
ZhuoZhuoCrayon added a commit to ZhuoZhuoCrayon/bk-nodeman that referenced this issue Feb 6, 2023
ZhuoZhuoCrayon added a commit to ZhuoZhuoCrayon/bk-nodeman that referenced this issue Feb 6, 2023
ZhuoZhuoCrayon added a commit to ZhuoZhuoCrayon/bk-nodeman that referenced this issue Feb 6, 2023
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

2 participants