When the user's locale does not exactly match the locale of the relevant translation, Ruffle defaults to US English for core text strings instead of using the most closely matching translation. For example, if the user's locale is ko, core strings are displayed in English because our Korean translation uses the ko-KR locale. Making matters worse is that on web, only the user's top preferred language is considered (navigator.language), when we should be considering all preferred languages (navigator.languages). For most Korean users, the navigator.language value seems to be ko.
You can see the problem for yourself by following these steps:
When the user's locale does not exactly match the locale of the relevant translation, Ruffle defaults to US English for core text strings instead of using the most closely matching translation. For example, if the user's locale is
ko
, core strings are displayed in English because our Korean translation uses theko-KR
locale. Making matters worse is that on web, only the user's top preferred language is considered (navigator.language
), when we should be considering all preferred languages (navigator.languages
). For most Korean users, thenavigator.language
value seems to beko
.You can see the problem for yourself by following these steps:
When "Korean (South Korea)" (ko-KR) is selected instead, the context menu appears as expected:
To fix this problem we need to:
navigator.languages
instead ofnavigator.language
ui.language
toui.languages
(make it a vec type)core_text
andcore_text_with_args
functions take a vec of languages