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

taxonomies multi-language bug at page header #2077

Open
4 of 12 tasks
BrentHuang opened this issue Sep 9, 2024 · 2 comments
Open
4 of 12 tasks

taxonomies multi-language bug at page header #2077

BrentHuang opened this issue Sep 9, 2024 · 2 comments
Labels
i18n Internationalization / Localization taxonomy related to hugo taxomomies

Comments

@BrentHuang
Copy link

Environment

  • Version of Docsy you are using: v0.10.0
  • How are you using Docsy? As a:
    • Hugo module
    • NPM module
    • Git submodule
    • Other:
  • Version of Hugo you are using (output of hugo version): v0.134.1
  • OS:
    • Linux (WSL)
    • macOS
    • Windows
    • Other:

Problem

image

config in hugo.toml

# Comment out to enable taxonomies in Docsy
# disableKinds = ["taxonomy", "taxonomyTerm"]

# You can add your own taxonomies
[taxonomies]
tag = "tags"
category = "categories"

[params.taxonomy]
# set taxonomyCloud = [] to hide taxonomy clouds
taxonomyCloud = ["tags", "categories"]

# If used, must have same length as taxonomyCloud
# taxonomyCloudTitle = ["Tag Cloud", "Categories"]
taxonomyCloudTitle = ["标签", "分类"]

# set taxonomyPageHeader = [] to hide taxonomies on the page headers
taxonomyPageHeader = ["tags", "categories"]
@BrentHuang BrentHuang added bug Something isn't working needs-triage labels Sep 9, 2024
@BrentHuang BrentHuang changed the title multi-language bug at page header taxonomies multi-language bug at page header Sep 9, 2024
@deining deining added taxonomy related to hugo taxomomies i18n Internationalization / Localization help wanted Extra attention is needed and removed bug Something isn't working needs-triage help wanted Extra attention is needed labels Sep 10, 2024
@deining
Copy link
Collaborator

deining commented Sep 10, 2024

The issue title is misleading: this is not a bug report, this issue is more like a question how to show taxonomies in the page header in a language different from English. This can be achieved via correct configuration parameters in your hugo.toml:

config in hugo.toml
...

Use this configuration instead:

# Comment out to enable taxonomies in Docsy
# disableKinds = ["taxonomy", "taxonomyTerm"]

# You can add your own taxonomies
[taxonomies]
标签 = "Plural form of 标签"
分类 = "Plural form of 分类"

[params.taxonomy]
# set taxonomyCloud = [] to hide taxonomy clouds
taxonomyCloud = ["tags", "categories"]

# If used, must have same length as taxonomyCloud
# taxonomyCloudTitle = ["Tag Cloud", "Categories"]
taxonomyCloudTitle = ["标签", "分类"]

# set taxonomyPageHeader = [] to hide taxonomies on the page headers
taxonomyPageHeader = ["标签", "分类"]

In the frontmatter of your pages, use this:

---
title: "Temperatura"
Plural form of 标签: [your categories]
Plural form of 分类: [your tags]
---

Then you should be see the page headers in Chinese as desired.
Does this resolve your issue?

@BrentHuang
Copy link
Author

BrentHuang commented Sep 11, 2024

thank you .

not resolved, and it looks weird and cumbersome.

Can't there be a taxonomyPageHeaderTitle? taxonomyPageHeaderTitle = ["标签", "分类"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n Internationalization / Localization taxonomy related to hugo taxomomies
Projects
None yet
Development

No branches or pull requests

2 participants