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

Add word counts in page meta. #57

Merged
merged 3 commits into from
Dec 17, 2021
Merged

Add word counts in page meta. #57

merged 3 commits into from
Dec 17, 2021

Conversation

wizardbyron
Copy link
Contributor

No description provided.

@netlify
Copy link

netlify bot commented Dec 16, 2021

✔️ Deploy Preview for hugo-congo ready!
Built without sensitive environment variables

🔨 Explore the source changes: e197434

🔍 Inspect the deploy log: https://app.netlify.com/sites/hugo-congo/deploys/61bd076e3daa410009164d3d

😎 Browse the preview: https://deploy-preview-57--hugo-congo.netlify.app

@github-actions github-actions bot added the i18n Issue with i18n translations label Dec 16, 2021
@jpanther
Copy link
Owner

Thanks for the PR. I have one suggestion here... it would be preferable to pass .WordCount to the i18n function (similar to how the reading time works) so that the string can be translated more easily. It would then allow supporting plurals and there may be instances where some languages need to prefix the counter.

Example:

{{- i18n "article.word_count" .WordCount | emojify -}}
article:
  word_count:
    one: "{{ .Count }} word"
    other: "{{ .Count }} words"

@jpanther jpanther added the enhancement New feature or request label Dec 16, 2021
@jpanther
Copy link
Owner

Thanks! I'll merge this in.

@jpanther jpanther merged commit 27ccae6 into jpanther:dev Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request i18n Issue with i18n translations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants