mailcow-dockerized icon indicating copy to clipboard operation
mailcow-dockerized copied to clipboard

🌐 Add Traditional Chinese Translation

Open tomy0000000 opened this issue 2 years ago • 6 comments

As title, I'm adding a new translation.

Simplified Chinese (简体中文): Used in China, Singapore, .... Traditional Chinese (繁體中文): Used in Taiwan, Hong Kong, ...

This is a working progress, the translation data available now is translated by machine, and I'll walk through the data in the next few days and request merged after everything is done.

Feedbacks are welcomed.

tomy0000000 avatar Jul 02 '22 03:07 tomy0000000

Progress (Rolling Updating):

  • [x] acl (29)
  • [x] add (77)
  • [x] admin (235)
  • [x] danger (117)
  • [x] debug (24)
  • [x] diagnostics (9)
  • [x] edit (111)
  • [x] fido2 (13)
  • [x] footer (13)
  • [x] header (9)
  • [x] info (3)
  • [x] login (7)
  • [x] mailbox (156)
  • [x] oauth2 (7)
  • [x] quarantine (51)
  • [x] ratelimit (5)
  • [x] start (4)
  • [x] success (77)
  • [x] tfa (25)
  • [x] user (159)
  • [x] warning (11)
List of generic converted terms
  • 啓用 -> 啟用
  • 重啓 -> 重新啟動
  • 登錄 -> 登入
  • 用戶名 -> 使用者名稱
  • 用戶 -> 使用者
  • 設備 -> 裝置
  • 默認 -> 預設
  • 配置 -> 組態
  • 重置 -> 重設
  • 設置 -> 設定
  • 策略 -> 規則
  • 映射 -> 規則表
  • 服務器 -> 伺服器
  • 內存 -> 記憶體
  • 日誌 -> 紀錄
  • 搜索 -> 搜尋
  • 訪問 -> 存取
  • 保存 -> 儲存
  • 信息 -> 訊息
  • 郵箱 -> 信箱
  • 屏幕 -> 畫面
  • 周 -> 週
  • 紀錄 -> 記錄
  • 磁盤 -> 硬碟
  • 添加 -> 新增
  • 端口 -> 通訊埠
  • 證書 -> 憑證
  • 自定義 -> 自訂
  • 文件夾 -> 資料夾
  • 遠程 -> 遠端
  • 數據 -> 資料
  • 高級 -> 進階
  • 網絡 -> 網路
  • 密鑰 -> 金鑰
  • 鏈接 -> 連結
  • 封禁-> 禁止
  • 正則表達式 -> 正規表示式
  • 列表 -> 清單
  • 隊列 -> 佇列
  • 禁用 -> 停用
  • 支持 -> 支援
  • 客戶端 -> 用戶端
  • 模板 -> 模版
  • 刷新 -> 重新整理
  • 示例 -> 範例
  • 發件人 -> 寄件人
  • 全局 -> 全域
  • 主題 -> 主旨
  • 協議 -> 協定

tomy0000000 avatar Jul 02 '22 17:07 tomy0000000

@DerLinkman I think everything is ready to go, please have a look.

In addition to the translation, I did some research about different language codes specification, and suggest we should change to IETF language tag which is a superset of the current ISO 639-1 standard. Specifically, it consists with two codes: {lanugage}-{region}, so this also fix a bug where some language (Ukrainian) can not display a proper flag icon.

A Full conversion table is as follow:

Old Code New Code Display Name
cs cs-cz Čeština (Czech)
da da-dk Danish (Dansk)
de de-de Deutsch (German)
en en-gb English
es es-es Español (Spanish)
fi fi-fi Suomi (Finish)
fr fr-fr Français (French)
hu hu-hu Magyar (Hungarian)
it it-it Italiano (Italian)
ko ko-kr 한국어 (Korean)
lv lv-lv latviešu (Latvian)
nl nl-nl Nederlands (Dutch)
pl pl-pl Język Polski (Polish)
pt pt-pt Português (Portuguese)
ro ro-ro Română (Romanian)
ru ru-ru Pусский (Russian)
sk sk-sk Slovenčina (Slovak)
sv sv-se Svenska (Swedish)
uk uk-ua Українська (Ukrainian)
zh zh-cn 简体中文 (Simplified Chinese)
zh-tw 繁體中文 (Traditional Chinese)

tomy0000000 avatar Aug 09 '22 07:08 tomy0000000

In addition to the translation, I did some research about different language codes specification, and suggest we should change to IETF language tag which is a superset of the current ISO 639-1 standard. Specifically, it consists with two codes: {lanugage}-{region}, so this also fix a bug where some language (Ukrainian) can not display a proper flag icon.

I'd need to check if I can easily transform from ISO 639-1 to IETF in weblate

MAGICCC avatar Aug 09 '22 16:08 MAGICCC

In addition to the translation, I did some research about different language codes specification, and suggest we should change to IETF language tag which is a superset of the current ISO 639-1 standard. Specifically, it consists with two codes: {lanugage}-{region}, so this also fix a bug where some language (Ukrainian) can not display a proper flag icon.

I'd need to check if I can easily transform from ISO 639-1 to IETF in weblate

I don't have any experience with weblate, but I found this page in their docs, hope this might help.

tomy0000000 avatar Aug 11 '22 10:08 tomy0000000

I guess, when I'll follow https://github.com/WeblateOrg/weblate/discussions/7996 it'll be fine

MAGICCC avatar Aug 11 '22 18:08 MAGICCC

I saw this PR had been stale for a while, so do let me know if there's anything I can do to help.

tomy0000000 avatar Sep 08 '22 18:09 tomy0000000

I saw this PR had been stale for a while, so do let me know if there's anything I can do to help.

You can resolve the conflicts and then we can maybe try to merge it maybe? Do you have concerns about this @DerLinkman? For weblate I would try to fix it after the merge.

MAGICCC avatar Sep 23 '22 15:09 MAGICCC

@MAGICCC please check if you can change that in Weblate before we merge it.

And yes. The merge conflicts should be fixed.

DerLinkman avatar Sep 26 '22 18:09 DerLinkman

@MAGICCC @DerLinkman I've resolved the conflict, please have a look.

tomy0000000 avatar Sep 30 '22 08:09 tomy0000000

Hm. That don´t work at all :(

grafik

I´ve checked out the PR here but now all Strings are empty.

Interestingly is this:

grafik

DerLinkman avatar Sep 30 '22 08:09 DerLinkman

Is there a document about how to start the modified backend server for debugging?

tomy0000000 avatar Sep 30 '22 08:09 tomy0000000

Is there a document about how to start the modified backend server for debugging?

You can set DEV_MODE=y in your mailcow.conf.

Then PHP is logging more to debug.

DerLinkman avatar Sep 30 '22 08:09 DerLinkman

Is there a document about how to start the modified backend server for debugging?

You can set DEV_MODE=y in your mailcow.conf.

Then PHP is logging more to debug.

I mean spawning a new backend instance without interfering the production one

tomy0000000 avatar Sep 30 '22 16:09 tomy0000000

Just tested it. Works better but the english language is not completely correct i guess.

grafik

I think it´s only the logo.

DerLinkman avatar Oct 06 '22 14:10 DerLinkman

And also: the automatic language detection does not work anymore. It´s standardly english now.

Just some quick feedback :)

DerLinkman avatar Oct 06 '22 14:10 DerLinkman

And also: the automatic language detection does not work anymore. It´s standardly english now.

Just some quick feedback :)

Can you paste your accept-language entry in the request headers, this will be helpful

Screen Shot 2022-10-06 at 10 39 33 PM

tomy0000000 avatar Oct 06 '22 14:10 tomy0000000

I've made some improvements to the algorithms for determining language. Here are the rules, run sequentially:

  1. Perfect match (Match a full 2-2 code)
  2. Partial match (Match the first 2 characters of code, language but not country)
  3. Suggestion match (Match the first 2 characters from the user's first 2 characters of the 2-2 code)
  4. Fallback to en-gb

Some examples (keep in mind we only have en-gb but not en-us):

  • en-us, zh-tw => zh-tw (Perfect match)
  • en-us, en, zh-tw => en-gb (Partial match)
  • en-us => en-gb (Suggest match)

tomy0000000 avatar Oct 06 '22 15:10 tomy0000000

Regarding the missing English flag, it's a bug originated in 007-languages.min.css.

You can see there are gb.svg in both 1x1 and 4x3 format, but when the css is compiled in da20d5dc38ef79ca87179080323491a50e9eb222, they are somehow not included.

I could fix it manually, but I'm worry if it will be overwrite in future updates. @andryyy do you mind take a look or explain how css is compiled?

tomy0000000 avatar Oct 06 '22 15:10 tomy0000000

Feedback Round 2 :)

Looks good so far in case of translations and autorecognition etc.

@FreddleSpl0it may also can explain your question about CSS?

DerLinkman avatar Oct 07 '22 14:10 DerLinkman

I could fix it manually, but I'm worry if it will be overwrite in future updates.

It will definately (at least once with Bootstrap 5) but we´ll test it anyways and repair it during the finalization of the update.

DerLinkman avatar Oct 19 '22 14:10 DerLinkman

I could fix it manually, but I'm worry if it will be overwrite in future updates.

It will definately (at least once with Bootstrap 5) but we´ll test it anyways and repair it during the finalization of the update.

Great, that will work.

Is there anything else I should do/fix to merge this PR?

tomy0000000 avatar Oct 19 '22 16:10 tomy0000000

I would merge it into the special bs5 featured branch first to make sure the whole thing still works when we merge bs5 into master.

This PR will merged before BS5 i guess so it´s only for dev purposes so to say (that special branch)

DerLinkman avatar Oct 20 '22 08:10 DerLinkman

Alrighty!

Then it looks fine to me.

Thank you for this. @MAGICCC you wanted to check it on Weblate right?

DerLinkman avatar Oct 20 '22 09:10 DerLinkman

Yes I fixed it on Weblate too

MAGICCC avatar Oct 20 '22 16:10 MAGICCC

Hi, on inbox page, the searchinput do not support chinese

cjw0202 avatar Jul 05 '23 13:07 cjw0202