Add support for colors in messages.yml

This commit is contained in:
AppleDash 2016-12-06 08:13:27 -05:00
parent 44c72490a5
commit 908b7c956b
2 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package org.appledash.saneeconomy.utils;
import com.google.common.collect.ImmutableMap;
import org.appledash.saneeconomy.SaneEconomy;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
@ -69,7 +70,7 @@ public class I18n {
}
private String translate(String input) {
return translations.containsKey(input) ? translations.get(input) : input;
return translations.containsKey(input) ? ChatColor.translateAlternateColorCodes('&', translations.get(input)) : input;
}
public static String _(String s) {

View File

@ -2,6 +2,7 @@
# Add a translation to the messages you wish to change, like this:
# - message: That player is not online.
# translation: Ce joueur n'est pas en ligne.
# Colors can also be used, by means of prefixing color codes with an '&' symbol.
messages:
- message: You don't have permission to check the balance of %s.
- message: That player is not online.