Skip to content

Commit

Permalink
improve i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
mebtte committed Aug 13, 2023
1 parent c9a4fed commit f198a7b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions apps/pwa/src/i18n/en_us.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,5 @@ export default {
fork_from: 'fork-from',
add: 'add',
image_select_placeholder: 'select a image with jpeg/png format',
pwa_update_question: 'do you want to reload to switch new version of cicada?',
};
3 changes: 3 additions & 0 deletions apps/pwa/src/i18n/zh_hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ const zhCN: {
one_of_formats: '以下格式的一种: %s1',
modify_fork_from: '修改二次创作来源',
fork_from: '二次创作来源',
add: '添加',
image_select_placeholder: '选择 jpeg/png 格式的图片',
pwa_update_question: '检查到新版本, 是否马上加载?',
};

export default zhCN;
5 changes: 4 additions & 1 deletion apps/pwa/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import sleep from '#/utils/sleep';
import App from './app';
import definition from './definition';
import Unsupported from './unsupported';
import { t } from './i18n';
import upperCaseFirstLetter from './style/upper_case_first_letter';

function findUnsupportedList(): string[] {
return [];
Expand All @@ -30,6 +32,7 @@ if (unsupportedList.length) {
const VersionUpdater = styled.div`
> .text {
padding-top: 10px;
${upperCaseFirstLetter}
}
> .action-box {
Expand Down Expand Up @@ -62,7 +65,7 @@ if ('serviceWorker' in navigator) {
wb.addEventListener('waiting', () => {
updateNoticeId = notice.info(
<VersionUpdater>
<div className="text">检测到新版本, 是否马上加载?</div>
<div className="text">{t('pwa_update_question')}</div>
<div className="action-box">
<IconButton
className="action"
Expand Down

0 comments on commit f198a7b

Please sign in to comment.