-
Notifications
You must be signed in to change notification settings - Fork 274
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
go-i18n fails on custom language codes #72
Comments
I agree. In Hugo we use this language code as part of the URL in a multisite setup, and I have always assumed that I could abuse this feature to make multisite setups of whatever term I want, even non-languages. And even if we do restrict it to languages, I don't see why |
This sounds reasonable to me and it probably isn't that difficult. You might only need to export registerPluralSpec. Then during your application's initialization register whatever language ids you want. |
I have an idea to make it simpler and without exporting something. Hopefully it will work. |
I merged #79 which exports Operands and RegisterPluralSpec. I think this should unblock you. |
If user wants to have custom language code that aren't in Unicode CLDR (like at.yaml, dk.yaml, ch.yaml, gb.yaml, etc.),
bundle.ParseTranslationFileBytes
returnsno language found in "dk.yaml"
.I don't think that users should be limited only with CLDR languages. They can freely use language codes they want and it can be technically implemented.
Discussion: https://discuss.gohugo.io/t/i18n-country-codes-as-part-of-the-url/6881
The text was updated successfully, but these errors were encountered: