LANGUAGE
Plugin Translations (language.yml)
The language.yml file is the heart of your plugin's text customization. It allows you to translate or change every message, title, and scoreboard line that players see. This gives you full control over the plugin's voice and allows you to adapt it for a non-English speaking community.
How It Works
The file operates on a simple key-value system.
Key: The identifier on the left side of the colon (e.g.,
no-permission). You should never change the key. The plugin's code uses this key to know which message to send.Value: The text string on the right side of the colon, enclosed in double quotes (e.g.,
"&cYou don't have permission to use this command."). This is the text you will edit.
When the plugin needs to send a message, it looks up the key in language.yml and sends the corresponding value to the player.
Editing and Translating Messages
Follow these steps to customize the text:
Open the File: Navigate to the
/plugins/TheBridge/folder on your server and openlanguage.ymlwith a text editor that supports UTF-8 encoding (like Notepad++, VS Code, or Sublime Text).Locate the Message: Find the key for the message you want to change. The file is organized with comments to help you (e.g.,
# Duel messages,# Cosmetic messages).Edit the Value: Change the text within the double quotes to your desired message or translation.
Save and Reload: Save the
language.ymlfile. Then, use the command/bridge reloadin-game or via the console to apply the changes without restarting the server.
Example: Translating the "no permission" message.
Original:
YAML
no-permission: "&cYou don't have permission to use this command."Translated to Spanish:
YAML
no-permission: "&cNo tienes permiso para usar este comando."
Color & Formatting Codes
You can color and format your messages using the ampersand symbol (&) followed by a code.
&c= Red&a= Green&e= Yellow&l= Bold&o= Italic&r= Reset formatting
Example: The key plugin-reloaded: "&aPlugin reloaded successfully." will display as "Plugin reloaded successfully." in light green.
Placeholders
Placeholders are special words surrounded by percentage signs (%) that are automatically replaced by the plugin with dynamic game information.
For example, in the message player-not-found: "&cPlayer %player% not found.", the %player% placeholder will be replaced with the name of the player that could not be found.
It is crucial to keep these placeholders in your translated messages if you want that information to be displayed.
%player%,%player_name%: The name of a player.%wins%,%kills%,%kdr%: Player statistics.%map%: The name of an arena.%mode%: The game mode (e.g., SOLO, DOUBLES).%price%: The cost of a cosmetic.%team_color%: The color code for a team (e.g.,&cfor Red).
By editing this file, you can fully integrate the plugin's text to match your server's unique style and language.
Last updated