From fc0b2a1041a69fbccc6a4bd2a01f960af8779a3e Mon Sep 17 00:00:00 2001 From: eueln Date: Wed, 28 Jan 2015 19:58:21 -0600 Subject: [PATCH] Fix path for Relation translations (singular) --- .../massivecraft/factions/struct/Relation.java | 9 ++++----- .../com/massivecraft/factions/zcore/util/TL.java | 16 ++++++++-------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/struct/Relation.java b/src/main/java/com/massivecraft/factions/struct/Relation.java index 4234fc75..2dd92c4e 100644 --- a/src/main/java/com/massivecraft/factions/struct/Relation.java +++ b/src/main/java/com/massivecraft/factions/struct/Relation.java @@ -41,12 +41,11 @@ public enum Relation { } public String getTranslation() { - for (TL t : TL.values()) { - if (t.name().equalsIgnoreCase("RELATION_" + name())) { - return t.toString(); - } + try { + return TL.valueOf("RELATION_" + name() + "_SINGULAR").toString(); + } catch (IllegalArgumentException e) { + return toString(); } - return toString(); } public String getPluralTranslation() { diff --git a/src/main/java/com/massivecraft/factions/zcore/util/TL.java b/src/main/java/com/massivecraft/factions/zcore/util/TL.java index b9ed585a..5e72948d 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/TL.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/TL.java @@ -584,15 +584,15 @@ public enum TL { /** * Relations */ - RELATION_MEMBER("member"), - RELATION_MEMBER_PURAL("members"), - RELATION_ALLY("ally"), - RELATION_ALLY_PURAL("allies"), - RELATION_TRUCE("truce"), + RELATION_MEMBER_SINGULAR("member"), + RELATION_MEMBER_PLURAL("members"), + RELATION_ALLY_SINGULAR("ally"), + RELATION_ALLY_PLURAL("allies"), + RELATION_TRUCE_SINGULAR("truce"), RELATION_TRUCE_PLURAL("truces"), - RELATION_NEUTRAL("neutral"), - RELATION_NEUTRAL_PURAL("neutrals"), - RELATION_ENEMY("enemy"), + RELATION_NEUTRAL_SINGULAR("neutral"), + RELATION_NEUTRAL_PLURAL("neutrals"), + RELATION_ENEMY_SINGULAR("enemy"), RELATION_ENEMY_PLURAL("enemies"), /**