-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Proposal] Use ICU message for i18n & l10n #23863
Comments
Are there any tool to convert ini format to that ICU format? Or should we create one? |
I didn't get your mean. ICU is a just message format, no need to convert |
Maybe we should use another format but ini files? |
Why? |
YAML may be ok as it requires less escaping than INI. But one also needs to be aware of it's pitfalls, like |
At the moment I don't see real benefit that YAML would bring. Actually we do not need too much "escaping" with INI, there are just some legacy bugs. The only "escaping" requirements are:
I think INI still wins. |
Found another use case where https://github.com/go-gitea/gitea/pull/25050/files#r1214691116 |
To avoid re-inventing wheels, it's better to use ICU message to do i18n/l10n.
Steps:
Below is outdated description: the old idea is using a customized message format (it's a simple syntax like ICU message, but it's not supported by Crowdin, so Crowdin can't help to check mistakes).
The official package's design seems clear and will resolve Gitea's i18n/l10n problems fundamentally.
https://pkg.go.dev/golang.org/x/text/message
https://pkg.go.dev/golang.org/x/text/feature/plural
https://github.com/unicode-org/cldr/blob/main/common/supplemental/ordinals.xml
https://github.com/unicode-org/cldr/blob/main/common/supplemental/plurals.xml
I think a translator-friendly syntax is very important, because there are really a lot of broken translations, if we make the system more complex, there will be more errors.
And the syntax should be also designed for frontend (JS/Vue).
As the first step, we should refactor the locale package to make it stable, see the problems
A brief idea about how to maintain the translation strings:
Another possible approach, define all concepts ahead:
If we only need to support one
%d
, the syntax might be simplified, eg:The text was updated successfully, but these errors were encountered: