Skip to content

Commit

Permalink
Add zh-TW localization (#2781)
Browse files Browse the repository at this point in the history
* add zh-TW localization

* fix typo

* fix languages.ts

* improve translation

* improve translation

* 部分翻譯修正
- 使用全形標點符號
- 將部分簡體字修正為正體字
- 更改部分用語

* fix incorrectly commented strings

* small fix and suggestion

* update translation team

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: Yuki Cheung <[email protected]>

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: Yuki Cheung <[email protected]>

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: Yuki Cheung <[email protected]>

* modify the translation based on the review suggestions

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: Yuki Cheung <[email protected]>

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: Yuki Cheung <[email protected]>

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: Yuki Cheung <[email protected]>

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: noeFly <[email protected]>

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: noeFly <[email protected]>

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: noeFly <[email protected]>

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: Yuki Cheung <[email protected]>

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: Yuki Cheung <[email protected]>

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: Yuki Cheung <[email protected]>

* modify translation by review

* modify translation by review

* modify translation by review

* modify translation by review

* modify translation by review

* modify translation by review

* minor fixes

* minor fixes

* Update messages.po

* translate new strings

* fix typo

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: Howard Guo <[email protected]>

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: Howard Guo <[email protected]>

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: Howard Guo <[email protected]>

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: Howard Guo <[email protected]>

* Update src/locale/locales/zh-TW/messages.po

Co-authored-by: Howard Guo <[email protected]>

* Update messages.po

* Update messages.po

* Update messages.po

* Update messages.po

* fixed typo

* Update messages.po

* correct translation

* Update messages.po

* modify translation by review

* Update messages.po

* Update messages.po

---------

Co-authored-by: noeFly <[email protected]>
Co-authored-by: Kuwa Lee <[email protected]>
Co-authored-by: Yuki Cheung <[email protected]>
Co-authored-by: Howard Guo <[email protected]>
  • Loading branch information
5 people authored Apr 3, 2024
1 parent 75d6535 commit b76bf94
Show file tree
Hide file tree
Showing 6 changed files with 5,978 additions and 0 deletions.
1 change: 1 addition & 0 deletions lingui.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
'uk',
'ca',
'zh-CN',
'zh-TW',
'it',
],
catalogs: [
Expand Down
2 changes: 2 additions & 0 deletions src/locale/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ export function sanitizeAppLanguageSetting(appLanguage: string): AppLanguage {
return AppLanguage.ca
case 'zh-CN':
return AppLanguage.zh_CN
case 'zh-TW':
return AppLanguage.zh_TW
case 'it':
return AppLanguage.it
default:
Expand Down
4 changes: 4 additions & 0 deletions src/locale/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {messages as messagesPt_BR} from '#/locale/locales/pt-BR/messages'
import {messages as messagesUk} from '#/locale/locales/uk/messages'
import {messages as messagesCa} from '#/locale/locales/ca/messages'
import {messages as messagesZh_CN} from '#/locale/locales/zh-CN/messages'
import {messages as messagesZh_TW} from '#/locale/locales/zh-TW/messages'
import {messages as messagesIt} from '#/locale/locales/it/messages'

import {sanitizeAppLanguageSetting} from '#/locale/helpers'
Expand Down Expand Up @@ -77,6 +78,9 @@ export async function dynamicActivate(locale: AppLanguage) {
i18n.loadAndActivate({locale, messages: messagesIt})
break
}
case AppLanguage.zh_TW: {
i18n.loadAndActivate({locale, messages: messagesZh_TW})
}
default: {
i18n.loadAndActivate({locale, messages: messagesEn})
break
Expand Down
4 changes: 4 additions & 0 deletions src/locale/i18n.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ export async function dynamicActivate(locale: AppLanguage) {
mod = await import(`./locales/zh-CN/messages`)
break
}
case AppLanguage.zh_TW: {
mod = await import(`./locales/zh-TW/messages`)
break
}
case AppLanguage.it: {
mod = await import(`./locales/it/messages`)
break
Expand Down
2 changes: 2 additions & 0 deletions src/locale/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export enum AppLanguage {
uk = 'uk',
ca = 'ca',
zh_CN = 'zh-CN',
zh_TW = 'zh-TW',
it = 'it',
}

Expand All @@ -40,6 +41,7 @@ export const APP_LANGUAGES: AppLanguageConfig[] = [
{code2: AppLanguage.uk, name: 'Українська – Ukrainian'},
{code2: AppLanguage.ca, name: 'Català – Catalan'},
{code2: AppLanguage.zh_CN, name: '简体中文(中国) – Chinese (Simplified)'},
{code2: AppLanguage.zh_TW, name: '繁體中文(臺灣) – Chinese (Traditional)'},
{code2: AppLanguage.it, name: 'Italiano - Italian'},
]

Expand Down
Loading

0 comments on commit b76bf94

Please sign in to comment.