godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Change Chinese editor translation identifiers to `zh_Hans` and `zh_Hant` #6289

Open timothyqiu opened 1 year ago

timothyqiu commented 1 year ago

Describe the project you are working on

The Godot Engine.

Describe the problem or limitation you are having in your project

Currently in the editor's language list, Chinese languages are shown as:

[zh_CN] Chinese, China
[zh_TW] Chinese, Taiwan

This is technically correct and I'm okay with it.

But as Godot becomes more and more recognized in the industry, I'm afraid radicals may raise flame wars based on "Taiwan" being listed at the same level as "China" without extra annotations.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

A common solution is to describe the language / script instead of the region when possible. e.g. In Microsoft's language selector:

Locale Description Effectively
zh_CN Chinese (Simplified) zh_Hans
zh_TW Chinese (Traditional) zh_Hant
zh_HK Chinese (Tranditional, Hong Kong SAR) zh_Hant_HK

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

In the editor language list:

So the menu shows:

[zh_Hans] Chinese (Simplified)
[zh_Hant] Chinese (Traditional)

This only affects the editor. Users may still use zh_CN or zh_TW in their own project if they want.

I think this is as easy as renaming the .po files:

If this enhancement will not be used often, can it be worked around with a few lines of script?

No. It's part of the editor binary.

Is there a reason why this should be core and not an add-on in the asset library?

It's part of the editor binary.

Riteo commented 1 year ago

But as Godot becomes more and more recognized in the industry, I'm afraid radicals may raise flame wars based on "Taiwan" being listed at the same level as "China".

While I do understand that this is, when brought up the wrong way, a very delicate thing, is this really a problem for FOSS stuff? Said radicals have lots of ways of extorting what they want from corporations, but from a FOSS piece of software what's the worst that could happen?

This only affects the editor

Even more, I seriously doubt that those bad actors might come after us for a FOSS editor. You look kinda concerned, so this might be more important than I can see.

I've seen some bad stuff and I might be a bit too optimistic, no doubts, but this feels like a bit... Extreme. If we want to be really politic wouldn't this be kinda like "playing their game"?

Politics apart, from a technical point of view I've never seen this identifier style when it comes to chinese stuff (not like I've used chinese localized software) and I don't like it as it breaks the xx_XX scheme that all other (sub)locales follow.

From what I understand, TranslationServer.get_locale_name() already returns this "extended format" you're proposing, so this makes me think that this was kinda intentional in order to keep formatting consistent.

timothyqiu commented 1 year ago

Said radicals have lots of ways of extorting what they want from corporations, but from a FOSS piece of software what's the worst that could happen?

From what I have observed, these radicals are extremely eager to show their patriotism.

They don't want to extort anything, they just want everyone to behave in a specific politically correct way (e.g. labeling "Taiwan" as "Taiwan Province of China" unconditionally). Otherwise, they accuse the subject of humiliating China, exaggerate the matter extremely until it becomes a public issue in society.

They think they've succeeded if the government is forced to outlaw it (e.g. ban Godot related websites or contents in China).

If we want to be really politic wouldn't this be kinda like "playing their game"?

Yeah, kind of. Sadly, when you decide not to let your actions be influenced by politics, you are already influenced by politics. :disappointed:

The radicals usually want to get users all over the world to use mainland China politically correct rules, this is definitely unfair. This proposal does not follow what they want.

from a technical point of view I've never seen this identifier style when it comes to chinese stuff (not like I've used chinese localized software)

This style of identifier is quite common at least since the birth of HTML5. It's recommended for developers to use zh_Hans instead of zh_CN because it's technically more correct to describe the written script:

Most software I see don't show identifiers directly. But most of them use "Simplified Chinese" / "Traditional Chinese" to stay technical and avoid unnecessary disputes.

Another option is to only change the descriptions like in the Microsoft website example linked in OP. They use zh-cn and zh-tw identifiers in the URL, but use "Simplified Chinese" / "Traditional Chinese" in the list. These descriptions are technically inaccurate. zh_CN only means "The Chinese language used in China".

I don't like it as it breaks the xx_XX scheme that all other (sub)locales follow.

From what I understand, TranslationServer.get_locale_name() already returns this "extended format" you're proposing, so this makes me think that this was kinda intentional in order to keep formatting consistent.

Locale identifiers fetched from macOS have always been in this format. There were bugs about Godot not handling these correctly.

Engine support for this kind of locale identifier was added not so long ago by @bruvzg IIRC.

I think the filenames were kept because there's no reason to change.

bruvzg commented 1 year ago

I think this is as easy as renaming the .po files

Indeed, renaming .po files (and locale file in the macOS editor template) should be enough.

from a technical point of view I've never seen this identifier style when it comes to chinese stuff

macOS / iOS use it as a default OS localization codes.

Another option is to only change the descriptions like in the Microsoft website example linked in OP.

Unlike renaming files, this will require adding a special hard-coded exception, since get_locale_name() is the generation name for each part of the code individually (and any combination is valid).

Riteo commented 1 year ago

All right, so now I understand both the political reason and the technical one.

I think that other locales used the country of the "sublocale" just because there's no easy other thing to differentiate, but here we have the writing system.

In general, I approve.