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

Support both Chinese versions (Simplified and Traditional) #83

Open
honobo opened this issue Sep 2, 2023 · 3 comments
Open

Support both Chinese versions (Simplified and Traditional) #83

honobo opened this issue Sep 2, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@honobo
Copy link

honobo commented Sep 2, 2023

zh.wikipedia.org provides multiple versions using different writing systems, among others:

  1. Chinese written in simplified letters, commonly used in mainland China
  2. Chinese written in traditional letters, commonly used in Taiwan

Conceptually the two are like en-US vs. en-GB but the difference is more radical, as every "alphabet" (letter, "glyph") used to write words are different-shaped, only vaguely similar.

On WP the user may select their familiar flavor of Chinese via 不转换 menu. For example, if you open...
https://zh.wikipedia.org/wiki/%E9%97%A8%E7%BD%97%E5%B8%81
...and then select 臺灣正體, then you'll get
https://zh.wikipedia.org/zh-tw/%E9%97%A8%E7%BD%97%E5%B8%81
which is written in Chinese with the traditional writing system, using the Taiwanese orthography.

Though WP has more Chinese options than the above two, practically it is roughly sufficient if zh-CN & zh-TW are supported (or technically: zh-Hans & zh-Hant). If necessary, educated Chinese speakers can read both, but the two are so different that e.g. for a Taiwanese person, reading a long zh-CN text can be painful, and vice versa.

So It would seem ideal if Wikiless too somehow supports the selection between lang=zh-tw and lang=zh-cn, especially considering that many of the users who might be greatly helped by Wikiless are (or will be) Chinese people behind the Great Firewall (i.e. those who may not be able to read the regular Wikipedia articles freely).

@Jeyso215 Jeyso215 added the enhancement New feature or request label Sep 2, 2023
@Jeyso215
Copy link
Collaborator

Jeyso215 commented Sep 2, 2023

If you can make a pull request instead to speed this up, this will help great fully. I have some real life issues and work so I can't really work on it right now!

@Jeyso215
Copy link
Collaborator

Jeyso215 commented Sep 2, 2023

@honobo

@honobo
Copy link
Author

honobo commented Sep 5, 2023

I just quick-checked the source code, and as it turned out, these are already supported:
const lang_variants = ['zh-hans','zh-hant','zh-cn','zh-hk','zh-mo','zh-my','zh-sg','zh-tw']

So one can already do this:

  1. Open a Chinese (中文) page normally e.g.
    https://wl.vern.cc/wiki/%E6%B1%89%E8%AF%AD?lang=zh
  2. Add a subtag (e.g. -tw) and open that URL
    https://wl.vern.cc/wiki/%E6%B1%89%E8%AF%AD?lang=zh-tw

While there doesn't appear to be an obvious GUI for this, typing -tw etc. is easy enough in practice. You can perhaps close this issue since basically it's been already implemented.

If anything, maybe accept uppercase letters just in case; language tags are case-insensitive and people tend to type e.g. zh-TW or zh-Hant. Something trivial like...
if(req.query && req.query.lang) {
- return req.query.lang
+ return req.query.lang.toLowerCase()
}

Thanks again for your tolerance and assistance toward diverse cultures and complicated situations in Asia :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants