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

goi18n merge creates plural versions only #254

Closed
maberer opened this issue May 2, 2021 · 6 comments · Fixed by #309
Closed

goi18n merge creates plural versions only #254

maberer opened this issue May 2, 2021 · 6 comments · Fixed by #309

Comments

@maberer
Copy link

maberer commented May 2, 2021

Running goi18n merge active.en.toml translate.de.toml
on https://github.com/nicksnyder/go-i18n/blob/main/v2/example/active.en.toml
inserts everything in plural. See below for "one" and "other" both are plural versions...

[MyUnreadEmails]
description = "The number of unread emails I have"
hash = "sha1-9bed04915e80e0ac6b2304a03710e9d6b5749b47"
one = "I have {{.PluralCount}} unread emails"
other = "I have {{.PluralCount}} unread emails"

is this intended?

@nicksnyder
Copy link
Owner

Yes. This makes it clear to the translator what they need to translate and in which plural forms for that language.

@stephenafamo
Copy link
Contributor

This is really weird, to be honest. Is there a way to change this behaviour?

@nicksnyder
Copy link
Owner

nicksnyder commented Nov 17, 2023

There is not a way to change this behavior. If you could change this behavior, what would you want to happen instead?

@stephenafamo
Copy link
Contributor

There is not a way to change this behavior. If you could change this behavior, what would you want to happen instead?

For the "one" field in translations.*.toml to match the "one" field in the *i18n.Message and not the "other" field

@nicksnyder
Copy link
Owner

The reason that I originally implemented it this way was because it wasn't clear to me that one in one language is equivalent to one in another language. This is probably a safe assumption though, so will re-open this issue and I would review a PR if you want to make one to change this behavior.

@stephenafamo
Copy link
Contributor

PR Done. Please review @nicksnyder

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.

3 participants