osu-framework icon indicating copy to clipboard operation
osu-framework copied to clipboard

The default user language should be taken from the system language

Open Theighlin opened this issue 2 years ago • 3 comments

Theighlin avatar Apr 21 '22 06:04 Theighlin

I think this is pretty important to get working. Bit of an oversight until now.

peppy avatar Apr 21 '22 06:04 peppy

I did some work about this several days ago. Things to mention:

  • The framework sets default locale config to empty string. This sets CurrentCulture to neutral and overrides any user preference.
  • The game doesn't handle variations of culture. The system default culture is usually with country/region code (en-US, zh-CN etc), but in osu we use non country/region code version (en, zh). It should use culture parent chain instead of string StartsWith, to handle complex scenarions like zh-CN -> zh-Hans -> zh.

huoyaoyuan avatar Apr 21 '22 06:04 huoyaoyuan

If it helps I can provide the fallback logic stable is using for deciding which culture to set. I know it does something similar to what you are proposing here.

peppy avatar Apr 21 '22 07:04 peppy

Fixed in https://github.com/ppy/osu-framework/pull/5505. But do note that the language is taken from the date and time format, and not the system UI language.

Susko3 avatar Nov 10 '22 22:11 Susko3