Folder structure of a multilang site

Hey everyone,

I want to setup a Multilanguage website with Grav and even though I read the docs I’m still not sure how to it. I’m basically going to have three languages - English, Japanese and Korean and to keep it all organized I would prefer to keep every language in its own folded.

I understand that my URLs will look like this when enabling the multilanguage feature:

mysite.com/en
mysite.com/jp
mysite.com/en

But instead of having Grav automatically create these language specific extensions I want them to actually be folders so my file structure would look like this:

Screenshot (11)

I might not provide every post in every language so this would make things a bit easier I guess.

How can I set up Grav so that for example someone from Japan will automatically be redirected to mysite.com/jp and only see the pages which are in that folder?

Basically you can do things that way, but you would not be using Grav’s multilang support at all.

You would simply be using the default page routes to support your languages. Just ensure you don’t actually enable the languages.supported: options in the config.

I don’t really advise this approach though. There is a lot of functionality in our multilang support that involves falling back to a non-translated page, not to mention performance enhancements because only one languages set of pages is loaded at any time. Your approach would mean all languages are loaded all the time. If your site gets larger, this could result in performance issues.