W3C home > Mailing lists > Public > www-validator-cvs@w3.org > October 2009

2006/unicorn/src/org/w3c/unicorn/util Language.java,1.8,1.9

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 07 Oct 2009 12:49:32 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MvVxU-0007le-Az@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/util
In directory hutz:/tmp/cvs-serv29843/src/org/w3c/unicorn/util

Modified Files:
	Language.java 
Log Message:
improved performance if a string does not contain any dynamic parameters (ex: "%1")

Index: Language.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/util/Language.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Language.java	6 Oct 2009 10:02:46 -0000	1.8
+++ Language.java	7 Oct 2009 12:49:30 -0000	1.9
@@ -101,6 +101,13 @@
 			return messageKey;
 		
 		String message = Framework.getLanguageProperties().get(lang).getProperty(messageKey.replace("$", ""));
+		
+		if (message == null)
+			return messageKey;
+		
+		if (!message.contains("%"))
+			return message;
+		
 		String result = message;
 		int i = 1;
 		if (args == null)
Received on Wednesday, 7 October 2009 12:49:36 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:39 UTC