Skip to content

Commit b08e836

Browse files
Jacky97sJacky Tan
authored andcommitted
feat: add Simplified Chinese (zh-CN) translation and Chinese locale support
- Add messages_zh_CN.properties with full Simplified Chinese translations - Add zh-Hant, zh-TW, zh-Hans, zh-CN locale parsing to I18n
1 parent c53cf82 commit b08e836

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed

core/src/main/java/org/openapitools/openapidiff/core/output/I18n.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ public static String getMessage(String key, Object... args) {
3535

3636
public static Locale parseLocale(String lang) {
3737
switch (lang.toLowerCase().replace("_", "-")) {
38+
case "zh-hant":
39+
case "zh-tw":
40+
return Locale.TRADITIONAL_CHINESE;
41+
case "zh-hans":
42+
case "zh-cn":
43+
return Locale.SIMPLIFIED_CHINESE;
3844
case "en":
3945
default:
4046
return Locale.ENGLISH;
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# 章节标题
2+
whats.new=新增项目
3+
whats.deleted=删除项目
4+
whats.deprecated=弃用项目
5+
whats.changed=变更项目
6+
result=结果
7+
8+
# 页面标题
9+
api.change.log=API 变更日志
10+
11+
# 标签
12+
operation.id=操作 ID
13+
parameter=参数
14+
parameters=参数
15+
request=请求
16+
return.type=响应类型
17+
response=响应
18+
schema=结构描述
19+
media.types=媒体类型
20+
security.requirements=安全性需求
21+
description=描述
22+
23+
# 操作
24+
action.add=新增
25+
action.added=新增
26+
action.delete=删除
27+
action.deleted=已删除
28+
action.changed=变更
29+
action.deprecated=已弃用
30+
action.updated=已更新
31+
action.removed=移除
32+
33+
# 属性标签
34+
added.property=新增属性
35+
deleted.property=删除属性
36+
changed.property=变更属性
37+
changed.property.type=变更属性类型
38+
missing.property=缺少属性
39+
property=属性
40+
41+
# 内容类型
42+
new.content.type=新增内容类型
43+
deleted.content.type=删除内容类型
44+
changed.content.type=变更内容类型
45+
46+
# 主体
47+
new.body=新增主体:'%s'
48+
deleted.body=删除主体:'%s'
49+
changed.body=变更主体:'%s'
50+
51+
# 响应
52+
new.response=新增响应
53+
deleted.response=删除响应
54+
changed.response=变更响应
55+
new.response.code=新增响应:[%s]
56+
deleted.response.code=删除响应:[%s]
57+
changed.response.code=变更响应:[%s]
58+
59+
# 标头
60+
new.header=新增标头
61+
deleted.header=删除标头
62+
changed.header=变更标头
63+
64+
# 安全性
65+
new.security.requirement=新增安全性需求:
66+
deleted.security.requirement=删除安全性需求:
67+
changed.security.requirement=变更安全性需求:
68+
69+
# 结构描述
70+
backward.compatible=向后兼容
71+
broken.compatibility=兼容性中断
72+
schema.incompatible=不兼容
73+
new.required.properties=新增必要属性
74+
new.optional.properties=新增可选属性
75+
items=项目
76+
changed.items=变更项目
77+
enum=枚举
78+
enum.label=枚举
79+
one.of=其中之一
80+
81+
# 兼容性消息
82+
api.changes.backward.compatible=API 变更具向后兼容性
83+
api.changes.broke.compatibility=API 变更破坏了向后兼容性
84+
no.differences=无差异,规格相同
85+
86+
# Asciidoc 专用
87+
note.no.differences=NOTE: 无差异,规格相同
88+
note.backward.compatible=NOTE: API 变更具向后兼容性
89+
warning.broke.compatibility=WARNING: API 变更破坏了向后兼容性
90+
91+
# 其他
92+
in=
93+
to=
94+
change.into=变更为
95+
required=必要
96+
not.required=非必要
97+
notes=备注
98+
value.singular=
99+
value.plural=
100+
101+
# CLI
102+
cli.version.prefix=openapi-diff 版本:
103+
cli.parsing.failed=解析失败。原因:
104+
cli.unexpected.exception=发生非预期的异常。原因:
105+
cli.missing.arguments=缺少参数
106+
cli.invalid.log.level=无效的日志等级。预期:[TRACE, DEBUG, INFO, WARN, ERROR, OFF]。输入:%s
107+
cli.config.prop.unexpected.format=--config-prop 格式不正确:

0 commit comments

Comments
 (0)