Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n ― Simplified Chinese #48

Merged
merged 14 commits into from
Sep 9, 2022
6 changes: 6 additions & 0 deletions components/hamburger-menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@
"opendata": "オープンデータ・API",
"history": "更新履歴",
"translate": "原神 自動翻訳"
},
"zh-CN": {
"about": "关于",
"opendata": "开放数据 · API",
"history": "更新记录",
"translate": "原神机器翻译(日语)"
}
}
</i18n>
Expand Down
10 changes: 10 additions & 0 deletions components/word-list-results.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@
"permalinkAlt": "{word}のページへのリンク",
"copyLink": "{word}のページへのリンクをコピー",
"copyLinkDone": "{word}のページへのリンクのコピーが完了しました"
},
"zh-CN": {
"english": "英语",
"simplifiedChinese": "简体中文",
"japanese": "日语",
"example": "示例",
"permalink": "永久链接",
"permalinkAlt": "{word}的链接",
"copyLink": "复制{word}的链接",
"copyLinkDone": "已复制{word}的链接"
}
}
</i18n>
Expand Down
6 changes: 6 additions & 0 deletions components/word-list-search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
"tags": "タグ",
"openListOfTags": "タグ一覧を開く",
"closeListOfTags": "タグ一覧を閉じる"
},
"zh-CN": {
"enterSearchTerms": "输入搜索关键词…",
"tags": "标签",
"openListOfTags": "打开标签列表",
"closeListOfTags": "收起标签列表"
}
}
</i18n>
Expand Down
3 changes: 3 additions & 0 deletions components/word-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
},
"ja": {
"notFound": "該当する語彙が見つかりませんでした。"
},
"zh-CN": {
"notFound": "未找到匹配的词汇。"
}
}
</i18n>
Expand Down
4 changes: 4 additions & 0 deletions layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
"ja": {
"siteTitleL1": "原神 英語・",
"siteTitleL2": "中国語辞典"
},
"zh-CN": {
"siteTitleL1": "原神",
"siteTitleL2": "中英日辞典"
}
}
</i18n>
Expand Down
4 changes: 4 additions & 0 deletions layouts/error.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"ja": {
"notfound": "このページは存在しません",
"returnToIndex": "トップページへ戻る"
},
"zh-CN": {
"notfound": "页面不存在",
"returnToIndex": "返回到首页"
}
}
</i18n>
Expand Down
22 changes: 16 additions & 6 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ export default async () => {
iso: "ja-JP",
name: "日本語",
},
// {
// code: "zh-CN",
// iso: "zh-CN",
// name: "简体中文",
// },
{
code: "zh-CN",
iso: "zh-CN",
name: "简体中文",
},
],
strategy: "prefix",
defaultLocale: "en",
Expand Down Expand Up @@ -159,6 +159,16 @@ export default async () => {
historyTitle: "更新履歴",
opendataTitle: "オープンデータ・API (β)",
},
"zh-CN": {
siteTitle: "原神中英日辞典",
indexTitleDesc: "一个在线的中英日三语原神游戏用语辞典",
wordIdTitle: "\"{zhCN}\"的英语和日语翻译",
wordIdDescription: "\"{zhCN}\"的英语是\"{en}\",日语是\"{ja}\"。",
aboutTitle: "关于本网站",
aboutDescription: "关于原神中英日辞典。本网站是一个在线的中英日三语原神游戏用语辞典。",
historyTitle: "更新记录",
opendataTitle: "开放数据 · API (β)",
},
},
},
},
Expand Down Expand Up @@ -188,7 +198,7 @@ export default async () => {
gzip: false,
i18n: true,
routes: [
...([ "en", "ja" /* , "zh-CN" */ ].map(lang => ([
...([ "en", "ja" , "zh-CN" ].map(lang => ([
{ url: `/${lang}/` },
{ url: `/${lang}/history/` },
...(words.map(word => ({ url: `/${lang}/${word.id}/`, lastmod: word.updatedAt }))),
Expand Down
2 changes: 1 addition & 1 deletion pages/about.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<main>
<p v-if="$i18n.locale !== 'ja'">
<strong>This page is not translated to English yet.</strong>
<strong>This page is not translated to English/Simplified Chinese yet.</strong>
</p>
<p>
このサイトは PC・スマートフォン・プレイステーション4/5用ゲーム「<a href="https://genshin.hoyoverse.com" target="_blank" rel="noopener">原神</a>」で用いられる固有名詞等の日本語・英語・中国語対訳表です。
Expand Down
4 changes: 4 additions & 0 deletions pages/history.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
"ja": {
"updatedOn": "{createdAt} 更新",
"noRecentUpdates": "直近の更新はありません。"
},
"zh-CN": {
"updatedOn": "更新于{createdAt}",
"noRecentUpdates": "无近期更新。"
}
}
</i18n>
Expand Down
2 changes: 1 addition & 1 deletion pages/opendata.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<main>
<p v-if="$i18n.locale !== 'ja'">
<strong>This page is not translated to English yet.</strong>
<strong>This page is not translated to English/Simplified Chinese yet.</strong>
</p>
<p>
本サイトの対訳表データは CSV 形式 (一般向け) 及び JSON 形式 (技術者向け) で配布しています。<br>
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e.pwtest.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ describe("redirection by language settings works properly", () => {
{ code: "en", url: `${rootURL}/en/` },
{ code: "en-US", url: `${rootURL}/en/` },
{ code: "en-GB", url: `${rootURL}/en/` },
// { code: "zh", url: `${rootURL}/zh-CN/` },
// { code: "zh-CN", url: `${rootURL}/zh-CN/` },
{ code: "zh", url: `${rootURL}/zh-CN/` },
{ code: "zh-CN", url: `${rootURL}/zh-CN/` },
{ code: "fr", url: `${rootURL}/en/` }, // fallback to English
];

Expand Down