How to have multiple language files in a project?

I am trying to implement i18n in my project specifically the nicksnyder/go-i18n/i18n package I am able to parse a json file with the translations, but I want to split my translations according to the section page and have multiple files not only one. For example, right now I have one file for whole the website with all the translations and it is getting huge.

So I need to split it into smaller files the problem is that I can’t name the files according to my needs I have to name it to like so: en-UE.json, en-AS.json, and so on. I want to name it to like validation.json, login.json and so on, but if I use these names I get an error and the file doesn’t parse correctly, sorry about my English and any help is welcome!

It looks like the i18n package uses language tags in the file name to identify the language of the translation. See documentation for LoadTranslationFile.

If you are using AddTranslation instead, then the file name does not mater.

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