Solved How to get server localization language (and player localization too) ?

Discussion in 'Plugin Development' started by TrainYourBrain, Aug 19, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    TrainYourBrain

    Hi guys,

    I am looking for a way to get the server localization language and also the player localization (en, us, es, fr, de, etc...).
    Does something like player.GetLocalization() exists ?

    Thanks in advance.
     
  2. TrainYourBrain
    I guess you could use the server's non-domain ip address to get where it's hosted at, and player ips to see where they live at.
     
  3. Offline

    TrainYourBrain

    Assist Thanks for you advices, I know how to get the Player ip, but what is the relation between IP and country ?
    I mean... what is the process to get the country "related" to an ip ?

    Thanks ;)
     
  4. TrainYourBrain
    You could use a site like freegeoip.net, which returns a file with information about where the ip is located at, then make the plugin read the country. This might be a bit hard though, since it requires quite a few things to be done.

    Another thing you could use is a CSV.
    http://www.javaranch.com/journal/2008/08/Journal200808.jsp#a2

    As far as I know, Java doesn't have an easy way of getting location of ip address, unfortunately.
     
    TrainYourBrain likes this.
  5. Offline

    TrainYourBrain

    Assist
    Thanks a lot, I will deal with the solutions you gave me.
     
Thread Status:
Not open for further replies.

Share This Page