Why can't zh_CN content be translated to zh_TW?

AI-generated summary

joo reports an issue on a self-hosted Discourse instance where content written in Simplified Chinese (zh_CN) is not being translated to Traditional Chinese (zh_TW), despite both locales being supported. While English translations function correctly, zh_TW shows zero translated posts, with only a subset marked as eligible.

The user identifies the root cause in the source code: LocaleNormalizer.is_same? compares only the base language code before the underscore, treating zh_CN and zh_TW as identical. Consequently, PostLocalizer.localize returns early, and PostCandidates.needs_localization excludes zh targets for sources with a zh base. Additionally, Localizable#in_user_locale? assumes zh_TW readers already understand zh_CN content.

joo asks whether this merging of Simplified and Traditional Chinese is intentional and seeks either a supported method to serve Traditional Chinese for Simplified content or a change to make locale matching variant-aware.

Self-hosted Discourse 2026.10.0-latest, content_localization_supported_locales = zh_TW|en|zh_CN, default_locale = zh_CN, posts written in Simplified Chinese.

English translations work fine (Admin → Plugins → AI → Translations: en 17/23 posts). Traditional Chinese gets nothing: zh_TW shows 0 translated, and only 5 posts are even “eligible” although the site has 23.

From the source, it looks like LocaleNormalizer.is_same? compares only the part before the _, so zh_CN and zh_TW are treated as the same language: PostLocalizer.localize returns early, and PostCandidates.needs_localization drops the zh target for posts whose source base is zh. The same check in Localizable#in_user_locale? also means a zh_TW reader is considered to already understand the zh_CN source.

So: is merging zh_CN and zh_TW intentional? If so, is there any supported way to serve Traditional Chinese for Simplified content? If not, could locale matching become variant-aware for these two?