From 5bfaccded76c14982e9902f03afa0d19cf7aa935 Mon Sep 17 00:00:00 2001 From: eg3p Date: Sat, 2 Nov 2002 20:11:42 +0000 Subject: [PATCH] This class provides static methods for dealing with THDL's internationalization issues. --- source/org/thdl/util/ThdlI18n.java | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 source/org/thdl/util/ThdlI18n.java diff --git a/source/org/thdl/util/ThdlI18n.java b/source/org/thdl/util/ThdlI18n.java new file mode 100644 index 0000000..b78f3d6 --- /dev/null +++ b/source/org/thdl/util/ThdlI18n.java @@ -0,0 +1,32 @@ +package org.thdl.util; + +import java.util.Locale; +import java.util.ResourceBundle; +import javax.swing.JComponent; + +public class ThdlI18n { + private static Locale locale = null; + private static ResourceBundle resources = null; + + private ThdlI18n() {} + + public static ResourceBundle getResourceBundle() { + if (resources == null) + resources = ResourceBundle.getBundle("MessageBundle", getLocale()); + return resources; + } + public static void setLocale(Locale l) { + Locale[] locales = Locale.getAvailableLocales(); + for (int k=0; k