From 2992bc2faebe7b093e49cb6f1c273297ea278210 Mon Sep 17 00:00:00 2001 From: simontigers <47096077+simontigers@users.noreply.github.com> Date: Wed, 3 Jan 2024 12:29:49 +0800 Subject: [PATCH] fix(api): common_i18n wide (#350) --- cmdb-api/api/lib/common_setting/department.py | 2 ++ .../api/lib/common_setting/resp_format.py | 4 +++- .../translations/zh/LC_MESSAGES/messages.mo | Bin 16386 -> 16425 bytes .../translations/zh/LC_MESSAGES/messages.po | 6 +++++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmdb-api/api/lib/common_setting/department.py b/cmdb-api/api/lib/common_setting/department.py index f068b53..d63d43b 100644 --- a/cmdb-api/api/lib/common_setting/department.py +++ b/cmdb-api/api/lib/common_setting/department.py @@ -101,6 +101,7 @@ class DepartmentTree(object): employees = self.get_employees_by_d_id(department_id) top_d['employees'] = employees + top_d['department_name'] = ErrFormat.company_wide if len(sub_deps) == 0: top_d[sub_departments_column_name] = [] d_list.append(top_d) @@ -313,6 +314,7 @@ class DepartmentCRUD(object): tree_list = [] for top_d in top_deps: + top_d['department_name'] = ErrFormat.company_wide tree = Tree() identifier_root = top_d['department_id'] tree.create_node( diff --git a/cmdb-api/api/lib/common_setting/resp_format.py b/cmdb-api/api/lib/common_setting/resp_format.py index 12973ab..676e17b 100644 --- a/cmdb-api/api/lib/common_setting/resp_format.py +++ b/cmdb-api/api/lib/common_setting/resp_format.py @@ -66,7 +66,7 @@ class ErrFormat(CommonErrFormat): notice_platform_existed = _l("Notice platform {} existed") # {} 已存在 notice_not_existed = _l("Notice {} not existed") # {} 配置项不存在 notice_please_config_messenger_first = _l("Notice please config messenger first") # 请先配置messenger URL - notice_bind_err_with_empty_mobile = _l("Notice bind err with empty mobile") # 绑定错误,手机号为空 + notice_bind_err_with_empty_mobile = _l("Notice bind err with empty mobile") # 绑定错误,手机号为空 notice_bind_failed = _l("Notice bind failed: {}") # 绑定失败: {} notice_bind_success = _l("Notice bind success") # 绑定成功 notice_remove_bind_success = _l("Notice remove bind success") # 解绑成功 @@ -78,3 +78,5 @@ class ErrFormat(CommonErrFormat): ldap_test_unknown_error = _l("LDAP test unknown error: {}") # LDAP测试未知错误: {} common_data_not_support_auth_type = _l("Common data not support auth type: {}") # 通用数据不支持auth类型: {} ldap_test_username_required = _l("LDAP test username required") # LDAP测试用户名必填 + + company_wide = _l("Company wide") # 全公司 diff --git a/cmdb-api/api/translations/zh/LC_MESSAGES/messages.mo b/cmdb-api/api/translations/zh/LC_MESSAGES/messages.mo index a02d5eb49fa4e3204377eb0864e2041f8f3bc127..8620fafd5bd7abaccfcc6ff3767e122c9e60c697 100644 GIT binary patch delta 3265 zcmYM#dra0<9LMo53QY|Z@d3FBkD1~H@IgQXM4y~w>NHI)?=6Rx7X(vl*z#vhyya2@ zGF{q=nmAE6m}Xv@4b3?dYq~5`%0JX(|@Be>`BF(zfEp=96D*YW8kH=8Y{fLQp51+=)QD(82jT#?~ zy|Dy);08=F^Q?|WfPqsu1zT}2j_+*N6Dys&P#c{_EpQ#vFuY61bR0>4GIqdi7=xc- zAs)a!co(0-_-Hd9`&%K6ZVXI71yX{!ScBT&45|Y6Fae+J8p@D%OT7wU39jZXPPoNvL(^#!`PRfD05Z2M6g zUU1$-Z5YmA0s1iyXW&4rLZ(<#cj`}&c8LL<-ECCnZKw#NsG~}m<_x07r=bE~idv`! zDW27%DtR0g*e|ZHhseQ_P!-9-;W*i&F@i=l>XKYUUAhODg{iEj2PR@)T!yN^4piVr zP?zd^EW%sJqc(u_RoP+;URvEl$BJn2Xtdv;H_ARmp1CKZ>fv4b=MaWI0gpe-RCRnMzR$RG~IFjan#z@(jZO zvWJ!7aNLAr@f?o9B{L*XDfqG@& z5Y&4=5A`-IN4*_ukgu~F z1w796XFI(muCW@m@K)5qjc)uqcrEH^4!iM-sDiwTcLmAFSJ-AqZz;&q7)wuCJIF$ZL%*S@Qp%2nf)ay4Bx!C5R*4cxq zQWSYCtV`&iMz%(r=#^$|M0*`u?a27NgF3 zmK%S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3j_jHZVjnpMmV?A#n^5C5dlW`fID>49bz=-h6K*7?U=+?rP4psaEg6;Ki?(*>x7Ek_+fZv%ye6sl0E`w{iU`U_*xM}8GZ68dp2 zDnn&B2>0L+taJ5`T)i3f{z+6omr#MyfxmS1YX7G4*2*Ei0j>K(zl$6?Js~MM YAvw*Tn30*1)cVqtngOl72?@Uc0FKg7-v9sr diff --git a/cmdb-api/api/translations/zh/LC_MESSAGES/messages.po b/cmdb-api/api/translations/zh/LC_MESSAGES/messages.po index c27bf1a..1eeb467 100644 --- a/cmdb-api/api/translations/zh/LC_MESSAGES/messages.po +++ b/cmdb-api/api/translations/zh/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2023-12-26 09:41+0800\n" +"POT-Creation-Date: 2024-01-03 11:39+0800\n" "PO-Revision-Date: 2023-12-25 20:21+0800\n" "Last-Translator: FULL NAME \n" "Language: zh\n" @@ -688,6 +688,10 @@ msgstr "通用数据不支持auth类型: {}" msgid "LDAP test username required" msgstr "LDAP测试用户名必填" +#: api/lib/common_setting/resp_format.py:82 +msgid "Company wide" +msgstr "全公司" + #: api/lib/perm/acl/resp_format.py:9 msgid "login successful" msgstr "登录成功"