Page MenuHomePhabricator

Fix Chinese translation for modernized wiktionary.org and wikibooks.org portals
Closed, ResolvedPublic

Description

The new Wiktionary portal at https://www.wiktionary.org show English text to Chinese users. It is supposed to show Simp/Trad Chinese translation instead.

Developer note

In contrast to wikt portal, for wikipedia.org:

  • zh is already on the top10
  • for browsers without a zh locale, display both simp and trad to them
  • for browsers with a zh locale, display variants as following:
    • zh, zh-hans, zh-cn, zh-my, zh-sg: zh-hans.json
    • zh-hant, zh-tw, zh-mo, zh-hk: zh-hant.json

In wiktionary.org and wikibooks.org portal, zh is not on top10, thereby it can only be load through ajax when we detect a zh locale.

Event Timeline

I mean, basically every sister project portal besides Wikipedia.org does not have proper translation at this point, so...

And also, their appearances should all be updated respectively as Wikipedia.org and Wiktionary.org look like, if could.

Change 790724 had a related patch set uploaded (by Tranve; author: Tranve):

[wikimedia/portals@master] Fix l10n problems for Chinese in Wikimedia portals

https://gerrit.wikimedia.org/r/790724

Diskdance updated the task description. (Show Details)
Diskdance renamed this task from Fix Chinese translation for new wiktionary.org portal to Fix Chinese translation for modernized wiktionary.org and wikibooks.org portals.May 15 2022, 12:49 AM
Diskdance updated the task description. (Show Details)

Change 791769 had a related patch set uploaded (by Tranve; author: Tranve):

[wikimedia/portals@master] Generate and show zh translations properly

https://gerrit.wikimedia.org/r/791769

Change 790724 abandoned by Tranve:

[wikimedia/portals@master] Fix l10n problems for Chinese in Wikimedia portals

Reason:

Abandon in favor of 791769

https://gerrit.wikimedia.org/r/790724

Change 791769 merged by jenkins-bot:

[wikimedia/portals@master] Handle zh translation properly for wiktionary and wikibooks portal

https://gerrit.wikimedia.org/r/791769

Patch 1 merged. The next step is to make top-viewed wikis correctly arranged according to users' locale.

@Jdrewniak Sorry to interrupt, but can I use ES6 features like arrow functions, Promise and fetch() in portals' code?
I have encountered a problem that, there is an asynchronous XHR in topten-localized.js and we must ensure that its execution is completed before that of PerformChineseConversion(), but it is not easy to achieve the effect.
I think the best approach is to convert code in topten-localized.js and page-localized.js to use Promise chains, which are not supported in IE11. Since IE11 has got its special treatment, can we just break support of it and use those modern stuffs? Thanks.

Most of translation problems have been fixed now, but it is still problematic when Chinese is not in the top10 area. To fix this some abstraction and cleaning up is needed. See T311361.

Change 992961 had a related patch set uploaded (by Func; author: Func):

[wikimedia/portals@master] Fix the top 10 featured language for Chinese sites

https://gerrit.wikimedia.org/r/992961

Change 992961 merged by jenkins-bot:

[wikimedia/portals@master] Fix the top 10 featured language for Chinese sites

https://gerrit.wikimedia.org/r/992961

Func claimed this task.