welpo / tabi

A modern Zola theme with search, multilingual support, optional JavaScript, a perfect Lighthouse score, and a focus on accessibility.
https://welpo.github.io/tabi/
MIT License
97 stars 32 forks source link

Suggestion: singularize count-per-tag (in Tags listings) to read "1 post" instead of "1 posts" #349

Closed metaleap closed 2 days ago

metaleap commented 2 days ago

The basic idea: see title =)

To clarify the current situation:

image

welpo commented 2 days ago

Is this the /tags/ page? It works on the demo: https://welpo.github.io/tabi/tags/

metaleap commented 2 days ago

Yes it is! That's so odd, has this been a very recent fix? I think my tabi copy is from about half a week, less than a week ago..

Anything missing in the config.toml, per chance?

(...)
taxonomies = [{ name = "tags", feed = false }]
(...)
menu = [
    { name = "Blog", url = "blog", trailing_slash = true },
    { name = "Topics", url = "tags", trailing_slash = true },
    { name = "CV", url = "cv", trailing_slash = true },
]
(...)
welpo commented 2 days ago

has this been a very recent fix?

Nope. The current pluralisation method was added with #277, four months ago.

metaleap commented 2 days ago

Oh, interesting pointer! I do have a custom ./i18n/en.toml with a single line all_tags = "Blog post tags:". And guess what — when I disable it (renaming folder temporarily), the "1 post" show up correctly...

welpo commented 2 days ago

As per the docs, you should copy the entire file and then customise it. I know it's not ideal, but there's no better way to do this right now.

If you copy the entire file and add/replace a string, everything should work as expected. The caveat is that future tabi updates which change i18n will require you to update the i18n files (or rely on the fallback strings, which work except for pluralisation).

metaleap commented 2 days ago

Oh crikey, guess I missed that part! Thanks... would really be preferable if these toml file overrides would be merged on the fly, but I guess that's a Zola thing not a Tabi thing. Merci then!

welpo commented 2 days ago

Yeah, it's unfortunate. The current i18n setup is a huge hack and not how translations are supposed to work, but it's much better than the default setup.