PDA

View Full Version : Help with determining OS Language


fender4645
03-19-2004, 02:33 AM
Hi everyone-

I'm evaluating AMS 5 and I'm having some trouble determining the OS language. Basically, I want to determine if the OS language is Japanese and hide a button if it is. My programming skills are very limited to please be gentle :)

I understand that I can use the 'user_language = System.GetDefaultLangID;' function but I'm not sure how exactly I'm supposed to extract the data from the table. Any sample source code would really help out.

Thanks!

Intrigued
03-19-2004, 11:37 PM
Try this out (and then modify it to your needs):

--The decimal number 17 that would be returned on a Japanese 'default' language computer, is the Windows operating system language ID code

language_info = System.GetDefaultLangID();
if language_info.Primary == 17 then
Dialog.Message("Computer's Default Language Check...", "This computer's default language is: Japanese");
else
Dialog.Message("Notice...", "This computer does not have Japanese set as its default language!");
end




-- BELOW IS STRAIGHT FROM AMS 5's 'HELP' SECTION!

--Gets the primary and secondary language ID code and stores them in the table called "language_info."

--These values could be accessed by referencing language_info.Primary and language_info.Secondary.


Credit: Some goes to the AMS 5's (Pro for this example) 'HELP' section.

fender4645
03-20-2004, 03:20 AM
Thanks, Intrigued -- that helps out a lot. I had the same logic except I was only using '=' instead of '=='. By the way, how did you know wheather or not you should use the 'decimal' number instead of the hex number? Or could I use either?

Thanks!

Intrigued
03-20-2004, 08:11 PM
I felt that decimal would work because of using decimal values in other situations with regards to AMS 5.

The Hex should work as well though I have not tried such.

I am glad that we found a solution that works or helps find the actual solution your project needs!