Rebuild says "no such locale exists"

In case one wants to use a language that is not in the official list, but is, let’s say, at 80% at Transifex (which is my case), there is no good way to use it.

Downloading and renaming the files from transifex is tedious, but I guess it’s the same for every new language. The other issue is you have to manually copy the files to the discourse docker instance (it won’t make sense to make a PR, because it is not fully translated yet).

Then you have to switch language, rebuild assets, and it works (which isn’t documented in one place). However, there are two major issues:

  • you can’t rebuild when a non-standard language is set as default. The rebuild command complains that “no such locale” exists. You have switch back to an official language and only then rebuild
  • after the rebuild, the custom language is gone, so you have to again manually copy the files, rebuild assets, switch configuration.

The latter wouldn’t be such a problem, if you didn’t have to rebuild for, say, smtp server change. Now on every such configuration change you have to go through the whole process.

I think this should be somehow simplified - a few ideas: don’t require rebuild for simple configuration change; have a “custom language” folder in /var/discourse in the host machine which doesn’t have to be in git, from which the language files are picked and deployed on every rebuild; don’t fail the database dump on rebuild if “no such locale” exists

I think there is a severe error in the translation. Rebuilding works fine in other languages.

Perhaps the “error” is that this language wasn’t properly submitted to the project?


The thing is - I shouldn’t add the translations to the project, as they are not 100% ready (around 80%). Yet I want to use them (they cover almost all of the user-facing part). So I just copied the files. They were recognized by discourse and I successfully switched to the newly copied language. However rebuilding fails, I think in a database backup phase.