Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Localization issue with blog components

Started by Hugo 9 years ago · 2 replies · 1164 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 stell, 7 days ago
5 238 10 minutes ago
Support · by gravinator, 1 month ago
5 453 2 hours ago
Support · by Gravver, 2 weeks ago
6 280 1 week ago
Support · by Marcel, 4 weeks ago
2 338 1 week ago
Support · by blu3prince, 2 weeks ago
1 255 2 weeks ago