HUGO

Multilingual and i18n

I’m creating a multilingual site and the site has around 20 pages. Now, each page has around 4 partials files, since it has a different structure.

My query is in /i18n folder can I create multiple language files wrt to pages? As the correct way is to have all the strings in a single en.yaml(or another format).

The problem I will face is /i18n/en.yaml file will have a lot of strings to manage in the future.

Or can you guys suggest for any other optimum solution ?

No. There is one translation file per language. You cannot have section- or page-specific translation files.

1 Like

While that is true, one can always outsource parts into Hugo modules and (at least) i18n files from root repo and module get merged. So depending on WHAT is in that en.yaml file you could outsource parts into modules. I am not proposing to have each single partial in its own module with its own translations, but if your site is that complicated and intrinsic why not give it a try?

Without knowing your exact layout and content structure we can only fish in the dark though.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.