How can badges and groups be localized (multilingual)?

Oh apologies, I need to correct my previous steps!

The site texts admin page (/admin/customize/site_texts) can only find keys that already exist in Discourse’s translation files. So unfortunately custom badge keys like badges.pokémon_master.name don’t exist there, and searching for them would return nothing (which is the issue you’re running into).

The screenshots I shared were from a setup where I created the translation entries via the Rails console. The admin UI steps I gave won’t work as written. Sorry about the confusion. What actually works if you have console access, you can create translation overrides for custom badges:

# the key pattern is: badges.{name_in_snake_case}.{name|description|long_description}
# e.g. for a badge called "Pokemon Master":
TranslationOverride.upsert!("zh_CN", "badges.pokemon_master.name", "宝可梦大师")
TranslationOverride.upsert!("zh_CN", "badges.pokemon_master.description", "你的描述")

Once created via console, the translation will appear in /admin/customize/site_texts and can be edited from there going forward.

If you don’t have console access, this currently not possible. Localizing custom badges isn’t supported yet as @awesomerobot had mentioned.

3 likes