Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to get player's language?

Comments in 'Plugin Development' started by Lexo, Apr 23, 2016.

  1. Lexo
    Offline

    Lexo New Member

    Joined:
    May 25, 2015
    Posts:
    19
    Minecraft User:
    Lexo
    How to know language which setted in MCPE client? I know it using for TranslationContainer, but I don't understand how it works.
  2. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    e.g. send him list of all supported languages to select and then wait for reaction
  3. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Thats an alternative but not right answer. He wants to get property from MCPE client settings.
    applqpak likes this.
  4. Lexo
    Offline

    Lexo New Member

    Joined:
    May 25, 2015
    Posts:
    19
    Minecraft User:
    Lexo
    You mean player chooses lang? I don't need that
  5. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    You can't get player's language from MCPE settings, yet.
    applqpak likes this.
  6. Lexo
    Offline

    Lexo New Member

    Joined:
    May 25, 2015
    Posts:
    19
    Minecraft User:
    Lexo
    But how TranslationContainer works? And how it gets the player's language?
    Last edited: Apr 23, 2016
    applqpak likes this.
  7. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    TranslationContainer is server side.
  8. Lexo
    Offline

    Lexo New Member

    Joined:
    May 25, 2015
    Posts:
    19
    Minecraft User:
    Lexo
    Yes :/ .Ohhh. If I enter non-existent command, it's show me message in lang, which setted in MCPE settings. Then, if I logout server, and change lang to another, lang of message change to another (in the lang that I chose). So, TranslationContainer or somesing else get MCPE client language. But I don't understand how. So I need to learn how it works.
    Last edited: Apr 23, 2016
    applqpak likes this.
  9. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Umm, okay.. In that case I'm wrong. Let me investigate this
    applqpak likes this.
  10. Lexo
    Offline

    Lexo New Member

    Joined:
    May 25, 2015
    Posts:
    19
    Minecraft User:
    Lexo
    OK. Thanks in advance))
    applqpak likes this.
  11. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    Yes, I am also interested to know how to use TranslationContainer.
  12. Lexo
    Offline

    Lexo New Member

    Joined:
    May 25, 2015
    Posts:
    19
    Minecraft User:
    Lexo
    Well, how are things?
    applqpak likes this.
  13. jojoe77777
    Offline

    jojoe77777 Notable Member Plugin Developer

    Joined:
    May 28, 2015
    Posts:
    653
    Plugins:
    1
    Minecraft User:
    jojoe77777
    How TranslationContainer works is it sends the message type and some variables if needed. Example:

    Unknown command: Server sends "commands.generic.notFound" in a TextPacket with the type TYPE_TRANSLATION (2).
    Joined the game: Server sends "multiplayer.player.joined" in a TextPacket with the type TYPE_TRANSLATION, and adds the player name to $parameters.

    So the server never knows what language the client is using.
    Vaivez66 and applqpak like this.
  14. Lexo
    Offline

    Lexo New Member

    Joined:
    May 25, 2015
    Posts:
    19
    Minecraft User:
    Lexo
    OK. So how I can to use this for my own plugins?
    applqpak likes this.

Share This Page

Advertisement