Liberty Unleashed

Scripting => Script Help => Topic started by: IdkanYavuk X on April 13, 2013, 12:35:40 am

Title: [SOLVED] System language detector
Post by: IdkanYavuk X on April 13, 2013, 12:35:40 am
Is there a built-in method for a script to know the system language of the OS that is running the server?
If it's not, how can I do it?

Thank you in advance
Title: Re: System language detector
Post by: SugarD on April 13, 2013, 01:31:32 am
Is there a built-in method for a script to know the system language of the OS that is running the server?
If it's not, how can I do it?

Thank you in advance
As far as I know, there is no scripted method for doing this, although I'm sure one could be added. It would just be a matter of getting the client to report the information to the server.
Title: Re: System language detector
Post by: Shadow. on April 13, 2013, 11:45:15 am
Ofcourse you can detect a language! Well, maybe not a system one, but still you can do it!

Take example of my A/D server, it detects your language and sends the correct messages ( only added principal languages for the countries theirselves, not any colonies, sigh )


All it takes is to get the country and then translate it inside the script. ( that's how I did it in my A/D Server )
Title: Re: System language detector
Post by: IdkanYavuk X on April 13, 2013, 05:13:08 pm
All it takes is to get the country and then translate it inside the script.
Can you explain me how to do something like that?
Thanks
Title: Re: System language detector
Post by: Shadow. on April 13, 2013, 08:14:28 pm
Make arrays for each language, store the texts there, and when someone connects, get country ( necesarily at join ) and message them.
Title: Re: System language detector
Post by: IdkanYavuk X on April 13, 2013, 10:35:34 pm
Make arrays for each language, store the texts there, and when someone connects, get country ( necesarily at join ) and message them.
How do I get the player's country? (sorry if there's too many questions :P)
Title: Re: System language detector
Post by: Shadow. on April 14, 2013, 12:29:32 am
You might aswell google, also, look on VC:MP unofficial forums. With few function renames, you can easily port VC:MP scripts to LU. You would need a MaxMind SQLite DB with the countries then get the country based on a math calculation (?, can't recall).

Not currently home, will post more details asap.
Title: Re: System language detector
Post by: SugarD on April 14, 2013, 03:39:50 am
Comparing countries to languages is a workaround, but if you get a multilingual user that is not from the same country as the language they use, you will run into issues.
Title: Re: System language detector
Post by: IdkanYavuk X on April 14, 2013, 04:04:46 am
You might aswell google, also, look on VC:MP unofficial forums. With few function renames, you can easily port VC:MP scripts to LU. You would need a MaxMind SQLite DB with the countries then get the country based on a math calculation (?, can't recall).

Not currently home, will post more details asap.
I found the post, thank you

Comparing countries to languages is a workaround, but if you get a multilingual user that is not from the same country as the language they use, you will run into issues.
That's why I'll only use English and Spanish