From: <ni...@us...> - 2006-10-04 05:51:36
|
Revision: 5813 http://svn.sourceforge.net/jmol/?rev=5813&view=rev Author: nicove Date: 2006-10-03 22:51:29 -0700 (Tue, 03 Oct 2006) Log Message: ----------- i18n: Ignore Jmol/Messages from the applet Modified Paths: -------------- trunk/Jmol/src/org/jmol/appletwrapper/AppletWrapper.java trunk/Jmol/src/org/jmol/i18n/GT.java Modified: trunk/Jmol/src/org/jmol/appletwrapper/AppletWrapper.java =================================================================== --- trunk/Jmol/src/org/jmol/appletwrapper/AppletWrapper.java 2006-10-04 04:27:05 UTC (rev 5812) +++ trunk/Jmol/src/org/jmol/appletwrapper/AppletWrapper.java 2006-10-04 05:51:29 UTC (rev 5813) @@ -77,6 +77,7 @@ String preloadTextMessage, int preloadThreadCount, String[] preloadClassNames) { + GT.ignoreApplicationBundle(); this.wrappedAppletClassName = wrappedAppletClassName; this.preloadImageName = preloadImageName; this.preloadTextMessage = preloadTextMessage; Modified: trunk/Jmol/src/org/jmol/i18n/GT.java =================================================================== --- trunk/Jmol/src/org/jmol/i18n/GT.java 2006-10-04 04:27:05 UTC (rev 5812) +++ trunk/Jmol/src/org/jmol/i18n/GT.java 2006-10-04 05:51:29 UTC (rev 5813) @@ -28,8 +28,9 @@ import org.jmol.util.Logger; public class GT { - - private static GT getTextWrapper = new GT(); + + private static boolean ignoreApplicationBundle = false; + private static GT getTextWrapper; private ResourceBundle translationResources; private ResourceBundle appletTranslationResources; @@ -46,8 +47,10 @@ } Logger.debug("Instantiating gettext wrapper..."); try { - translationResources = ResourceBundle.getBundle( - "org.jmol.translation.Jmol.Messages"); + if (!ignoreApplicationBundle) { + translationResources = ResourceBundle.getBundle( + "org.jmol.translation.Jmol.Messages"); + } } catch (MissingResourceException mre) { Logger.warn("Translations do not seem to have been installed!"); Logger.warn(mre.getMessage()); @@ -69,12 +72,23 @@ } } + private static GT getTextWrapper() { + if (getTextWrapper == null) { + getTextWrapper = new GT(); + } + return getTextWrapper; + } + + public static void ignoreApplicationBundle() { + ignoreApplicationBundle = true; + } + public static String _(String string) { - return getTextWrapper.getString(string); + return getTextWrapper().getString(string); } public static String _(String string, Object[] objects) { - return getTextWrapper.getString(string, objects); + return getTextWrapper().getString(string, objects); } private String getString(String string) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |