[jsword-svn] r2166 - in trunk/jsword/src/main: java/org/crosswire/common/util java/org/crosswire/jsword/book/sword resources
mjdenham at crosswire.org
mjdenham at crosswire.org
Fri Jun 3 14:17:59 MST 2011
Author: mjdenham
Date: 2011-06-03 14:17:58 -0700 (Fri, 03 Jun 2011)
New Revision: 2166
Modified:
trunk/jsword/src/main/java/org/crosswire/common/util/MsgBase.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/GenBookBackend.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordGenBook.java
trunk/jsword/src/main/resources/JSMsg.properties
trunk/jsword/src/main/resources/JSMsg_de.properties
trunk/jsword/src/main/resources/JSMsg_fa.properties
trunk/jsword/src/main/resources/JSMsg_fr.properties
trunk/jsword/src/main/resources/JSMsg_in.properties
Log:
JS-193 MessageFormat strips off all single apostrophes from messages so double up apostrophes in MsgBase before calling MessageFormat
Modified: trunk/jsword/src/main/java/org/crosswire/common/util/MsgBase.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/util/MsgBase.java 2011-06-01 20:20:40 UTC (rev 2165)
+++ trunk/jsword/src/main/java/org/crosswire/common/util/MsgBase.java 2011-06-03 21:17:58 UTC (rev 2166)
@@ -56,10 +56,15 @@
* @return the internationalized text
*/
public String lookup(String key, Object... params) {
+ String rawMessage = obtainString(key);
if (params.length == 0) {
- return shaper.shape(obtainString(key));
+ return shaper.shape(rawMessage);
}
- return shaper.shape(MessageFormat.format(obtainString(key), params));
+
+ //MessageFormat strips off all single apostrophes from the message so replace single quotes with two quotes
+ rawMessage = rawMessage.replaceAll("'", "''");
+
+ return shaper.shape(MessageFormat.format(rawMessage, params));
}
/**
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/GenBookBackend.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/GenBookBackend.java 2011-06-01 20:20:40 UTC (rev 2165)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/GenBookBackend.java 2011-06-03 21:17:58 UTC (rev 2166)
@@ -133,7 +133,7 @@
// TRANSLATOR: Error condition: Indicates that something could not be found in the book.
// {0} is a placeholder for the unknown key.
// {1} is the short name of the book
- throw new BookException(JSMsg.gettext("No entry for ''{0}'' in {1}.", key.getName(), getBookMetaData().getInitials()));
+ throw new BookException(JSMsg.gettext("No entry for '{0}' in {1}.", key.getName(), getBookMetaData().getInitials()));
}
byte[] userData = node.getUserData();
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordGenBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordGenBook.java 2011-06-01 20:20:40 UTC (rev 2165)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordGenBook.java 2011-06-03 21:17:58 UTC (rev 2166)
@@ -215,7 +215,7 @@
// TRANSLATOR: Error condition: Indicates that something could not be found in the book.
// {0} is a placeholder for the unknown key.
// {1} is the short name of the book
- throw new NoSuchKeyException(JSMsg.gettext("No entry for ''{0}'' in {1}.", text, getInitials()));
+ throw new NoSuchKeyException(JSMsg.gettext("No entry for '{0}' in {1}.", text, getInitials()));
}
/* (non-Javadoc)
Modified: trunk/jsword/src/main/resources/JSMsg.properties
===================================================================
--- trunk/jsword/src/main/resources/JSMsg.properties 2011-06-01 20:20:40 UTC (rev 2165)
+++ trunk/jsword/src/main/resources/JSMsg.properties 2011-06-03 21:17:58 UTC (rev 2166)
@@ -56,7 +56,7 @@
Maps=Maps
Minor\ Prophets=Minor Prophets
New\ Testament=New Testament
-No\ entry\ for\ ''{0}''\ in\ {1}.=No entry for ''{0}'' in {1}.
+No\ entry\ for\ '{0}'\ in\ {1}.=No entry for '{0}' in {1}.
Not\ a\ valid\ Strong's\ Number\ "{0}"=Not a valid Strong's Number "{0}"
Old\ Testament=Old Testament
Optimizing=Optimizing
Modified: trunk/jsword/src/main/resources/JSMsg_de.properties
===================================================================
--- trunk/jsword/src/main/resources/JSMsg_de.properties 2011-06-01 20:20:40 UTC (rev 2165)
+++ trunk/jsword/src/main/resources/JSMsg_de.properties 2011-06-03 21:17:58 UTC (rev 2166)
@@ -56,7 +56,7 @@
Maps = Karten
Minor\ Prophets = Kleine Propheten
New\ Testament = Neues Testament
-No\ entry\ for\ ''{0}''\ in\ {1}. = Kein Eintrag f\u00FCr ''{0}'' in {1}.
+No\ entry\ for\ '{0}'\ in\ {1}. = Kein Eintrag f\u00FCr '{0}' in {1}.
Not\ a\ valid\ Strong's\ Number\ "{0}" = Keine g\u00FCltige Strong's Number "{0}"
Old\ Testament = Altes Testament
Optimizing = Optimierung
Modified: trunk/jsword/src/main/resources/JSMsg_fa.properties
===================================================================
--- trunk/jsword/src/main/resources/JSMsg_fa.properties 2011-06-01 20:20:40 UTC (rev 2165)
+++ trunk/jsword/src/main/resources/JSMsg_fa.properties 2011-06-03 21:17:58 UTC (rev 2166)
@@ -55,7 +55,7 @@
Maps=\u0646\u0642\u0634\u0629\u0647\u0627
Minor\ Prophets=\u0646\u0628\u06CC\u0647\u0627\u06CC \u06A9\u0648\u062C\u06A9
New\ Testament=\u0639\u0647\u062F \u062C\u062F\u06CC\u062F
-No\ entry\ for\ ''{0}''\ in\ {1}.=''{0}'' \u0648\u0686\u0648\u062F \u0646\u062F\u0631\u062F \u062F\u0631 {1}.
+No\ entry\ for\ '{0}'\ in\ {1}.='{0}' \u0648\u0686\u0648\u062F \u0646\u062F\u0631\u062F \u062F\u0631 {1}.
Old\ Testament=\u0639\u0647\u062F \u0639\u062A\u06CC\u0642
Optimizing=\u0645\u0646\u0627\u0633\u0628 \u06A9\u0631\u062F\u0646
Other=\u062F\u06CC\u06AF\u0627\u0631
Modified: trunk/jsword/src/main/resources/JSMsg_fr.properties
===================================================================
--- trunk/jsword/src/main/resources/JSMsg_fr.properties 2011-06-01 20:20:40 UTC (rev 2165)
+++ trunk/jsword/src/main/resources/JSMsg_fr.properties 2011-06-03 21:17:58 UTC (rev 2166)
@@ -56,7 +56,7 @@
Maps = Cartes
Minor\ Prophets = Proph\u00E8tes mineurs
New\ Testament = Nouveau Testament
-No\ entry\ for\ ''{0}''\ in\ {1}. = Aucune inscription pour ''{0}'' dans {1}.
+No\ entry\ for\ '{0}'\ in\ {1}. = Aucune inscription pour '{0}' dans {1}.
Not\ a\ valid\ Strong's\ Number\ "{0}" = Num\u00E9ro Strong non valide "{0}"
Old\ Testament = Ancien Testament
Optimizing = Optimisation
Modified: trunk/jsword/src/main/resources/JSMsg_in.properties
===================================================================
--- trunk/jsword/src/main/resources/JSMsg_in.properties 2011-06-01 20:20:40 UTC (rev 2165)
+++ trunk/jsword/src/main/resources/JSMsg_in.properties 2011-06-03 21:17:58 UTC (rev 2166)
@@ -52,7 +52,7 @@
Maps=Peta
Minor\ Prophets=Nabi Kecil
New\ Testament=Perjanjian Baru
-No\ entry\ for\ ''{0}''\ in\ {1}.=Tidak ada entri untuk ''{0}'' di {1}.
+No\ entry\ for\ '{0}'\ in\ {1}.=Tidak ada entri untuk '{0}' di {1}.
Old\ Testament=Perjanjian Lama
Other=Lain lain
Pentateuch=5 Kitab Musa
More information about the jsword-svn
mailing list