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

refactor(i18n): restructure i18n system and add EN/CN translations #235

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/styles/articles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ h4 {
margin-bottom: 0.4em;
}

a {
:deep(a) {
text-decoration: underline;
}

Expand Down
39 changes: 0 additions & 39 deletions i18n.config.js

This file was deleted.

13 changes: 13 additions & 0 deletions i18n.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import en from './lang/en'
import ja from './lang/ja'
import zhCN from './lang/zh-CN'

export default defineI18nConfig(() => ({
legacy: false,
fallbackLocale: 'en',
messages: {
en,
ja,
'zh-CN': zhCN
}
}))
9 changes: 9 additions & 0 deletions lang/en.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import common from './en/common'
import about from './en/about'
import opendata from './en/opendata'

export default {
...common,
...about,
...opendata,
}
24 changes: 24 additions & 0 deletions lang/en/about.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export default {
aboutTitle: "About this website",
aboutDescription: "About Genshin Dictionary. This website is an online English-Chinese-Japanese dictionary of the terms in Genshin Impact.",
aboutIntro: "This site is a Japanese-English-Chinese translation table for proper nouns used in the PC/smartphone/PlayStation 4/5 game {genshinLink}.",
wordCount: "The current number of words included is {count}.",
precautionsTitle: "Precautions and Disclaimer",
precautions1: "Please note that due to the nature of this site, which lists translations of proper nouns from the game, there are many liberal translations, and the translations may differ from their general meanings.",
precautions2: "The readings (furigana) are provided to improve search accuracy and have not been thoroughly researched for accuracy. Please be aware that there may be many errors. If you want to collect more accurate information about readings, we recommend referring to the {genshinDictionaryLink}.",
precautions3: "This site is a fan site operated by a single player and is not affiliated with the developer, HoYoverse (COGNOSPHERE PTE., LTD./miHoYo Co., Ltd.).",
openDataTitle: "Open Data & API (β)",
openDataContent: "The translation data of this site is distributed in CSV format (for general users) and JSON format (for technical users).<br>For details, please check the {openDataLink}.",
openDataPageLink: "Open Data & API page",
operatorTitle: "Operator and Contributors",
operator: "Operator: Xicri ({twitterLink} / {githubLink})",
contributor: "Chinese translation data creation: Bill Haku ({bilibiliLink} / {twitterLink} / {githubLink})",
contact: "For inquiries, please contact us via {twitterLink}. (DM available)<br>For bug reports, open data/API related issues, and other technical inquiries, you can also contact us through GitHub {issuesLink} or {discussionsLink}.<br>When contacting us, please use Japanese or English if possible.",
creditsTitle: "Credits",
credits1: "Some of the reading data on this site refers to the {genshinDictionaryLink} and the {genshinKanjiLabLink}.",
credits2: "The words on this site are primarily referenced from the game, official YouTube videos, tweets, etc., but some words such as artifacts refer to the {genshinWikiLink}.",
credits3: "This site uses {octiconsLink} provided by GitHub under the {licenseLink}.",
credits4: "Part of this site's favicon uses {logoTypeGothicLink}.",
genshinDictionary: "Genshin Glossary",
genshinKanjiLab: "Genshin Kanji Research Lab",
} as const;
12 changes: 12 additions & 0 deletions lang/en/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default {
siteTitle: "Genshin Dictionary",
indexTitleDesc: "An online English-Chinese-Japanese dictionary of the terms in Genshin Impact",
historyTitle: "Update History",
opendataTitle: "Open Data / API (β)",
langNameEn: "English",
langNameJa: "Japanese",
langNameZhCN: "Chinese",
genshinImpact: "Genshin Impact",
license: "license",
logoTypeGothic: "Logo Type Gothic",
} as const;
53 changes: 53 additions & 0 deletions lang/en/opendata.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
export default {
introText: "The translation data from this site is available in CSV format (for general users) and JSON format (for developers). You may freely process, publish, and redistribute the data. (Please refer to the Usage Notes section for details)",

csvTitle: "CSV (For General Users)",
csvDownloadUtf8: "Download CSV (UTF-8 version)",
csvDownloadShiftJis: "Download CSV (Shift_JIS version)",
csvNote: "When opening CSV files in Excel, the Shift_JIS version is recommended. The UTF-8 version may cause character encoding issues.\nFor other software, if you encounter character encoding issues, please try both UTF-8 and Shift_JIS versions.",

jsonTitle: "JSON (For Developers)",
jsonUrlTitle: "Data URL",
jsonUrlText: "Data can be retrieved from {url}",
jsonFormatTitle: "Data Format",
jsonFormatText: "The JSON consists of an array of objects as shown in the following example:",

propertyTitle: "Each object has the following properties:",
propertyId: "Unique ID for each word. You can access the word's page on this site at https://genshin-dictionary.com/[ ID ]/. Please note that this may change without notice.",
propertyEn: "English name",
propertyJa: "Japanese name",
propertyZhCN: "Chinese name",
propertyPronunciationJa: "Japanese reading (in hiragana, katakana, and symbols)",
propertyNotes: "Notes (for Japanese speakers). May contain HTML.",
propertyNotesZh: "Notes (for Chinese speakers). May contain HTML.",
propertyVariants: "Common misspellings and alternate names. For example, the misspelling '鐘離' for Zhongli, or the abbreviation '血染め' for 'Bloodstained Chivalry'.",
propertyVariantsEn: "English misspellings and alternate names",
propertyVariantsJa: "Japanese misspellings and alternate names",
propertyExamples: "Example sentences",
propertyExamplesEn: "Example sentence in English",
propertyExamplesJa: "Example sentence in Japanese",
propertyExamplesRef: "Source of the example",
propertyExamplesRefURL: "Link to the source",
propertyCreatedAt: "Creation date (yyyy-mm-dd format)",
propertyUpdatedAt: "Last update date (yyyy-mm-dd format)",
propertyTags: "Tags. The following tags exist:",

compatibilityTitle: "Compatibility",
compatibilityText: "This data is currently in beta. Please be aware that there may be breaking changes without notice.",

usageNotesTitle: "Usage Notes",
lastUpdated: "Last updated: January 3, 2022",
usageNotes: {
basic: "The CSV and JSON translation data (hereinafter referred to as 'the Data') distributed by this site may be freely processed, published, and redistributed.",
citation: "You are not required to display the site name or URL as the source of the Data (though you are welcome to do so).",
revocation: {
intro: "The permission to use the Data will be revoked in the following cases. If the revocation of permission results in the loss of your right to publish or redistribute the Data or derivative works, you must promptly cease publication and redistribution:",
rights: "If publishing or redistributing the Data infringes on the rights of HoYoverse operating companies (COGNOSPHERE PTE. LTD., miHoYo Co., Ltd., and other national branches or subsidiaries) or other third parties",
terms: "If publishing or redistributing the Data violates the terms of service of Genshin Impact or related services (such as HoYoLab)",
laws: "If publishing or redistributing the Data violates Japanese law or the laws of your country of residence",
request: "If requested by the site operator to cease use of the Data"
},
disclaimer: "The site operator assumes no responsibility for any damages incurred by you or third parties in connection with the use, processing, publication, or redistribution of the Data."
},
contactText: "If you have any questions, please contact us via {twitterLink}. (You can send DMs even if you don't follow us.)"
} as const;
9 changes: 9 additions & 0 deletions lang/ja.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import common from './ja/common'
import about from './ja/about'
import opendata from './ja/opendata'

export default {
...common,
...about,
...opendata,
}
24 changes: 24 additions & 0 deletions lang/ja/about.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export default {
aboutTitle: "このサイトについて",
aboutDescription: "原神英語・中国語辞典についての説明です。このサイトは PC・スマートフォン・プレイステーション4/5用ゲーム「原神」で用いられる固有名詞等の日本語・英語・中国語対訳表です。",
aboutIntro: "このサイトは PC・スマートフォン・プレイステーション4/5用ゲーム「{genshinLink}」で用いられる固有名詞等の日本語・英語・中国語対訳表です。",
wordCount: "現在の収録単語数は{count}語です。",
precautionsTitle: "ご利用にあたっての注意・免責事項",
precautions1: "本サイトはゲームの固有名詞等の対訳を掲載している都合上、意訳が多く、一般的な意味とは訳が異なる場合がありますので、ご注意下さい。",
precautions2: "読み仮名は検索精度の向上を目的として付けており、その正確性について十分な調査をしておりません。間違いが多く含まれる可能性があることをご了承下さい。読み仮名について、より正確な情報を収集されたい場合、{genshinDictionaryLink}を参照されることをおすすめします。",
precautions3: "このサイトは一プレイヤーが運営しているファンサイトであり、開発元である HoYoverse (COGNOSPHERE 社・miHoYo 社)とは関係ありません。",
openDataTitle: "オープンデータ・API (β)",
openDataContent: "本サイトの対訳表データは CSV 形式 (一般向け) 及び JSON 形式 (技術者向け) で配布しています。<br>詳細は{openDataLink}をご確認下さい。",
openDataPageLink: "オープンデータ・APIについてのページ",
operatorTitle: "運営者・貢献者",
operator: "運営者: シクリ ({twitterLink} / {githubLink})",
contributor: "中国語翻訳データ作成: Bill Haku ({bilibiliLink} / {twitterLink} / {githubLink})",
contact: "お問い合わせなどの際は {twitterLink} からご連絡下さい。(DM 可)<br>バグ報告やオープンデータ・API 関連、その他技術的なお問い合わせについては、GitHub の {issuesLink} や {discussionsLink} からお問い合わせ頂いても構いません。<br>お問い合わせの際は、できるだけ日本語又は英語でお願いします。",
creditsTitle: "クレジット",
credits1: "本サイトの読み仮名データの一部は、{genshinDictionaryLink}及び{genshinKanjiLabLink}を参照しています。",
credits2: "本サイトの単語は、原則としてゲームや公式から配信される YouTube 動画、ツイート等を参照していますが、聖遺物など一部の単語については {genshinWikiLink} を参照しています。",
credits3: "本サイトは GitHub 社により {licenseLink}にて提供されている {octiconsLink} を利用しています。",
credits4: "本サイトの favicon の一部には{logoTypeGothicLink}を利用しています。",
genshinDictionary: "原神用語辞書",
genshinKanjiLab: "原神漢字研究所",
} as const;
12 changes: 12 additions & 0 deletions lang/ja/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default {
siteTitle: "原神 英語・中国語辞典",
indexTitleDesc: "原神の固有名詞等の英語表記、及び中国語表記の一覧を掲載しています。",
historyTitle: "更新履歴",
opendataTitle: "オープンデータ・API (β)",
langNameEn: "英語",
langNameJa: "日本語",
langNameZhCN: "中国語",
genshinImpact: "原神",
license: "ライセンス",
logoTypeGothic: "ロゴたいぷゴシック",
} as const;
56 changes: 56 additions & 0 deletions lang/ja/opendata.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
export default {
notTranslated: "このページは英語/簡体字中国語に完全には翻訳されていません。",
introText: "本サイトの対訳表データは CSV 形式 (一般向け) 及び JSON 形式 (技術者向け) で配布しています。データは、基本的に自由に加工し掲載・再配布して頂いて構いません。(詳細は利用上の注意の項をお読み下さい)",

csvTitle: "CSV (一般向け)",
csvDownloadUtf8: "CSV (UTF-8 版) をダウンロード",
csvDownloadShiftJis: "CSV (Shift_JIS 版) をダウンロード",
csvNote: "Excel を用いて CSV を開く場合は、Shift_JIS 版の利用を推奨します。UTF-8 版を用いると文字化けする可能性があります。\nその他のソフトウェアを用いる場合についても、文字化けが発生する場合は UTF-8 版と Shift_JIS 版の両方を試してみて下さい。",

jsonTitle: "JSON (技術者向け)",
jsonUrlTitle: "データ URL",
jsonUrlText: "{url} からデータを取得できます。",
jsonFormatTitle: "データ形式",
jsonFormatText: "JSON は以下の例のように、オブジェクトの配列になっています。",

propertyTitle: "各オブジェクトのプロパティは以下の通りです:",
propertyId: "各単語を一意に示す ID。https://genshin-dictionary.com/[ ID ]/ にアクセスすると、本サイトの当該単語のページを表示できます。時折予告なく変更される場合があるため、注意して下さい。",
propertyEn: "英語名",
propertyJa: "日本語名",
propertyZhCN: "中国語名",
propertyPronunciationJa: "日本語の読み。ひらがな、カタカナ、記号が含まれます。",
propertyNotes: "備考 (日本語話者向け)。HTML が含まれる場合があります。",
propertyNotesZh: "備考 (中国語話者向け)。HTML が含まれる場合があります。",
propertyVariants: "よくある誤記や通称等。例えば鍾離の誤記「鐘離」や、聖遺物「血染めの騎士道」の略称「血染め」などが含まれます。",
propertyVariantsEn: "英語の誤記や通称等",
propertyVariantsJa: "日本語の誤記や通称等",
propertyExamples: "例文",
propertyExamplesEn: "例文の英語",
propertyExamplesJa: "例文の日本語",
propertyExamplesRef: "例文の出典",
propertyExamplesRefURL: "例文の出典のリンク",
propertyCreatedAt: "作成日 (yyyy-mm-dd 形式)",
propertyUpdatedAt: "最終更新日 (yyyy-mm-dd 形式)",
propertyTags: "タグ。タグは以下の種類が存在します:",

compatibilityTitle: "互換性",
compatibilityText: "本データは現在β版です。予告なく破壊的変更が入る可能性もありますので、ご了承下さい。",

usageNotesTitle: "利用上の注意",
lastUpdated: "最終更新: 2022年1月3日",

usageNotes: {
basic: "当サイトの配布する CSV 及び JSON の日英対訳データ (以下「本データ」) は、自由に加工し掲載・再配布することができます。",
citation: "本データの出典として、当サイトのサイト名や URL などを表示する義務はありません。(勿論、表示して頂いても構いません。)",
revocation: {
intro: "以下の場合、本データの利用許可は取り消されます。利用許可の取り消しによって、本データ又は本データを加工して作成した成果物を掲載・再配布する権利があなたから失われる場合、速やかに掲載・再配布を停止しなければなりません。",
rights: "本データを掲載・再配布することで、Hoyoverse 運営各社 (COGNOSPHERE PTE. LTD.、上海米哈游網絡科技股份有限公司、株式会社 miHoYo、その他各国支社・子会社) やその他の第三者の権利を侵害する場合",
terms: "本データを掲載・再配布することで、原神や関連サービス (HoYoLab など) の利用規約に違反する場合",
laws: "本データを掲載・再配布することで、日本法又はあなたの居住国の法令に違反する場合",
request: "当サイトの運営者が本データの利用停止を求めた場合"
},
disclaimer: "本データの利用・加工・掲載・再配布に伴い、あなたや第三者に何らかの損害が生じた場合、当サイトの運営者は一切の責任を負いません。"
},

contactText: "ご不明点があれば、{twitterLink} にてお問い合わせ下さい。(フォロー外から DM をお送り頂くことも可能です。)",
} as const;
9 changes: 9 additions & 0 deletions lang/zh-CN.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import common from './zh-CN/common'
import about from './zh-CN/about'
import opendata from './zh-CN/opendata'

export default {
...common,
...about,
...opendata,
}
Loading
Loading