Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Localization issue with blog components

Started by Hugo 9 years ago · 2 replies · 1757 views
9 years ago

Hi!

I'm a French Grav user and currently building a "french-only" website with a blog components.

My site.yaml is set to 'fr' and I don't want to use the Multi-Language feature, because I would like to avoid such a http://website.example.fr/fr URL.

However, it seems impossible to display blog dates (short month), and sidebar widgets in French... :(

Must I use the Multi-Language feature? Or is there a workaround?

Regards,
Hugo.

9 years ago

Hi @HugoS,

maybe this entry /forum/themes-styling/how-to-correctly-set-a-default-language-t1356?u=renards can help you to configure your site without the language code in the URL.

If you want to set the date in the corresponding language there is a reference in the documentation : https://learn.getgrav.org/content/multi-language#translation-via-twig.
If that does not work you can create a Twig partial with the month translations and include it in your template.

9 years ago

Thank you, @renards!

I simply missed this setting while building my user/config/system.yaml:

include_default_lang: false

It was set to true... Now, I have dates and labels in French and no /fr in my address bar. 😀

Suggested topics

Topic Participants Replies Views Activity
Support · by TomW, 2 weeks ago
8 227 8 hours ago
Support · by alex, 2 months ago
8 667 23 hours ago
Support · by Supple, 5 days ago
1 98 1 day ago
Support · by TomW, 1 week ago
3 159 3 days ago
Support · by TomW, 6 days ago
2 106 5 days ago