tomfran / typo

A simple Hugo theme
https://tomfran.github.io/
MIT License
247 stars 76 forks source link

Translation for static text #9

Open tomfran opened 4 months ago

tomfran commented 4 months ago

Motivation

As of now, all the static text in the theme is in English. Having different translations would be better for non-english websites.

The static text include:

Wanted result

I don't like the idea of a translation menu for Typo, but I want people to be able to specify a language in their config to use.

The expected result would be something like:

hugo.toml

[params]
language = 'en | it | de | ...'

With the website using the appropriate strings for this set language.

Ref: https://gohugo.io/content-management/multilingual/

kyagi commented 4 months ago

If you need a Japanese translation, it will be

Have a nice day! :-)

zeeshanthedev590 commented 3 months ago

so basically there should be a way to translate the text , given that the developer writes it in english?

jpvg10 commented 1 day ago

I created a little PR (#50) to add translation for dates.

Not sure what's the best way to go for the others, but maybe translation tables? Or maybe even data sources.

runofthemillgeek commented 16 hours ago

@jpvg10 translation tables looks like the right approach given what @tomfran also mentioned for other hardcoded static text in the template.

I'm interested in having good localization support for this theme too as I intend to have a separate section for Japanese posts next year to help with my learning. Would be nice to see Typo all ready for it before that :)

Hugo also has support for multilingual mode but IDK if that needs additional work.

For now this issue can be scoped for supporting translations when choosing the default site language.