Multilingual and Multi-country site

I am working on making my site international and I want to be able to have the country code and language code in my base url.

If I create separate config files per different country and set the base url to include the country code, what would the name of the config file be? I tried this and I belive Hugo is expecting the language code in the name of the config file.

Tried: config_us.yaml -> cannot find config file

I also tried having separate content files per country but it puts the country code after the language code in the url.

Alternatively, is there a way to have a variable in my baseurl?

1 Like

yep i have a similar request. if i have a multi lang site setup why can’t i goto and

when I have pages defined in both languages

The config file guessing does not work.

Languages is defined inside ONE config file (you can supply more than one config file, but they are all merged).

The key in the language definition (which will match any translations in /i18n) is expected to be a language code, but can be anything – but I doubt it will work with “us/en”, but you can try.

I don’t want to derail the thread here but: wow ! It is not mentioned in the doc and could be a big game changer to add layers of configuration for specific env on top of a common default configuration. Can you point me to a commit related to this so I can learn more ?

I found this pretty quickly using the GitHub search:

If it is not in the docs, I would appreciate if someone would add it.

1 Like