So, I’m evaluating Grav as our new go-to CMS for small and medium Websites because it looks very promising. But I quickly ran into some issues regarding Multi-Language-Support.
I set Language Fallback on False but that doesn’t work. I’ve got 2 languages enabled and I created one page only in one of the languages and it appears in the menu in both languages. I assume this to be a bug. Or what did I miss?
The other Issue is in regards to Multi-Language-Content and the Admin Panel. Maybe the issue is, that that functionality is not quite there yet? If I create a new page in one language, then switch the language in the admin panel to the other language, I’m expecting to edit the version of the language I just switched to. But instead it’s just editing the original language. I don’t see a way in the panel to create other language versions for pages. I can only do that by creating files by hand. Is this functionality still missing or am I missing something else?
Thanks a lot
Hi, to hide a page on the other languages you need to create the pages for the other languages, but set as
The translations_fallback setting does not reflect on the menu, just on the page language.
As for the admin, after you create a page, you see on top beside the “Save” button an arrow. Click that, and you’ll see the option to save that page as another language. So once you create a page in english, for example, you can edit and save it as french.
When going back to the pages list, it’ll show the pages in the last selected language.
The admin panel does support multi-languages. There is a bug I just fixed to ensure the default lang is set on initial view, but the flag in the top right corner should let you change the language.
Ookay thanks! I didn’t see that new little icon next to the save button. Wouldn’t it be more logical to switch that around. Let’s say english is my main language. I create a few pages and then i want to create the french versions of it. So I click on the little button with the flag to change to the french language. After doing so the save button could directly say “Save in french” - That’s also the most likely thing I want to do … after all I switched to the french version.
Could have saved me from quite some confusion. On the edit-page I was also clicking that little purple “en” hoping I could change the language of the page there.
Furthermore it opens up possibilities to screw up. After writing for some minutes (or an hour) you just need to forget that you are still in the wrong language and click save -without clicking the little arrow first- to delete all of the original content.
Another more logical approach (in my opinion at least) would be to create pages in all available languages directly and put them to unpublished or invisible at first. Maybe even prefill them with original content when first saving the page.
I think, the way it is right now is the least logical and most confusing approach, in comparison to these two options at least.
And about that Fallback Option, what is it for exactly? Is it just for translatable strings from plugins and themes? Nothing related to the content? That’s not really clear in the documentation.
I don’t see it as confusing at all. It was created this way based on a diverse group of multilanguage Grav users and their input.
When you view your pages in admin, you see them as you would in your default language. You can change the language in top-right to see the pages in other languages. The purple badges show the language of the page. If a badge is in grey it means that the active language doesn’t exist and this would be the fallback language.
When you click on a pariticular page (in a particular language), you can easily change to other language versions if they exist by clicking on the purple language dropdown. If they don’t exist, you can simply ‘save-as’ one of those other languages, and then edit/translate as need be.
There are situations where you only want to translate a few pages, but not every one. Creating a blank page for each language would force you to translate every page, and fallbacks would not work.
Regarding fallback, it just means that if you are in french pages
fr of your site, and a particular page doesn’t exist (
somepage/de fault.fr.md), it will fallback and use the next highest priority language it can find, (eg
Well, I guess it also depends on what you are used to and how you expect it to work. I didn’t get it. I might have understood it if I would have noticed that little arrow next to the save button. Thanks for clearing things up.
Sadly, I still don’t get the fallback. I turned the fallback of and I create a new page in one language only. That page still show’s up on the other language version of the website. Isn’t that something that should only happen with fallback turned on?
translations_fallback is only intended for translation of text strings. So that is mostly going to be used by themes with language files, or plugins. More in the docs
For a page, you should follow @flaviocopes suggestion and create a page in the language you don’t want to support, and set
published: false so it is skipped.
Okay, everything is very clear now. Thank you for your quick and extensive replies. Hopefully it will be useful for somebody else as well.
BTW if you think that the docs can be improved or added to, please feel free to click the link in the top right of any doc page, and submit your changes.
Sometimes its hard to write docs when you develop the code because we sometimes miss things that seem obvious to us, but are clearly not for others.