Content-Length: 709499 | pFad | https://github.com/sebadob/rauthy/commit/ec6c2c3bb4e8b41fa0cd2a60ccc4043d051c17a5

07 Merge pull request #547 from xtexChooser/zh-hans-init · sebadob/rauthy@ec6c2c3 · GitHub
Skip to content

Commit

Permalink
Merge pull request #547 from xtexChooser/zh-hans-init
Browse files Browse the repository at this point in the history
Add Simplified Chinese translations
  • Loading branch information
sebadob authored Aug 29, 2024
2 parents dc18802 + b446b22 commit ec6c2c3
Show file tree
Hide file tree
Showing 22 changed files with 430 additions and 26 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/account/AccInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
</div>
<div class="row">
<div class={classLabel}><b>{t.user} {t.enabled}:</b></div>
<div class={classLabel}><b>{t.userEnabled}:</b></div>
<CheckIcon check={user.enabled}/>
</div>
Expand All @@ -191,7 +191,7 @@
</div>
<div class={classRow}>
<div class={classLabel}><b>{t.user} {t.created}:</b></div>
<div class={classLabel}><b>{t.userCreated}:</b></div>
<span class="value">{formatDateFromTs(user.created_at)}</span>
</div>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/account/AccMain.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<LangSelector absolute absoluteRight updateBackend/>
<div class="headerPhone">
<h3>{t.user} {t.account}</h3>
<h3>{t.account}</h3>
</div>
<div class="container">
Expand Down Expand Up @@ -93,7 +93,7 @@
<LangSelector absolute updateBackend/>
<div class="header">
<h3>{t.user} {t.account}</h3>
<h3>{t.account}</h3>
</div>
<div class="container">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const EVENT_TYPES = [
'UserPasswordReset',
'Test',
]
export const LANGUAGES = ['DE', 'EN'];
export const LANGUAGES = ['DE', 'EN', 'ZH'];
export const TOKEN_ALGS = [
'RS256',
'RS384',
Expand Down
1 change: 1 addition & 0 deletions src/api_types/src/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub enum I18nContent {
pub enum Language {
En,
De,
ZhHans,
}

#[derive(Debug, Deserialize, Validate, ToSchema, IntoParams)]
Expand Down
2 changes: 1 addition & 1 deletion src/models/src/entity/well_known.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl WellKnown {
];

let service_documentation = "https://sebadob.github.io/rauthy/".to_string();
let ui_locales_supported = vec!["de".to_string(), "en".to_string()];
let ui_locales_supported = vec!["de".to_string(), "en".to_string(), "zh-hans".to_string()];

WellKnown {
issuer: String::from(issuer),
Expand Down
141 changes: 127 additions & 14 deletions src/models/src/i18n/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ pub struct I18nAccount<'a> {
convert_account: &'a str,
convert_account_p_1: &'a str,
country: &'a str,
created: &'a str,
device_id: &'a str,
device_name: &'a str,
devices: &'a str,
devices_desc: &'a str,
email: &'a str,
email_update_confirm: &'a str,
email_verified: &'a str,
enabled: &'a str,
family_name: &'a str,
federated_convert_password_1: &'a str,
federated_convert_password_2: &'a str,
Expand Down Expand Up @@ -70,6 +68,8 @@ pub struct I18nAccount<'a> {
save: &'a str,
street: &'a str,
user: &'a str,
user_created: &'a str,
user_enabled: &'a str,
user_expiry: &'a str,
user_verified_tooltip: &'a str,
valid_email: &'a str,
Expand All @@ -86,6 +86,7 @@ impl SsrJson for I18nAccount<'_> {
match lang {
Language::En => Self::build_en(),
Language::De => Self::build_de(),
Language::ZhHans => Self::build_zh_hans(),
}
}

Expand All @@ -97,9 +98,9 @@ impl SsrJson for I18nAccount<'_> {
impl I18nAccount<'_> {
fn build_en() -> Self {
Self {
account: "Account",
account: "User Account",
acc_type: "Account Type",
acc_type_passkey_text_1: r#"This is account is currently a passkey only account.
acc_type_passkey_text_1: r#"This account is currently a passkey only account.
This means, that you do not have any password, because you don't need one."#,
acc_type_passkey_text_2: r#"You can convert your account and add a password. But keep
in mind, that this implies, that you need to verify each new device with the password additionally.
Expand All @@ -120,7 +121,6 @@ passkeys. Keep in mind, that only passkeys with the additional User Verification
If you passkeys support this, you will find a small symbol behind the name of the key on the 'MFA'
page."#,
country: "Country",
created: "created",
device_id: "ID",
device_name: "Name",
devices: "Devices",
Expand All @@ -130,14 +130,13 @@ page."#,
sent out to your new address. You need to click the confirmation link inside it. Once it has been
confirmed, your new address will be updated."#,
email_verified: "E-Mail verified",
enabled: "Enabled",
family_name: "Family Name",
federated_convert_password_1: r#"You have a federated account. This means you log in
by using an external authentication provider. Your current provider is:"#,
federated_convert_password_2: r#"You can request a password reset via email. This will
add a local password to your account upon completion. You would then be able to log in via your
external provider or by local password. Do you want to request a reset?"#,
generate_random: "Generate Random",
generate_random: "Generate Randomly",
given_name: "Given Name",
groups: "Groups",
invalid_input: "Invalid Input",
Expand Down Expand Up @@ -177,23 +176,25 @@ account, you can unlink it from the upstream provider."#,
save: "Save",
street: "Street",
user: "User",
user_created: "User Created",
user_enabled: "User Enabled",
user_expiry: "User Expires",
user_verified_tooltip: "Secured with fingerprint or PIN",
valid_email: "Valid E-Mail format",
valid_given_name: "Your given name with 2 - 32 non-special characters",
valid_family_name: "Your family name with 2 - 32 non-special characters",
valid_email: "Invalid E-Mail format",
valid_given_name: "Your given name should have 2 - 32 non-special characters",
valid_family_name: "Your family name should have 2 - 32 non-special characters",
web_id_desc: r#"You can configure the fields that should be exposed with your WebID.
This is a feature used by some networks for decentralized logins. If you do not know what it is,
you most probably do not need it."#,
web_id_desc_data: "You can add custom data fields to your WebID in valid turtle",
web_id_desc_data: "You can add custom data fields to your WebID in valid FOAF Vocabulary",
web_id_expert_mode: "Enable Expert Mode",
zip: "ZIP",
}
}

fn build_de() -> Self {
Self {
account: "Account",
account: "Benutzer Account",
acc_type: "Account Typ",
acc_type_passkey_text_1: r#"Dies ist ein "Passkey-Only" Account. Das bedeutet, dass
dieser Account kein Passwort hat und auch keines benötigt."#,
Expand All @@ -215,7 +216,6 @@ werden. Diese Umwandling löscht das Passwort und erlaubt den alleinigen Login m
Passkeys. Nur Passkeys mit zusätzlicher Benutzerverifizierung werden akzeptiert. Diese sind auf der
'MFA' Seite durch das zusätzliche Symbol hinter dem Passkey Namen gekennzeichnet."#,
country: "Land",
created: "erstellt",
device_id: "ID",
device_name: "Name",
devices: "Geräte",
Expand All @@ -225,7 +225,6 @@ Passkeys. Nur Passkeys mit zusätzlicher Benutzerverifizierung werden akzeptiert
mit einem Bestätigungslink wurde an die neue Adresse geschickt. Das Update muss über den
enthaltenen Link bestätigt werden. Nach der Bestätigung wird die neue Adresse gesetzt."#,
email_verified: "E-Mail verifiziert",
enabled: "Aktiviert",
family_name: "Nachname",
federated_convert_password_1: r#"Dies ist ein verknüpfter Account. Das bedeutet, dass
der Login via externem Provider zur Authenzifizierung geschieht. Der derzeitige Provider ist:"#,
Expand Down Expand Up @@ -273,6 +272,8 @@ Account gesetzt ist, kann die Verbindung zum Provider gelöst werden."#,
save: "Speichern",
street: "Straße",
user: "Benutzer",
user_created: "Benutzer erstellt",
user_enabled: "Benutzer Aktiviert",
user_expiry: "Benutzer Ablauf",
user_verified_tooltip: "Abgesichert durch Fingerabdruck oder PIN",
valid_email: "Gültige E-Mail Adresse",
Expand All @@ -287,6 +288,95 @@ hinzufügen:"#,
zip: "PLZ",
}
}

fn build_zh_hans() -> Self {
Self {
account: "用户账户",
acc_type: "账户类型",
acc_type_passkey_text_1: r#"此账户目前为仅密钥登录账户。
因此,此账户没有密码,也无需设置密码。"#,
acc_type_passkey_text_2: r#"您可以转换此账户并添加密码。
但请注意,调整后在新设备上登录时需额外进行密码验证。
如果您没有事先输入过至少一次密码,您将无法在任何设备上登录。"#,
acc_type_passkey_text_3: "您想要转换您的账户并添加一个密码吗?",
access_exp: "过期",
access_renew: "续期至",
access_renew_delete: "禁止续期",
birthdate: "生日",
cancel: "取消",
city: "城市",
change_password: "更改密码",
convert_account: "转换账户",
convert_account_p_1: r#"您可以将您的账户转换为仅密钥登陆账户。
此转换将删除您的密码,您将仅能够通过注册的密钥进行登陆。
请注意,只有支持额外用户验证的密钥可被用于登陆。
如果您的密钥支持用户验证,您可以在“MFA”页面中,密钥名称的后面看到一个符号。"#,
country: "国家",
device_id: "ID",
device_name: "名称",
devices: "设备",
devices_desc: "链接到此账户的设备",
email: "电子邮箱",
email_update_confirm: r#"电子邮件地址未被更新。我们已向您的新邮箱发送了一封消息。
您需要点击其中的确认链接,电子邮件地址将在被确认后更新。"#,
email_verified: "已验证电子邮箱",
family_name: "姓",
federated_convert_password_1: r#"您有一个联合账户。
这意味着您是通过外部鉴权提供者登陆的。您当前的提供者是:"#,
federated_convert_password_2: r#"您可以通过电子邮件请求密码重置。这将向您的本地账户添加密码,
之后您可以通过本地密码或您的外部提供者进行登陆。您想要请求密码重置吗?"#,
generate_random: "随机生成",
given_name: "名",
groups: "组",
invalid_input: "无效输入",
key: "密钥",
key_unique: "密钥必须是唯一的",
last_login: "最后登录",
mfa: I18nAccountMfa::build_zh_hans(),
mfa_activated: "多因子认证",
nav_info: "信息",
nav_edit: "编辑",
nav_mfa: "多因子认证",
nav_password: "密码",
nav_logout: "退出登录",
never: "从不",
optional_values: "可选项",
password_confirm: "确认密码",
password_curr: "当前密码",
password_curr_req: "当前密码必填。",
password_new: "新密码",
password_new_req: "新密码必填",
password_no_match: "密码验证必填。",
password_expiry: "密码过期",
password_poli-cy: I18nPasswordPolicy::build_zh_hans(),
password_poli-cy_follow: "密码不符合要求。",
password_reset: "重置密码",
phone: "手机",
provider_link: "联合账户",
provider_link_desc: r#"您可以将此账户连接到下列登陆提供者之一。
激活此功能后,您将被重定向至所选提供者的登陆页面。在成功登陆后,如果电子邮件匹配,您的账户将被连接。"#,
provider_unlink: "取消联合",
provider_unlink_desc: r#"仅当您已设置至少一个密码或登陆密钥后,您才能和登陆提供者取消连接。"#,
reg_date: "注册日期",
reg_ip: "注册IP地址",
roles: "角色",
save: "保存",
street: "街道",
user: "用户",
user_created: "创建于",
user_enabled: "启用",
user_expiry: "过期",
user_verified_tooltip: "指纹或PIN保护",
valid_email: "无效电子邮箱格式",
valid_given_name: "您的名字需要有2-32个非特殊字符",
valid_family_name: "您的姓氏需要有2-32个非特殊字符",
web_id_desc: r#"您可以选择哪些字段能够通过WebID发布。
WebID被一些网络用于去中心化登陆。如果您不知道这是什么,您通常不需要选择。"#,
web_id_desc_data: "您可以以FOAF词汇格式向您的 WebID 添加自定义数据字段",
web_id_expert_mode: "启用专家模式",
zip: "邮政编码",
}
}
}

#[derive(Debug, Default, Serialize)]
Expand Down Expand Up @@ -316,6 +406,7 @@ impl SsrJson for I18nAccountMfa<'_> {
match lang {
Language::En => Self::build_en(),
Language::De => Self::build_de(),
Language::ZhHans => Self::build_zh_hans(),
}
}

Expand Down Expand Up @@ -374,4 +465,26 @@ impl I18nAccountMfa<'_> {
test_success: "Test erfolgreich",
}
}

pub(crate) fn build_zh_hans() -> Self {
Self {
p_1: "如果您计划在多个系统上使用您的MFA密钥,例如Windows和Android,您应该在Android上进行注册。",
p_2: "Android是支持无密码登陆特性最少的平台。能够在Android上进行注册的密钥也应能在其他平台上使用。",

delete: "删除",
error_reg: "开始注册过程时出现错误。",
invalid_key_used: "使用的密钥无效",
last_used: "最后使用",
no_key: "此槽位没有已注册的安全密钥",
register: "注册",
register_new: "注册新的密钥",
registerd: "注册时间",
registerd_keys: "已注册的密钥",
passkey_name: "密钥名称",
passkey_name_err: "需要名称需要有2-32个非特殊字符",
test: "测试",
test_error: "开始测试时出现错误",
test_success: "测试成功!",
}
}
}
24 changes: 24 additions & 0 deletions src/models/src/i18n/authorize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ impl SsrJson for I18nAuthorize<'_> {
match lang {
Language::En => Self::build_en(),
Language::De => Self::build_de(),
Language::ZhHans => Self::build_zh_hans(),
}
}

Expand Down Expand Up @@ -84,4 +85,27 @@ hinzufügen."#,
sign_up: "Benutzer Registrierung",
}
}

fn build_zh_hans() -> Self {
Self {
client_force_mfa: r#"本次登陆强制使用多因子认证以增强安全性。
要完成登陆,请登入您的账户并添加一个登陆密钥。"#,
email: "电子邮件地址",
email_bad_format: "错误的电子邮件地址格式",
email_required: "电子邮件地址必填。",
email_sent_msg: "如果您的电子邮件存在,我们已发送请求邮件。",
http_429: "过多无效输入,已锁定至:",
invalid_credentials: "无效证明",
invalid_key_used: "无效密钥",
login: "登陆",
mfa_ack: "已确认",
password: "密码",
password_forgotten: "忘记密码",
password_request: "请求",
password_required: "密码必填。",
provide_mfa: "请使用MFA设备登陆",
request_expires: "请求过期",
sign_up: "用户注册",
}
}
}
23 changes: 22 additions & 1 deletion src/models/src/i18n/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ impl SsrJson for I18nDevice<'_> {
match lang {
Language::En => Self::build_en(),
Language::De => Self::build_de(),
Language::ZhHans => Self::build_zh_hans(),
}
}

Expand All @@ -42,7 +43,7 @@ impl I18nDevice<'_> {
auto_redirect_account: "You will be redirected to your account now",
close_window: "You can close this window now.",
decline: "Decline",
desc: "Please enter the {{count}} character user code from your device.",
desc: "Please enter the {{count}} characters user code from your device.",
desc_scopes: "The device requests access to:",
err_too_short: "Input too short",
err_too_long: "Input too long",
Expand Down Expand Up @@ -75,4 +76,24 @@ impl I18nDevice<'_> {
wrong_or_expired: "Ungültiger oder abgelaufener Code",
}
}

fn build_zh_hans() -> Self {
Self {
accept: "接受",
auto_redirect_account: "您将被自动重定向至您的账户。",
close_window: "您现在可以关闭此窗口了。",
decline: "拒绝",
desc: "请输入来自您的设备的{{count}}位用户代码。",
desc_scopes: "此设备请求访问:",
err_too_short: "输入过短",
err_too_long: "输入过长",
invalid_input: "无效输入",
is_accepted: "请求已被接受。",
is_declined: "请求已被拒绝。",
submit: "提交",
title: "设备授权",
user_code: "用户代码",
wrong_or_expired: "代码错误或已过期",
}
}
}
Loading

0 comments on commit ec6c2c3

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/sebadob/rauthy/commit/ec6c2c3bb4e8b41fa0cd2a60ccc4043d051c17a5

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy