Have you ever wondered why a translated string isn’t used by Discourse? Is Discourse showing wrong numbers and dates when a locale other than English is used? Are you seeing “Invalid Format” errors in some parts of Discourse?
It’s quite likely that an error in some translations is causing those problems. There’s a rake task that lists all problems found for a specific locale. You can run it inside your Docker container as well as in your development environment by executing the following command:
rake i18n:check[locale]
# replace "locale" with the short name of the language, e.g. "bg" for Bulgarian
The output for Bulgarian currently looks like this:
Are you curious about errors in all locales? Simply run rake i18n:check
without the [locale]
parameter…
How can I fix those errors?
-
Visit Transifex and select the correct language and resource.
-
Search for the problematic translation by using the
key:
filter.
Why are there so many “Missing interpolation key” errors?
Some languages should always use the %{count}
variable in pluralized strings. The rake tasks knows about them and always prints an error when that variable is missing. See Always use %{count} variable when translating pluralized strings for more about that.
How can I fix Message Format errors?
Translating Message Format can be a bit tricky, but there’s a pretty good topic that should get you started: Message Format support for localization