How to localize MobHunting

Feb 27, 2017
How to localize MobHunting
  • Introduction
    From MobHunting 1.6.0 and on, it is now possible translate everything in MobHunting into another language, or just change what things say.

    Where are translations stored?
    All the translations available can be found within the lang sub folder inside MobHunting's directory

    Within this directory, each translation is stored in an appropriately named .lang file.
    For example, the translations for English are stored inside the "en_US.lang" file

    How the .lang file is laid out
    The .lang file is a very simple file. It is made up of pairs of keys and values separated by an equals sign '='

    Example:

    mobhunting.killstreak.level.1=Nice!
    mobhunting.killstreak.level.2=Super!

    In that example "mobhunting.killstreak.level.1" is a key and "Nice!" is the value for that key.

    The keys must never be translated or modified in any way. If you do, that message will no longer be able to be displayed.

    Sometimes you will find entries with special keywords in them. Example:

    mobhunting.moneygain.bonuses=You gained ${prize}! With: ${bonuses}

    In that example, there are 2 special keywords: ${prize} and ${bonuses}. These are placeholders which get replaced with the appropriate contents when the message is displayed. You should make sure any translations that you make still contain these keywords

    You may include blank lines.

    From MobHunting version 1.7.0: You can use colour codes in any line. Just use & instead of ยง with normal colour codes. See Color Codes for a list of colour codes

    How to add your own .lang file
    Adding your own .lang files for use is quite easy. Just place the file inside the lang sub folder inside MobHunting's directory. Giving it a proper name is a good idea but not required.

    I recommend copying an existing .lang file to make sure you have all the keys translated.

    How to use your own .lang file
    In the config (config.yml) you will find the setting:

    general:
    language: en_US

    the value of that should be the name of the .lang file you want to use.

    So if your lang file is "fr_FR.lang", then you enter "fr_FR" as the value for language. It does not have to be a language code, if the file was named "customized.lang" then you would enter "customized" as the value for language
  • Loading...
  • Loading...