Skip to content

Commit

Permalink
Add Simplified Chinese Language (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
yucho123987 authored Dec 31, 2024
1 parent 1566ca5 commit e0dac93
Show file tree
Hide file tree
Showing 8 changed files with 638 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/config/config.inc.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@

//! @note List of supported languages. When adding new language file, be sure
//! to add the new language code here.
'languages' => ['en', 'de', 'fr', 'zh_TW', 'ro', 'pl', 'pt_BR'],
'languages' => ['en', 'de', 'fr', 'zh_TW', 'ro', 'pl', 'pt_BR', 'zh_CN'],

//! @note Lifetime for test run meta data in redis cache.
'testRunLifetime' => 5 * 60
Expand Down
57 changes: 57 additions & 0 deletions api/languages/zh_CN.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
$lang = [
'changeEmail.footer' => '您收到这封邮件是因为有人试图将一个帐户绑定到您的电子邮件地址。如果您没有要求这样做,请忽略并删除这封电子邮件。',
'changeEmail.subject' => '$projectName: 确认更改的电子邮件地址',
'changeEmail.body' =>
'嗨,' . "\n\n"
. '您已请求将您的 $projectName 帐户的电子邮件地址更改为 $newEmail。' . "\n\n"
. '请点击以下链接以确认您电子邮件地址的更改。' . "\n\n"
. '{link|$confirmationLink|确认电邮地址}' . "\n\n"
. '如果您没有请求此更改,「不要」点击确认链接,请忽略并删除这封电子邮件。' . "\n\n"
. '感谢您,' . "\n\n"
. '$projectName',
'lostPasswordEmail.footer' => '您收到此电子邮件是因为有人试图重设您帐户的密码,如果您没有提出要求,请忽略并删除这封电子邮件。',
'lostPasswordEmail.subject' => '$projectName: 重设密码',
'lostPasswordEmail.body' =>
'嗨,' . "\n\n"
. '您已请求重设您 $projectName 帐户的密码。' . "\n\n"
. '请点击以下链接重设您的密码。' . "\n\n"
. '{link|$confirmationLink|重设密码}' . "\n\n"
. '如果您没有请求此更改,「不要」点击该链接,请忽略并删除这封电子邮件。' . "\n\n"
. '感谢您,' . "\n\n"
. '$projectName',
'signupEmail.footer' => '您收到此电子邮件是因为有人使用您的电子邮件地址进行了注册,如果您没有提出要求,请忽略并删除这封电子邮件。',
'signupEmail.subject' => '$projectName: 启动帐户',
'signupEmail.body' =>
'嗨,' . "\n\n"
. '感谢您在 $projectName 注册!' . "\n\n"
. '请点击以下链接启动您的帐户。' . "\n\n"
. '{link|$confirmationLink|启动帐户}' . "\n\n"
. '如果您没有注册,「不要」点击该链接,请忽略并删除这封电子邮件。' . "\n\n"
. '感谢您,' . "\n\n"
. '$projectName',
'subscriptionEmail.footer' => '您收到这封电子邮件是因为您的订阅状态发生了变化,如有疑问,请随时与我们的支持团队联系。',
'subscriptionActivatedEmail.subject' => '$projectName: 订阅已启动',
'subscriptionActivatedEmail.body' =>
'嗨,' . "\n\n"
. '非常感谢您支持 $projectName 并使我们的服务成为可能!' . "\n\n"
. '您的订阅已成功启动,在极少数情况下,订阅状态可能尚未显示在您的帐户中,在这种情况下,请重新登录。' . "\n\n"
. '顺道一提:您可以在您的帐户中的「设置」->「管理订阅」中找到您的收据和发票。' . "\n\n"
. '感谢您,' . "\n\n"
. '$projectName',
'subscriptionCancelledEmail.subject' => '$projectName: 订阅已终止',
'subscriptionCancelledEmail.body' =>
'嗨,' . "\n\n"
. '您在 $projectName 的订阅现已终止。' . "\n\n"
. '非常感谢您支持 $projectName!' . "\n\n"
. '感谢您,' . "\n\n"
. '$projectName',
'subscriptionExpiringEmail.subject' => '$projectName: 订阅正在终止',
'subscriptionExpiringEmail.body' =>
'嗨,' . "\n\n"
. '根据要求,我们将终止您在 $projectName 的订阅,从 $cancelAt 开始生效。' . "\n\n"
. '非常感谢您支持 $projectName!' . "\n\n"
. '感谢您,' . "\n\n"
. '$projectName',
'dateFormat' => 'Y/m/d'
];
5 changes: 5 additions & 0 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import translationZhTW from './locales/zh_TW/translation.json';
import translationRo from './locales/ro/translation.json';
import translationPL from './locales/pl/translation.json';
import translationPtBR from './locales/pt_BR/translation.json';
import translationZhCN from './locales/zh_CN/translation.json';

import AppMenu from './components/AppMenu';
import Dashboard from './components/dashboard/Dashboard';
Expand All @@ -45,6 +46,7 @@ import 'moment/locale/ro';
import 'moment/locale/pl';
import 'moment/locale/zh-tw';
import 'moment/locale/pt-br';
import 'moment/locale/zh-cn';
import moment from 'moment';
import useLanguageCode, { getLanguageCode } from './hooks/useLanguageCode';
import { Config } from './utils/Config';
Expand Down Expand Up @@ -86,6 +88,9 @@ const LANGUAGE_RESOURCES = {
pt_BR: {
translation: translationPtBR,
},
zh_CN: {
translation: translationZhCN,
},
};

i18n
Expand Down
Loading

0 comments on commit e0dac93

Please sign in to comment.