Problems with getsystemlanguage and getsystemcountry

Discuss any general programming issues here
Post Reply
evil
Posts: 185
Joined: Mon Jun 14, 2010 1:38 pm

Problems with getsystemlanguage and getsystemcountry

Post 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
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Problems with getsystemlanguage and getsystemcountry

Post 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 :)
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
evil
Posts: 185
Joined: Mon Jun 14, 2010 1:38 pm

Re: Problems with getsystemlanguage and getsystemcountry

Post 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
Post Reply