Home   Help Search Login Register  

Author Topic: How to detect the language of ArmA by script?  (Read 884 times)

0 Members and 1 Guest are viewing this topic.

Offline Goullou

  • Members
  • *
How to detect the language of ArmA by script?
« on: 14 Apr 2008, 16:07:55 »
Hi there,

Does someone know a way to detect the language of ArmA currently used by a player in multi?
I already know all about the "localize" command and the "stringtable.csv" to localize the strings in different language but i would like to run different things in a script depending of the player language.
Is there a command returning the current selected language?

All ideas welcome...
Si vis pacem, para bellum.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: How to detect the language of ArmA by script?
« Reply #1 on: 14 Apr 2008, 16:52:38 »
hmm! Good question. Have you tried this:

Code: [Select]
_string1 = format ["%1", localize "STR_YourString"]; if (_string1 == "This is the English string") then {hint "English!"}; if (_string1 == "Tämä on suomenkielinen stringi") then {hint "Finnish!"}
AFAIK, localize "whatever" should return a simple string. I don't see any reason why you couldn't run a string-comparison to see what language is being run. You just gotta try it! Add two languages to your stringtable.csv, then try changing the language in the menu between tries. :)

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"