MultiLanguagePlugin

Dec 20, 2016
MultiLanguagePlugin
  • MultiLanguagePlugin - Documentation EN

    Sends the same message on different languages... Hooks into all plugins!




    Installation(top)

    1. Download the JAR file on the plugin page (you'll be charged one time; updates are free).
    2. Stop your server (if running)
    3. Upload/move it to your /plugins folder
    4. Start your server
    5. Edit the config as you'd like to (located at /plugins/MultiLanguagePlugin/config.yml)
    6. Do /mlp reload
    7. Edit your language files, located at /plugins/MultiLanguagePlugin/languages
    8. Do /mlp reload
    9. Edit the messages on other plugins to the defined placeholders (see below) and reload that plugin.
    10. Enjoy your multi-language server :D

    Configuration(top)

    Having trouble configuring the plugin? Take a look here!

    Placeholders(top)

    I've been talking about placeholders all this time, let me explain what they are now.
    If you want to use MLP with other plugins (if they don't have compatibility with it), you need to use placeholders to tell MLP what to translate.
    This is a simple placeholder:
    This will be replaced with the message on your language file, and maybe be different for each plugin. Let me make an example:

    Advanced Placeholders(top)

    Advanced placeholders are dynamic messages. Imagine a death message: "Notch died."
    We need to change "Notch" to the player name. That's why we have variables. On the language file, it will be something like
    If you need more than one placeholder, just increase the number:
    In-game, it will be something like

    Placeholders composition(top)

    Using the advanced placeholder above:

    [lang] -> Start of the placeholder
    killed -> Message Code on the .language file
    [args] -> Start of the args section (optional)
    [arg]
    -> Start of an arg
    Notch
    -> The first argument value; will replace %1 on the .language file
    [/arg] -> End of an arg
    [arg] -> Start of an arg
    Jeb
    -> The second argument value; will replace %2 on the .language file
    [/arg] -> End of an arg
    [/args]
    -> End of the args section
    [/lang] -> End of the placeholder


    Note: All placeholder names can be changed, so you can avoid conflict issues.

    Files and Storage(top)

    MLP offers two type of storage: YAML and SQL.
    The storages are only used to store the players' language.

    You can easily switch between them using the config. Here is the default config.yml:
    Code (YAML):
    sql:
       # Change to true if you want to use a database.
        # You should have the credentials setup below.
        enabled
    : false
        # The URL of your database (normally it's localhost)
        host
    : localhost
        # The port of your database. The default sql port is 3306
        port
    : 3306
        # The database name
        database
    : minecraft
        # The username
        username
    : root
        # The password
        password
    : ''
    languages
    :
       # The language name. This will influence the language file name.
        # i.e. If the name is en_UK, the language file name will be located at languages/en_UK.language
        # It's also not recommended to change this after someone join your server,
        # as the name is saved with the player.
        en_GB
    :
           # This is the encoded flag code to show up the banner.
            # To get a working code, you should visit http://www.needcoolshoes.com/banner and create your banner.
            # When you finish, you should notice that the link as changed. Just copy the code generated by it.
            # i.e. If the link is http://www.needcoolshoes.com/banner?=eapwplpnpmbzbj then the code will be eapwplpnpmbzbj
            flag
    : eapwplpnpmbzbj
            # The Minecraft code is the Minecraft language code. You can found a complete list here:
            # http://minecraft.gamepedia.com/Language
            minecraft-code
    : en_GB
            # This display name. This will be the language name in non-code version. For example, en_UK should be English (UK)
            # Feel free to use colours here! You shouldn't use per-language here, as item names aren't translated yet.
            display-name
    : '&aEnglish (UK)'
        pt_PT
    :
            flag
    : bacLlt
            minecraft-code
    : pt_PT
            display-name
    : '&aPortuguese (Portugal)'
    # The main language is the fallback language. If some message is not found, it will try to get it from here before
    # returning an error message.
    # Also, if you delete any language, the players with that language will have their language changed to this.
    main-language
    : en_GB

    # Do not change this if you don't know what you're doing.
    language-creation
    :
        syntax
    : lang
        syntax-args
    : args
        syntax-arg
    : arg
        # Select what language checks are enabled. The API can't be disabled (yet).
        enabled
    :
           # Should the plugin check chat messages?
            chat-messages
    : true
            # Should the plugin check actions bars?
            action-bars
    : true
            # Should the plugin check titles?
            titles
    : true
            # Should the plugin check GUIs?
            guis
    : true
            # Should the plugin check scoreboards?
            scoreboards
    : true
            # Should the plugin check holograms (and/or entity display names)?
            # Normally the most recent plugins use armor stands to make the holograms, but if they don't, you can change it here.
            # Also, you can also translate other's entities name, like villagers. Add their entity type on the list below.
            # Full list: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/EntityType.html
            holograms
    :
               - ARMOR_STAND
            # If true, the plugin will ignore the list above and translate all entities.
            holograms-allow-all
    : false
            # Should the plugin check kick messages?
            kick
    : true
            # Should the plugin check tab header and footer?
            tab
    : true
            # Should the plugin check for item names and lores on GUIs?
            items
    : true
            # Should the plugin check for item names and lores on player inventories?
            # It's no recommended to enable this unless you're on lobbies where players can't share items.
            # Requires "items" enabled
            inventory-items
    : false

    Every language has a .language file. This is the format of the file:
    Code (Text):
    hello = Hello %1!
    hello.others = %1 says hello to %2!
    help = Need help? Do /help!
    As you can see, the file has the format of
    Code (Text):
    key = value
    which makes it good for human reading.

    Commands(top)

    • /multilanguageplugin
      • Aliases:
        • /mlp
        • /ml
        • /multilanguage
        • /language
        • /lang
      • Description: The main command of MultiLanguagePlugin. If no sub command is supplied, it will open the Language GUI Selector
      • Sub-Commands:
        • getflag
          • Description: Get a language flag
          • Permission: multilanguageplugin.getflag
          • Usage: /<command> getflag <language>
        • openselector
          • Description: Opens the Language GUI Selector
          • Permission: multilanguageplugin.openselector
          • Usage: /<command> openselector
        • reload
          • Description: Reloads the config
          • Permission: multilanguageplugin.reload
          • Usage: /<command> reload
        • help
          • Description: Shows the help menu
          • Permission: multilanguageplugin.help
          • Usage: /<command> help
        • setlanguage
          • Description: Sets the player language
          • Permission: multilanguageplugin.setlanguage, multilanguageplugin.setlanguage.others
          • Usage: /<command> setlanguage [player] <language>

    Permissions(top)

    • multilanguageplugin.getflag
      • Default: OP
    • multilanguageplugin.setlanguage
      • Default: true
    • multilanguageplugin.setlanguage.others
      • Default: OP
    • multilanguageplugin.openselector
      • Default: true
    • multilanguageplugin.reload
      • Default: OP
    • multilanguageplugin.help
      • Default: true

    Banners(top)

    MultiLanguagePlugin allows you to have banners to represent languages. Here is a step-by-step tutorial about it:
    Visit http://www.needcoolshoes.com/banner
    [​IMG]
    Customise your banner
    [​IMG]

    Get the banner code from the URL or sharing settings
    [​IMG]
    [​IMG]
    In this case, the banner code is eapwplpnpmbzbj

    BungeeCord(top)

    The BungeeCord version has no storage. So how does it work?

    The BungeeCord version connects to ALL the Spigot servers, communicating with the Spigot version. For that reason, you STILL need your Spigot version while using BungeeCord.

    Config(top)

    The BungeeCord config is really simple.
    Code (YAML):
    language-creation:
        syntax
    : lang
        syntax-args
    : args
        syntax-arg
    : arg
        # Select what language checks are enabled. The API can't be disabled (yet).
        enabled
    :
           # Should the plugin check chat messages?
            chat-messages
    : true
            # Should the plugin check actions bars?
            action-bars
    : true
            # Should the plugin check titles?
            titles
    : true
            # Should the plugin check for boss bars?
            bossbars
    : true
            # Should the plugin check tab header and footer?
            tab
    : true
         
    # The spigot servers where MultiLanguagePlugin is installed.
    # If you put here servers that don't have MultiLanguagePlugin
    # installed, your server will have 2 seconds delay on all tasks.
    # NOTE: server names are the ones on BungeeCord config.
    language-servers
    :
       - hub
    Don't forget to update the language-servers list with the servers running BungeeCord otherwise, it won't work.
  • Loading...
  • Loading...