Skip to content

Commit

Permalink
Merge pull request #323 from ocftw/refactor/rename-zh-tw-language-to-…
Browse files Browse the repository at this point in the history
…be-zh-hant

refactor: migrate zh-tw to zh-hant
  • Loading branch information
ben196888 authored Apr 15, 2024
2 parents 713e09e + b5f8ca6 commit 2d120ac
Show file tree
Hide file tree
Showing 74 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions homepage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ Decap CMS 支援 Markdown 語法,如對此不熟悉可參考以下兩個網站

1. 增加語言於 [`next.config.js`](./next.config.js) 中的 `i18n.locales` 陣列中。語言代碼請參考 [BCP 47](https://www.w3.org/International/questions/qa-choosing-language-tags#question), [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), [ISO 639-2](https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes), [ISO 639-3](https://en.wikipedia.org/wiki/List_of_ISO_639-3_codes)

目前支援的語言有 `zh-tw`, `en`
目前支援的語言有 `zh-Hant`, `en`

```js
// next.config.js
i18n: {
locales: ['zh-tw', 'en'],
defaultLocale: 'zh-tw',
locales: ['zh-Hant', 'en'],
defaultLocale: 'zh-Hant',
},

// decap-cms.config.js
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions homepage/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
module.exports = {
swcMinify: true,
i18n: {
locales: ['zh-tw', 'en'],
defaultLocale: 'zh-tw',
locales: ['zh-Hant', 'en'],
defaultLocale: 'zh-Hant',
},
trailingSlash: true,
};
1 change: 1 addition & 0 deletions homepage/public/_redirects
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Abbreivations redirect
/zh-tw/* /zh-Hant/:splat 301
/s/manual https://drive.google.com/file/d/1PQQfFv0QSdt3qymEEu5B_NrmKSsn34UI/view?usp=sharing
2 changes: 1 addition & 1 deletion homepage/src/layouts/header/languageDropdownMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Link from 'next/link';

const languageLabelDictionary = {
en: 'English',
'zh-tw': '中文',
'zh-Hant': '中文',
};

const LanguageDropdownMenu = () => {
Expand Down
2 changes: 1 addition & 1 deletion homepage/src/lib/repository/fetchAllCards.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const cardsDirectory = join(process.cwd(), '_cards');

/**
* lang ISO language and locale string
* e.g. 'zh-tw', 'en', 'en-us', ...
* e.g. 'zh-Hant', 'en', 'en-us', ...
*/
function getCardDirectoryPath(lang) {
// return language folder path
Expand Down
4 changes: 2 additions & 2 deletions homepage/src/pages/404.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ export const getStaticProps = async ({ locale }) => {
const headInfo = {
title: {
en: `OpenStarTerVillage - Page Not Found`,
'zh-tw': `開源星手村 - 找不到網頁`,
'zh-Hant': `開源星手村 - 找不到網頁`,
},
};

const desc = {
en: `
Bug report? Ask TwoMore. <a href="https://forms.gle/t9j8dbiKUohny8PZ8">Filling the form</a> to report a bug!
`,
'zh-tw': `
'zh-Hant': `
有問題?找兔摩。<a href="https://forms.gle/t9j8dbiKUohny8PZ8">填寫表單</a>回報你找到的問題吧!
`,
};
Expand Down
2 changes: 1 addition & 1 deletion homepage/src/pages/_app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const siteDataDictionary = {
description: `How can technology change the world? Play this board game and discover the answer for yourself!`,
logo: `/images/logo.png`,
},
'zh-tw': {
'zh-Hant': {
title: `開源星手村`,
description: `科技怎麼改變世界?玩桌遊、就知道!`,
logo: `/images/logo.png`,
Expand Down
2 changes: 1 addition & 1 deletion homepage/src/pages/cards.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const getStaticProps = async ({ locale }) => {
const headInfo = {
title: {
en: `OpenStarTerVillage - Card Introduction`,
'zh-tw': `開源星手村 - 卡片介紹`,
'zh-Hant': `開源星手村 - 卡片介紹`,
},
};

Expand Down
4 changes: 2 additions & 2 deletions homepage/src/pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export const getStaticProps = async ({ locale }) => {
const headInfo = {
title: {
en: `OpenStarTerVillage`,
'zh-tw': `開源星手村`,
'zh-Hant': `開源星手村`,
},
description: {
en: `How can technology change the world? Play this board game and discover the answer for yourself!`,
'zh-tw': `科技怎麼改變世界?玩桌遊、就知道!`,
'zh-Hant': `科技怎麼改變世界?玩桌遊、就知道!`,
},
};

Expand Down
2 changes: 1 addition & 1 deletion homepage/src/pages/resource.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const getStaticProps = async ({ locale }) => {
const headInfo = {
title: {
en: `OpenStarTerVillage - Resource`,
'zh-tw': `開源星手村 - 資源頁`,
'zh-Hant': `開源星手村 - 資源頁`,
},
};

Expand Down

0 comments on commit 2d120ac

Please sign in to comment.