Page 1 of 1

Problems with getsystemlanguage and getsystemcountry

Posted: Tue Aug 12, 2014 11:35 pm
by evil
Hello!
I have different amigaguide-files for my program. One for each available language.
I want to include online-help. So if the user hits the help key, or selects the help-menu, the amigaguide according to the userlanguage should open.

So I wanted to use getsystemlanguage() or getsystemcountry() to get the users language and include the according string into the path to the amigaguide-file.

Example code:

Code: Select all

nprint ("Country: "..getsystemcountry().."\nLanguage: "..getsystemlanguage()) waitleftmouse()
But instead of telling me my country(Germany) and language (german), it displays:
Country: 9 Language: 1

Can anyone explain this to me??

Regards

George

Re: Problems with getsystemlanguage and getsystemcountry

Posted: Wed Aug 13, 2014 3:57 pm
by Allanon
taken from the user-guide:
Name
GetSystemCountry -- retrieve current user's country (V5.0)
Synopsis
cntry = GetSystemCountry()
Function
This function can be used to retrieve the country setting of the current system. The following countries are currently supported:
#COUNTRY_ANDORRA
#COUNTRY_AUSTRALIA
#COUNTRY_AUSTRIA
#COUNTRY_BELGIUM
#COUNTRY_BRAZIL
#COUNTRY_BULGARIA
#COUNTRY_CANADA
#COUNTRY_CZECHREPUBLIC
#COUNTRY_DENMARK
#COUNTRY_FINLAND
#COUNTRY_FRANCE
#COUNTRY_GERMANY
#COUNTRY_GREECE
#COUNTRY_ICELAND
#COUNTRY_IRELAND
#COUNTRY_ITALY
#COUNTRY_LIECHTENSTEIN
#COUNTRY_LITHUANIA
#COUNTRY_LUXEMBOURG
#COUNTRY_HUNGARY
#COUNTRY_MALTA
#COUNTRY_MONACO
#COUNTRY_NETHERLANDS
#COUNTRY_NORWAY
#COUNTRY_POLAND
#COUNTRY_PORTUGAL
#COUNTRY_ROMANIA
#COUNTRY_RUSSIA
#COUNTRY_SANMARINO
#COUNTRY_SLOVAKIA
#COUNTRY_SLOVENIA
#COUNTRY_SPAIN
#COUNTRY_SWEDEN
#COUNTRY_SWITZERLAND
#COUNTRY_TURKEY
#COUNTRY_UK
#COUNTRY_UKRAINE
#COUNTRY_UNKNOWN
#COUNTRY_USA
You have to check the returned value against these constants to identify the user's country, the same applies to getSystemlanguage() function :)

Re: Problems with getsystemlanguage and getsystemcountry

Posted: Thu Aug 14, 2014 1:31 am
by evil
So I have to check the system-language against all those constants?? isnt that a bit complicated???
Or is there an easier way (function), to solve this??
It is simplay getting annoying to check the language against all those constants...


Edit: okay. It isnt that complicated... Thanks for your help!!

Best regards, George