-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Multilingual: 'message "xxxx" has no plural form for "one" #7839
Comments
I will have a look at this soonish, but today I'm busy busy with other things. This i18n upgrade from v1 to v2 was certainly more painful than I expected, but hopefully it's worth it. |
That is certainly not a priority. These are only warnings, but the site is correctly generated nonetheless. Thanks for having a look at it anyway! :) |
About the warnings... |
@cyChop I suspect that the warnings are correct, and would like to close this issue. Please review my comments here, and let me know your thoughts. Thanks. |
Hi @jmooring ! Obviously, the warning is correct, but it was a surprising behaviour change.
This seems to be exactly what happens. And from the formalism of go-18n, it makes sense. I just went to Hugo's multilingual documentation and see that I'm still using the old formalism, where precising the For instance, I still have: - id: wordCount
translation: This article has {{ .WordCount }} words. instead of wordCount:
other: This article has {{ .WordCount }} words. With this new approach, this issue is obsolete and may be closed. I'll let the project contributors do it. I just have one question for you, @jmooring , since you seem to know your way around go-i18n much better than me: is there a way to tell go-i18n explicitly to fall back to readingTime:
one: {{ .Count }} min. reading
other: {{ .Count }} min. reading Thanks for having had a look at it! |
No. If it falls back to If it falls back to |
So, an issue I've noticed after upgrading to Hugo 0.83: When you want to use "simple" When you call [read_more]
other = "Read more" ...you'll have to define [read_more]
one = "Lire la suite" ... in order to avoid the warning message:
(The warning message is also suboptimal in talking of a This is because the Language Plural Rules for Now while technically this seems all fine, it would be awesome if Hugo could make life easier for theme authors: If a translation is specified without an explicit cardinal form (what @cyChop called the "old formalism"), Hugo should not blindly assign it to What do you think, @jmooring? |
Because of some recent [language/i18n fixes](language/i18n fixes) Hugo 0.83+ started to complain about missing `fr` translations for cardinal form `"one"`. This is due to the fact that French uses different language plural rules than English, German, Italian and others. See gohugoio/hugo#7839 (comment) for an explanation of the underlying issue.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
With the latest updates, my site generation generates a lot of warnings like the following:
I use the "--i18n-warnings" option. Some of the concerned messages use a dynamic count, others don't.
The messages that generate these messages are called with a .Count argument (
{{- i18n "xxxxxx" $count -}}
), but don't need specific singular/plural forms.What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes.
The text was updated successfully, but these errors were encountered: