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

Use zh-TW for language code, instead of zh_Hant. #725

Merged

Conversation

sonata-chen
Copy link
Contributor

@sonata-chen sonata-chen commented Jul 26, 2022

This pull request fixed issue #667.

Browser never returns zh_Hant. Chinese language code is usually categorized according to geographical region. (zh-CN, zh-HK, zh-TW)
@sonata-chen sonata-chen requested a review from dessalines as a code owner July 26, 2022 05:14
@sonata-chen sonata-chen changed the title Fix issue [#667](https://github.com/LemmyNet/lemmy-ui/issues/667). Use zh-TW for language code, instead of zh_Hant. Use zh-TW for language code, instead of zh_Hant. Jul 26, 2022
@@ -63,7 +63,7 @@ export const languages = [
{ resource: sv, code: "sv", name: "Svenska" },
{ resource: vi, code: "vi", name: "Tiếng Việt" },
{ resource: zh, code: "zh", name: "中文 (简体)" },
{ resource: zh_Hant, code: "zh_Hant", name: "中文 (繁體)" },
{ resource: zh_Hant, code: "zh-TW", name: "中文 (繁體)" },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must use an underscore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you elaborate more why we must use an underscore here?
I have tested on my machine. It seems that it's not OK to use underscores for both zh_TW and pt_BR.
Lemmy (without a login) will not pick the correct language based on browser settings.

Copy link
Contributor Author

@sonata-chen sonata-chen Jul 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my browser setting
navigator.languages: [ "zh-TW", "en-US", "en" ]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah... I was under the impression it needed one, coulda swore I tested that with pt-BR. In that case I'll trust your judgement here, thx!

@dessalines dessalines merged commit 4117d04 into LemmyNet:main Jul 27, 2022
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