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

wordCount and readingTime doesn't work when defaultContentLanguage is set to pl #7590

Closed
lszczygielek opened this issue Aug 22, 2020 · 5 comments
Labels

Comments

@lszczygielek
Copy link

lszczygielek commented Aug 22, 2020

What version of Hugo are you using (hugo version)?

$ hugo version
Hugo Static Site Generator v0.74.3-DA0437B4 windows/amd64 BuildDate: 2020-07-23T16:23:30Z

Does this issue reproduce with the latest release?

Yes

I'm creating site in Polish. In my config.toml I have:

defaultContentLanguage = "pl"
languageCode = "pl"

#rest setup

For now I resign from multi-language support and I discovered that reading time and word counting doesn't work in single.html. I've done some testing and I found:

  1. When I comment defaultContentLanguage, then I see calculation of reading time and word counting, but I need to use en.toml in i18n with polish to translate template - without defaultContentLanguage en is chosen.
  2. When I add post in the English for one post then post in English has calculated values, but post in the Polish hasn't.

Repository with issue: https://github.com/lszczygielek/Hugo-WordCount-ReadingTime-Issue

@Lednerb
Copy link

Lednerb commented Aug 23, 2020

@lszczygielek which theme do you use?

I thinkt it's more related to the translation files. Does the i18n/pl.toml with the needed strings exist?

@lszczygielek
Copy link
Author

lszczygielek commented Aug 23, 2020

@Lednerb, yes I have i18n/pl.toml.
Repository with issue: https://github.com/lszczygielek/Hugo-WordCount-ReadingTime-Issue

@lszczygielek
Copy link
Author

Issue still present in version:

$ hugo version
Hugo Static Site Generator v0.75.1-A4A7BAB7 windows/amd64 BuildDate: 2020-09-15T06:48:58Z

@jmooring
Copy link
Member

jmooring commented Apr 22, 2021

TLDR

  • I am unable to reproduce the problem with v0.82.1.
  • The warnings are correct.
git clone --recurse-submodules https://github.com/lszczygielek/Hugo-WordCount-ReadingTime-Issue
cd Hugo-WordCount-ReadingTime-Issue
hugo server

This generates two warnings:

WARN ... "wordCount" has no plural form "many"
WARN ... "readingTime" has no plural form "many"

But the values are correct (http://localhost:1313/post/test).

Now add one word of content, because content/post/test.md has nothing beneath the front matter:

echo "kot" >> content/post/test.md 

This generates no warnings, and the values are correct (http://localhost:1313/post/test).

Now add one more word of content

echo "pies" >> content/post/test.md 

This generates one warning:

WARN ... "wordCount" has no plural form "few"

But the values are correct (http://localhost:1313/post/test).

The warnings occur because the CLDR plural rules for Polish specify the following cardinal categories: one, few, many, and other. The few and many categories are missing from the i18n/pl.toml file.

More information about the warnings here: gohugoio/hugoDocs#1410 (comment).

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants