Skip to content

Language

Ayman Isam edited this page Sep 19, 2024 · 6 revisions

The HungerGames plugin supports multiple languages to enhance your gameplay experience. The language used by the plugin will be based on your Minecraft client's language setting.

Supported Languages

The HungerGames plugin provides direct support for the following languages, meaning they work out-of-the-box without the need for additional language files:

  • English (United States) - en_us
  • Spanish (Spain) - es_ES
  • French (France) - fr_FR
  • Hindi (India) - hi_IN
  • Chinese (China) - zh_CN
  • Arabic (Saudi Arabia) - ar_SA
  • Russian (Russia) - ru_RU

These languages are supported through the use of language files, which are saved in the lang directory of the plugin's data folder. Each language has a corresponding .yml file, named with the language code (for example, en_us.yml for English). Please note that these files may contain inaccuracies in translations as they were generated using AI. If you wish to report any inaccuracies in translations, please refer to the contributions section at the bottom of this document. If a language file for a specific language does not exist, the plugin defaults to English. However, you have the option to add a language file of your choice. Please be aware that there can be variations within the same language. For instance, 'fr_fr' and 'fr_ca' are not identical.

Adding a New Language

If your preferred language is not supported, you can add it by creating a new language file:

  1. Locate the plugins/HungerGames/lang directory in your server's files.
  2. Create a new file in this directory. The file name should be the locale code for your language (for example, ja_JP.yml for Japanese) followed by .yml. The locale code for Minecraft can be found at Minecraft Wiki. If your language is not in the wiki list, it means that Minecraft doesn't support the language
  3. Open the new file in a code/text editor that supports yaml, for example VSCode.
  4. Add the message keys and their translations to the file. Each line should be in the format key: "Translation". For example:
game-start: "Le jeu a commencé!"
grace-start: "La période de grâce a commencé! Le PvP est désactivé."
grace-end: "La période de grâce est terminée! Le PvP est activé."

For the full list of keys, view the en_US sample file at the end of the page.

  1. Save and close the file.

Updating an Existing Language

If you want to update the translations for an existing language, follow these steps:

  1. Locate the appropriate language file in the plugins/HungerGames/lang directory.
  2. Open the new file in a code/text editor that supports yaml, for example VSCode.
  3. Update the translations as needed. Each line should be in the format - key: "Translation".
  4. Save and close the file. Your changes will take effect the next time the server is started.

Using Minecraft Color Formatting

Minecraft supports a variety of color codes and formatting codes that you can use to change the color and style of text in the game. These codes can be used in your language files to customize the appearance of the plugin's messages. Here's how you can use these codes:

  1. Color Codes: To change the color of text, use the & symbol followed by a digit or a letter from 0 to f. For example, &6 will change the text color to gold, and &f will change it to white. Here's a list of all the color codes:
  • &0: Black
  • &1: Dark Blue
  • &2: Dark Green
  • &3: Dark Aqua
  • &4: Dark Red
  • &5: Dark Purple
  • &6: Gold
  • &7: Gray
  • &8: Dark Gray
  • &9: Blue
  • &a: Green
  • &b: Aqua
  • &c: Red
  • &d: Light Purple
  • &e: Yellow
  • &f: White
  1. Formatting Codes: To apply a style to the text, use the & symbol followed by a letter from k to o. For example, &l will make the text bold, and &n will underline it. Here's a list of all the formatting codes:
  • &k: Obfuscated
  • &l: Bold
  • &m: Strikethrough
  • &n: Underline
  • &o: Italic
  • &r: Reset (removes all color and style from the text)

Remember, these codes only change the color or style of the text that follows them. To apply a color or style to the entire line, place the code at the beginning of the line. To apply different colors or styles to different parts of the line, place each code before the part of the line you want to change. For example, to make a message appear in bold gold text, you would use the codes &6 and &l like this:

game-start: "&6&lThe game has started!"

This will display the message "The game has started!" in bold gold text in the game.

Language Errors

If you encounter a "Message not found" error while using the HungerGames plugin, it means that a specific message key could not be found in the language file that the plugin is currently using. This could be due to a missing or incorrect key in the language file. Here's what you can do to resolve this issue:

  1. Identify the Missing Key: Check the console or logs for the missing key. The error message in the console or logs will specify the key that could not be found. For example, it might say "Message not found for key: game-start". In this case, "game-start" is the missing key.
  2. Locate the language file: The language files are located in the plugins/HungerGames/lang directory in your server's files. The file for each language is named with the language code (for example, en_us.yml for English).
  3. Open the language file: Open the language file that your server is using in a text editor. If you're not sure which file your server is using, it's likely using the default language file, which is en_us.yml.
  4. Check for the missing key: Each line in the language file should be in the format key: "Translation". Check if the missing key is in the file. If it's not, that's likely the cause of the error.
  5. Add or correct the missing key: If the key is missing, you can add it to the file. If the key is there but the format is incorrect, you can correct it. Each line should be in the format key: "Translation". For example, if the missing key is "game-start", you might add a line like this:
game-start: "The game has started!"
  1. Save and close the file: After making your changes, save and close the file. The next time the server is started, it will use the updated language file.

  2. Update the Plugin: If you've made changes to the language file, you'll need to update the plugin to use the new file. You can do this by restarting your server or by using a plugin manager to reload the plugin.

  3. Handling Future Missing Keys: If the plugin is updated and new keys are added to the language files, you may encounter missing keys again. To handle this, you can repeat the steps above to add the new keys to your language file. Alternatively, you can download the latest language files from the plugin's GitHub repository and replace your current files with them.

If you're still having trouble after following these steps, consider seeking help through GitHub Issues or our Discord Server.

Contributions

We welcome language contributions section to the HungerGames plugin. There are two main ways you can contribute:

Translating the Plugin

If you're fluent in a language that the plugin doesn't yet support, we'd appreciate your help in translating it. Here's how you can do this:

  1. Fork the HungerGames repository on GitHub.
  2. Create a new language file in the lang directory. The file name should be the locale code for your language (for example, ja_JP.yml for Japanese) followed by .yml.
  3. Translate the messages in the file. Each line should be in the format key: "Translation".
  4. Once you've finished translating, commit your changes and create a pull request.

Suggesting Updates to Current Language Files

If you've noticed an error or room for improvement in one of our current language files, we'd appreciate your help in updating it. Here's how you can do this:

  1. Fork the HungerGames repository on GitHub.
  2. Locate the language file you want to update in the lang directory.
  3. Make your changes to the file. Each line should be in the format key: "Translation".
  4. Once you've finished making changes, commit your changes and create a pull request.

Discord Server

If you're not comfortable with using GitHub, you can also suggest translations or updates to language files through our Discord server. Please send your suggestions in a format that's easy for us to understand and implement.

We appreciate all contributions, and we're excited to see how you can help improve the HungerGames plugin!

Sample file - en_US

time-remaining: "Time remaining"
no-permission: "&cYou do not have permission to run this command"
no-server: "&cThis command can only be executed by players"
config-reloaded: "&aConfig has been reloaded!"
unknown-subcommand: "&cUnknown subcommand: &5{0}"
usage: "&6Usage: /hg <subcommand> [args]"

arena:
  stick-name: "&aArena Selector"
  stick-left: "&bLeft-click for pos 1"
  stick-right: "&bRight-click for pos 2"
  given-stick: "&aYou have been given an Arena Selector"
  region-created: "&aRegion created and saved to arena.yml!"
  invalid-values: "&cInvalid position values detected!"
  no-values: "&cYou must set both positions first using the Arena Selector"
  compass-enemy: "&bYou're tracking enemy:&c {0}"
  compass-teammate: "&bYou're tracking teammate:&a {0}"
  compass-nomates: "&cNo teammates to track"

border:
  usage: "&eUsage: border <size> <center-x> <center-z>"
  invalid-args: "&cInvalid values detected. Please enter valid numbers!"
  wrong-world: "&cWorld not found!"
  args-1: "<size>"
  args-2: "<center-x>"
  args-3: "<center-z>"
  success-message: "&aBorder size set to &b{0} &awith center at &bX={1}, Z={2}"
  start-shrink: "&6The world border has started to shrink"

chestrefill:
  no-arena: "&cCreate an arena first to run this command!"
  no-file: "&cRun scanarena first to run this command!"
  no-chests: "&cNo chests found in the arena!"
  created-items: "&aCreated a new items.yml file!"
  failed-items: "&cCould not create items.yml file!"
  failed-locations: "&cCould not save chest locations to file!"
  refilled: "&aChests have been refilled!"

game:
  game-end: "&6The game has ended!"
  winner: "&b{0} &dis the winner!"
  solo-kills: "&dTime's up! &b{0} &dwon with most kills!"
  team-no-winner: "&6Time's up! No winner was found!"
  time-up: "&6Time's up! &b{0} &dwon"
  team-kills: "&6Time's up! &b{0} &dwon with their team having most kills!"
  team-alive: "&6Time's up! &b{0} &dwon with their team having \n most players alive!"
  killed-message: "&b{0} &chas been eliminated from the game by &d{1}"
  death-message: "&b{0} &chas eliminated themselves from the game"
  start: "&aThe game has started!"
  grace-start: "&6The grace period has started! PvP is disabled."
  grace-end: "&cThe grace period has ended! PvP is enabled."
  not-started: "&cThe game has not started yet!"
  ended: "&6The game has been ended by an admin."
  already-joined: "&cYou have already joined the game!"
  auto-join: "&bYou have been automatically joined to the game!"
  join-fail: "&cNot enough spawnpoints to join!"
  not-lobby: "&cYou are still in the lobby!"
  invalid-target: "&cTarget block is not a sign"
  invalid-nearby: "&cThe {0} blocks to the right of the Target block aren't signs"
  join-instruction: "&dJoin the game with &b/hg join &dor click the sign!"
  left: "&b{0} &dhas left &2[{1}/{2}]"
  worldsaved: "&aWorld &b{0} &ahas been saved!"
  not-team: "&cThis command cannot be run in a solo game"

map:
  no-args: "&cPlease enter a map name!"
  not-found: "&cMap &b{0} &cnot found!"
  switched: "&aSwitched to map: &b{0}"
  game-running: "&cThe game is currently running!"

scanarena:
  region-undef: "&cThe area region is not defined in the config."
  saved-locations: "&aChest locations have been saved."
  failed-locations: "&cCould not save chest locations to file!"
  found-chests: "&aNumber of &bchests&a scanned: &6{0}"
  found-barrels: "&aNumber of &bbarrels&a scanned: &6{0}"
  found-trapped-chests: "&aNumber of &btrapped chests&a scanned: &6{0}"

score:
  name-solo: "&aHungerGames Solo"
  name-team: "&aHungerGames Team"
  time: "Time Left: {0}"
  alive: "Players Alive: {0}"
  border: "Border Size: {0}"
  borderShrink: "BorderShrink in: {0}"
  pvp: "PvP in: {0}"
  teammate: "Teammate: {0}"
  chestrefill: "Chestrefill in: {0}"
  supplydrop: "Supplydrop in: {0}"

setspawn:
  stick-name: "&bSpawn Point Selector."
  stick-left: "&bLeft click to select spawnpoint"
  given-stick: "&dYou have been given a Spawn Point Selector."
  spawn-reset: "&6Spawn Points have been reset."
  failed-save: "&cCould not save config to the specified location."
  duplicate: "&cYou can't choose the same block for two spawn points!"
  not-spawn: "&cBlock has not been selected"
  first-pos: "&dFirst position set at &a[ &b{0}, {1}, {2} &a]"
  second-pos: "&dSecond position set at &a[ &b{0}, {1}, {2} &a]"
  pos-set: "&dPosition &6{0} &dset at &a[ &b{0}, {1}, {2} &a]"
  pos-removed: "&dPosition &6{0} &dremoved at &a[ &b{0}, {1}, {2} &a]"
  max-spawn: "&cYou have reached the maximum number of spawn points!"
  game-started: "&cGame has already started."
  joined-message: "&a{0} &7has joined &2[{1}/{2}]"
  spawn-filled: "&cAll spawn points are currently occupied!"

spectate:
  spectating-player: "&dYou are now spectating"
  no-player: "&cNo players to teleport to!"
  null-player: "&cPlayer not found!"
  teleported: "&bTeleported to &b{0}"
  not-spectator: "&cYou are not a spectator!"
  gui-message: "&bTeleport to player"
  message: "&dSpectate players with /hg spectate"

startgame:
  min-players: "&cThere must be at least &b{0}&c players to start the game!"
  set-spawn-arena: "&cSet up the arena and spawn points first!"
  set-spawn: "&cSet up spawn points first!"
  set-arena: "&cSet up the arena first!"
  started: "&cThe game has already started!"
  starting: "&cThe game is currently starting."
  20-s: "&eThe game will start in 20 seconds!"
  15-s: "&615 seconds left!"
  10-s: "&610 seconds left!"
  5-s: "&c5 seconds left!"
  4-s: "&c4 seconds left!"
  3-s: "&c3 seconds left!"
  2-s: "&c2 seconds left!"
  1-s: "&c1 second left!"
  cancelled: "&cGame starting cancelled due to not enough players"

supplydrop:
  no-arena: "&cCreate an arena first to run this command!"
  created-items: "&aCreated a new items.yml file!"
  failed-items: "&cCould not create items.yml file!"
  spawned: "&dSpawned supply drop at &b{0}"

team:
  voting-inv: "&2Vote for game mode"
  solo-inv: "&3&lSolo"
  duo-inv: "&4&lDuo"
  trio-inv: "&5&lTrio"
  versus-inv: "&6&lVersus"
  votes: "&dVotes: &b{0}"
  voted-solo: "&bYou voted for Solo mode!"
  voted-duo: "&bYou voted for Duo mode!"
  voted-trio: "&bYou voted for Trio mode!"
  voted-versus: "&bYou voted for Versus mode!"
  voted-highest: "&bThe highest voted gamemode was {0}"
  close-inv: "&cClose"
  no-teams: "&cNot enough teams for team mode!"
  no-teammates: "&cYou have no teammates!"
  compass-teammate: "&aTeammate Tracker"
  compass-enemy: "&cEnemy Tracker"
  compass-click: "&bClick to track teammate"
  compass-shift-click: "&bShift-Click to change teammate"
  id: "&aYou're in team: &d{0}"
  members: "&dYour teammates are: &6{0}"
  usage: "&eUsage: teamsize <size>"
  size: "&aTeam size set to &b{0}"
  nomates: "&cYou have no teammates!"
  chat-enabled: "&dTeamChat enabled! Only teammates will see your messages."
  chat-disabled: "&dTeamChat disabled! Everyone will see your messages."

tips:
  0: "&aTip: &7Use your compass to track enemies and teammates. Sneak-click to switch teammates."
  1: "&aTip: &7Chests refill periodically, keep an eye out for them."
  2: "&aTip: &7Eliminating players grants you special effects. Use this to your advantage!"
  3: "&aTip: &7Watch out for supply drops, they contain valuable items."
  4: "&aTip: &7Use /hg teamchat to toggle between team-only and public messages."