On Wed, 7 Nov 2012 08:45:34 PM Stéphane Perez wrote: >[Patch] The format looks good, and I believe that will fix the problem. However, while I think you are on the right track with the routine in Messages.java, it would be better to fix Tension.getKey() to return a proper message lookup key. More like what follows below...
Cheers,
Mike Pope
------------------------
diff --git a/data/strings/FreeColMessages.properties
b/data/strings/FreeColMessages.properties
index 0c56ea7..0fd96d2 100644
--- a/data/strings/FreeColMessages.properties
+++ b/data/strings/FreeColMessages.properties
@@ -220,6 +220,7 @@ tension.content=Content
tension.displeased=Displeased
tension.angry=Angry
tension.hateful=Hateful
+tension.unknown=Unknown
tension=Tension
noSuchFile=The specified file does not exist or is not a regular file.
@@ -1188,14 +1189,13 @@ indianSettlement.skillNone=None
indianSettlement.mostHated=The most hated nation at this settlement:
indianSettlement.mostHatedNone=None
indianSettlement.mostHatedUnknown=Unknown
-indianSettlement.tensionUnknown=Unknown
indianSettlement.wantedGoodsUnknown=Unknown
indianSettlement.wantedGoodsNone=None
-indianSettlement.alarm.happy=The members of the %nation% nation are happily
dancing around their camp fire and singing the songs of their ancestors.
-indianSettlement.alarm.content=The members of the %nation% nation are busy at
work. Their children merrily play hide and seek.
-indianSettlement.alarm.displeased=The members of the %nation% nation are busy
at work. Their children are nowhere to be seen, and their elders are frowning.
-indianSettlement.alarm.angry=The braves of the %nation% nation are busy at
target practice. The women and children hide in their tents.
-indianSettlement.alarm.hateful=The braves of the %nation% nation are shaking
their weapons. They have adorned their belts with the scalps of their enemies,
and their torture stakes show signs of heavy use.
+indianSettlement.tension.happy=The members of the %nation% nation are happily
dancing around their camp fire and singing the songs of their ancestors.
+indianSettlement.tension.content=The members of the %nation% nation are busy
at work. Their children merrily play hide and seek.
+indianSettlement.tension.displeased=The members of the %nation% nation are
busy at work. Their children are nowhere to be seen, and their elders are
frowning.
+indianSettlement.tension.angry=The braves of the %nation% nation are busy at
target practice. The women and children hide in their tents.
+indianSettlement.tension.hateful=The braves of the %nation% nation are
shaking their weapons. They have adorned their belts with the scalps of their
enemies, and their torture stakes show signs of heavy use.
indianSettlement.mission.happy=Mission founded, %nation% approach your new
religion with joy.
indianSettlement.mission.content=Mission founded, %nation% approach your new
religion with curiosity.
indianSettlement.mission.displeased=Mission founded, %nation% are offended.
diff --git a/src/net/sf/freecol/common/model/IndianSettlement.java
b/src/net/sf/freecol/common/model/IndianSettlement.java
index adc283b..c39c2db 100644
--- a/src/net/sf/freecol/common/model/IndianSettlement.java
+++ b/src/net/sf/freecol/common/model/IndianSettlement.java
@@ -582,7 +582,7 @@ public class IndianSettlement extends Settlement {
public String getShortAlarmLevelMessageId(Player player) {
return (!player.hasContacted(owner)) ? "tension.wary"
: (hasContacted(player)) ? getAlarm(player).getKey()
- : "indianSettlement.tensionUnknown";
+ : "tension.unknown";
}
/**
@@ -595,7 +595,7 @@ public class IndianSettlement extends Settlement {
public String getAlarmLevelMessageId(Player player) {
Tension alarm = (hasContacted(player)) ? getAlarm(player)
: new Tension(Tension.TENSION_MIN);
- return "indianSettlement.alarm." + alarm.getKey();
+ return "indianSettlement." + alarm.getKey();
}
/**
diff --git a/src/net/sf/freecol/common/model/Tension.java
b/src/net/sf/freecol/common/model/Tension.java
index c93011f..27c99be 100644
--- a/src/net/sf/freecol/common/model/Tension.java
+++ b/src/net/sf/freecol/common/model/Tension.java
@@ -147,7 +147,7 @@ public class Tension {
* @return A message id string.
*/
public String getKey() {
- return toString().toLowerCase(Locale.US);
+ return "tension." + toString().toLowerCase(Locale.US);
}
/**
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ LogMeIn Central: Instant, anywhere, Remote PC access and management. Stay in control, update software, and manage PCs from one command center Diagnose problems and improve visibility into emerging IT issues Automate, monitor and manage. Do more in less time with Central http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________ Freecol-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freecol-developers
