Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Localization issue with blog components

Started by Hugo 9 years ago · 2 replies · 858 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 Thomas, 1 week ago
2 60 15 hours ago
Support · by Anna, 3 days ago
2 66 18 hours ago
Support · by Justin Young, 19 hours ago
1 33 19 hours ago
Support · by Duc , 1 week ago
2 69 6 days ago
Support · by Colin Hume, 1 week ago
2 61 6 days ago