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

How to handle unknown languages? #146

Closed
bep opened this issue Nov 28, 2018 · 2 comments · Fixed by #171
Closed

How to handle unknown languages? #146

bep opened this issue Nov 28, 2018 · 2 comments · Fixed by #171
Milestone

Comments

@bep
Copy link
Contributor

bep commented Nov 28, 2018

In v1 it was possible to handle "custom languages" by registering a new plural spec based on the english one.

In v2, the language handling is a little bit more unclear (hidden).

If I try to parse a language file with the name klingon.toml:

m, err := bundle.ParseMessageFileBytes([]byte("[hello]\nother = \"nuqneH\""), "klingon.toml")

I get a Message with language.Undefined in return. This sounds like an error to me, but my main challenge here is: How do I define a new language? I have tried to read up on how golang.org/x/text/language works, but I cannot find a way to register a new language.

See gohugoio/hugo#5242

@nicksnyder
Copy link
Owner

I agree that this should be supported; just need to figure out how to make it work in conjunction with x/text

@nicksnyder
Copy link
Owner

Use the language tag art-x-klingon on the latest master.

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 a pull request may close this issue.

2 participants