Ernst wrote: ↑
Sat Feb 29, 2020 4:45 pm
That is the exact problem: it is all about formats, not about the languages of the text in a display object.
But it is about language! GetUserDefaultLangID() returns language code
for those settings! Something like "en_US" or "de_DE" in a 32 bit encoded value (you can check that by running "usbimager.exe -v"), and not the format string. Now why do you set this in a number format settings panel is beyond my comprehention...
Ernst wrote:Unfortunately this affects the time format, my mind works internationally and gets a SEGFAULT on the display of AM/PM (and maybe on the date format set to MM/dd/yy instead of the proper dd.MM.yyyy format).
Hahaha, you are wrong the correct format is yyyy-mm-dd
Okay, I can totally understand why don't you want English dates. Putting the day in the middle is a complete lack of any logic.
Ernst wrote:To me that looks like a reasonable solution.
Okay, I'm glad I've found a solution for you! Hopefully this is universal enough to solve other's potential issues with language as well.
Now I've also found GetUserDefaultUILanguage
too (which was never returned by the search engine until now). This function should return exactly the same code as the LangID(), but for the Control Panel's Language tab. I could try to use this instead, it sounds much more like what I actually need anyway. (According to the linked doc, there should be a language option, but you say you don't have user language option on the Control Panel):
The user UI language determines the user interface language used for menus, dialog boxes, help files, and so forth. It can be set by the current user in the Language tab of the regional and language options portion of Control Panel.
If you don't mind, I'd like to give it a try tomorrow. If you can change the locale to German but keep the language in English with this, that would be the best. (I'll keep the command line option regardless)
EDIT: I've tried (under Win7). With GetUserDefaultUILanguage() it always returns the system language, and there's no way to change that from the Control Panel. I don't have a Language tab either. (Also missing from the screenshot below which I took from a Windows Help forum)
However if I use GetUserDefaultLangID(), then it returns the language set on the Control Panel > Region and Language > Formats > Format
So I think I'll keep this version for now. You can set this "Format" to English, and then specify date formats differently (dd.mm.yyyy and 24 hours clock for example), that works too.