moar translatify :3

Add some missing TL nodes
Remove Lang class
You can now into changing command descriptions
This commit is contained in:
korikisulda
2015-01-20 18:27:26 +00:00
committed by eueln
parent 3d52704c5d
commit 1cc544db64
13 changed files with 405 additions and 185 deletions

View File

@@ -2,11 +2,14 @@ package com.massivecraft.factions.util;
import org.bukkit.ChatColor;
import com.massivecraft.factions.zcore.util.TL;
import java.util.ArrayList;
public class AsciiCompass {
public enum Point {
N('N'),
NE('/'),
E('E'),
@@ -27,8 +30,16 @@ public class AsciiCompass {
return String.valueOf(this.asciiChar);
}
public String getTranslation(){
if(this==N) return TL.COMPASS_SHORT_NORTH.toString();
if(this==E) return TL.COMPASS_SHORT_EAST.toString();
if(this==S) return TL.COMPASS_SHORT_SOUTH.toString();
if(this==W) return TL.COMPASS_SHORT_WEST.toString();
return toString();
}
public String toString(boolean isActive, ChatColor colorActive, String colorDefault) {
return (isActive ? colorActive : colorDefault) + String.valueOf(this.asciiChar);
return (isActive ? colorActive : colorDefault) + getTranslation();
}
}

View File

@@ -3,6 +3,8 @@ package com.massivecraft.factions.util;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.P;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;
import org.bukkit.entity.Creature;
import org.bukkit.entity.Entity;
@@ -64,16 +66,16 @@ public class MiscUtil {
ArrayList<String> errors = new ArrayList<String>();
if (getComparisonString(str).length() < Conf.factionTagLengthMin) {
errors.add(P.p.txt.parse("<i>The faction tag can't be shorter than <h>%s<i> chars.", Conf.factionTagLengthMin));
errors.add(P.p.txt.parse(TL.GENERIC_FACTIONTAG_TOOSHORT.toString(), Conf.factionTagLengthMin));
}
if (str.length() > Conf.factionTagLengthMax) {
errors.add(P.p.txt.parse("<i>The faction tag can't be longer than <h>%s<i> chars.", Conf.factionTagLengthMax));
errors.add(P.p.txt.parse(TL.GENERIC_FACTIONTAG_TOOLONG.toString(), Conf.factionTagLengthMax));
}
for (char c : str.toCharArray()) {
if (!substanceChars.contains(String.valueOf(c))) {
errors.add(P.p.txt.parse("<i>Faction tag must be alphanumeric. \"<h>%s<i>\" is not allowed.", c));
errors.add(P.p.txt.parse(TL.GENERIC_FACTIONTAG_ALPHANUMERIC.toString(), c));
}
}