YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
22 stars 8 forks source link

In-Game: [Windows] os_get_language() and os_get_region() incorrectly read from Windows date and time formatting #1663

Open cameron-home opened 1 year ago

cameron-home commented 1 year ago

Description

The os_get_language() and os_get_region() functions both read from the Windows date and time formatting session, despite the names of the functions implying that they will read from the Language and Region preferences.

os_get.zip

Expected Change

It is expected that os_get_language() and os_get_region() will read from Windows language and region preferences, as opposed to date and time formatting

Steps To Reproduce

  1. Open Windows Date Time and Regional settings
  2. Set 'Country or region' to Germany
  3. Set Regional format to English (United States)
  4. Start GameMaker
  5. Open attached project
  6. Run game
  7. Read Output
  8. Observe that language is set to English and Region is set to US Repro: 100%

How reliably can you recreate this issue using your steps above?

Always

Which version of GameMaker are you reporting this issue for?

2023.8 (Monthly)

Which platform(s) are you seeing the problem on?

Windows

Contact Us Package Attached?

Sample Project Added?

rwkay commented 1 year ago

On Windows we are returning the value from the GetLocaleInfo (see https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getlocaleinfoa) function and the constants for https://learn.microsoft.com/en-us/windows/win32/intl/locale-siso-constants

os_get_language() - LOCALE_SISO639LANGNAME os_get_region() - LOCALE_SISO3166CTRYNAME

It is a complicated topic though and not as simple as it seems at first sight.