Skip to content

Render numbers according to the locale #13862

@farooqkz

Description

@farooqkz

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

$ hugo version
hugo v0.148.0+extended+withdeploy linux/amd64 BuildDate=unknown

Does this issue reproduce with the latest release?

Haven't checked but probably does.

Summary

In my template, when I try to render a number, it renders a Western number even though the website language is Persian(fa). A live example is my own website in the category page:

https://blogfa.farooqkz.com/categories/

The code to render them is here:

https://codeberg.org/farooqkz/hugo-vitae/src/branch/main/layouts/_default/terms.html#L16

I also have come across this post on Discourse where a forum mod says it's not a bug. Bug or not, this behavior is disturbing. I would expect that when my website language is Persian, it also renders Persian numbers.

https://discourse.gohugo.io/t/how-to-translate-numbers-to-hindu-arabic-numeral-system/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions