Author Topic: [SOLVED] System language detector  (Read 3756 times)

IdkanYavuk X

  • Jr. Member
  • **
  • Posts: 91
  • Karma: +37/-36
  • Developer for The Newport Experience
    • View Profile
[SOLVED] System language detector
« 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
« Last Edit: April 14, 2013, 07:38:49 am by IdkanYavuk »

SugarD

  • Asshat Gaming Founder
  • Tester
  • Sr. Member
  • ****
  • Posts: 820
  • Karma: +37/-75
  • STOP IN THE NAME OF THE COLESLAW!
    • View Profile
    • Clan Xperience
Re: System language detector
« Reply #1 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.

Shadow.

  • Tester
  • Full Member
  • ****
  • Posts: 144
  • Karma: +16/-35
    • View Profile
Re: System language detector
« Reply #2 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 )

IdkanYavuk X

  • Jr. Member
  • **
  • Posts: 91
  • Karma: +37/-36
  • Developer for The Newport Experience
    • View Profile
Re: System language detector
« Reply #3 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

Shadow.

  • Tester
  • Full Member
  • ****
  • Posts: 144
  • Karma: +16/-35
    • View Profile
Re: System language detector
« Reply #4 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.

IdkanYavuk X

  • Jr. Member
  • **
  • Posts: 91
  • Karma: +37/-36
  • Developer for The Newport Experience
    • View Profile
Re: System language detector
« Reply #5 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)

Shadow.

  • Tester
  • Full Member
  • ****
  • Posts: 144
  • Karma: +16/-35
    • View Profile
Re: System language detector
« Reply #6 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.

SugarD

  • Asshat Gaming Founder
  • Tester
  • Sr. Member
  • ****
  • Posts: 820
  • Karma: +37/-75
  • STOP IN THE NAME OF THE COLESLAW!
    • View Profile
    • Clan Xperience
Re: System language detector
« Reply #7 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.

IdkanYavuk X

  • Jr. Member
  • **
  • Posts: 91
  • Karma: +37/-36
  • Developer for The Newport Experience
    • View Profile
Re: System language detector
« Reply #8 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

 

© Liberty Unleashed Team.