Skip to content

Conversation

@KnowsCount
Copy link
Contributor

new version of simplified Chinese

@marzavec
Copy link
Member

marzavec commented Dec 15, 2020

Whoops, I used the wrong label for Traditional Chinese? Well, I feel silly xD

So, I have not tested it yet, but everything is looking good so far. One thing I notice is that we are missing the hcclient.containers.LocaleToggle.cn prop on other translation files, although it is in place on app/translations/zh.json. Not a big deal since we have defaults defined, but would you mind adding it to the other translations? After that I will test the pr, merge and make the changes live under beta.hack.chat- thanks!

@KnowsCount
Copy link
Contributor Author

KnowsCount commented Dec 15, 2020

I'll add them now!

@KnowsCount
Copy link
Contributor Author

Done it! you can check it again.

@marzavec
Copy link
Member

Looks great! I'll test it as soon as I'm able to find some time

@KnowsCount
Copy link
Contributor Author

Thanks! I should sleep now as it is 1am in China... I understand your busyness.. so no worries!

@marzavec
Copy link
Member

Ah, yea, while testing this I remembered why I only supported Traditional Chinese, instead of both. The short version is that in order to support both "correctly", I'd need to overhaul how internationalization works within the framework- even though it works for literally every other language.

Supporting both like this presents two issues. The first issue is with the polyfill for older browsers; unless a special check is added specifically for Traditional vs Simplified "bad things" will happen. Not really a deal breaker to be honest, people using out dated software should be used to it by now. . .

The second is with how the framework integrates into the native Intl. An annoying error (which is more of a warning) is produced and the default language will always become Traditional.

A short snippet as an example:

let languageNames = new Intl.DisplayNames(['en'], {type: 'language'});
console.log(languageNames.of('zh')); // Returns "Chinese"
console.log(languageNames.of('cn')); // Returns "cn", IE unknown
console.log(languageNames.of('zh-TW')); // Returns "Chinese (Taiwan)"
console.log(languageNames.of('zh-CN')); // Returns "Chinese (China)"

Now, the pretend-warning can be suppressed easily enough, everything will work great, but users with a Chinese language preference will be presented with Traditional, as default, when they first load the application (even if their language preference is Simplified). They can fix this by manually changing over to Simplified in the language menu.

So, here is an ignorant question: which one should be default? Traditional or Simplified? I admit this should be a non-question which is only relevant due to my rampant laziness- I should rewrite everything properly instead.

@KnowsCount
Copy link
Contributor Author

KnowsCount commented Dec 16, 2020

As someone from China Mainland I would say Simplified Chinese should be the default as there are definitely more people using it. However, wikipedia used Traditional Chinese for a reason: the CCP bans a whole bunch of websites, and hackchat, as it somehow promotes complete freedom whilst allowing users to publish politically incorrect contents without being able to be supervised by the government (no database), I would actually, from this perspective, suggest you to use Traditional Chinese.

(but the current hack.chat is not banned)

Moreover, online chat are kinda monopolised in Mainland China by tech giants. The decision is on you.


Plus, reading the zh-TW & zh-CN part, I do imagine one cannot actually name something with - in between... That's a problem. I'll probably come up with a solution later.

@KnowsCount
Copy link
Contributor Author

KnowsCount commented Dec 16, 2020

in your code snippet, you wrote:

let languageNames = new Intl.DisplayNames(['en'], {type: 'language'});

what exactly is Intl? I've never used this.

@KnowsCount
Copy link
Contributor Author

Ah! Found something on MDN..

"zh-Hans-CN": Chinese (language) written in simplified characters (script) as used in China (region)

but how do I use it without naming the json file zh-Hans-CN...

@marzavec
Copy link
Member

wikipedia used Traditional Chinese for a reason

Oh, now that's interesting. . .

what exactly is Intl? I've never used this.

Intl is a built-in available on most modern browsers, it provides a large amount of boilerplate for internationalization; https://caniuse.com/?search=Intl

but how do I use it without naming the json file zh-Hans-CN

That's part of it for sure. It gets even more complicated though. . . However, I think we can merge this as it is for now. After getting the error suppression in place, the only real issue with be the lack of respect for a user's default language preference. I will also open up an issue for this.

Thank you very much!

@marzavec marzavec merged commit 51cc3bc into hack-chat:master Dec 16, 2020
@marzavec marzavec mentioned this pull request Dec 16, 2020
@marzavec
Copy link
Member

This update has been built and pushed to https://beta.hack.chat/

You may need to clear your browser cache and refresh.

@KnowsCount
Copy link
Contributor Author

wonderful! this day is long waited. Can I publicise this link to some of my friends now?

@marzavec
Copy link
Member

Of course :D

@KnowsCount
Copy link
Contributor Author

as you may see.. some of my friends wherewith I did the 'propaganda' starred the project but most of them would not.
The most common question they asked is 'what is the point of this project if there is already WeChat and QQ? (top two Chinese chat app developed by Tencent)'.
I was like 'why, it's minimal, distraction-free (quoting you) and Tencent could be watching you' but it does not seem like they care... what can I say

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants