Rebuild says "no such locale exists"

AI 生成的摘要

The discussion revolves around issues with using a non-official language in Discourse, where a custom language (80% translated) is manually added via Transifex files. Glamdring explains that while the language can be set and used, rebuilding fails with a “no such locale” error when the custom language is the default. The workaround requires switching back to an official language before rebuilding, but the custom language is lost afterward, making configuration changes like SMTP updates cumbersome. codinghorror questions the translation’s validity, suggesting it may not have been properly submitted, but Glamdring clarifies the issue is not about submission but the need to use incomplete translations. Suggestions include allowing rebuilds without requiring a valid locale, using a host-based custom language folder, or skipping locale validation during database backups.

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.