home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / Notes.jar / lotus / notes / addins / InternationalResources.class (.txt) next >
Encoding:
Java Class File  |  1998-11-15  |  1.7 KB  |  47 lines

  1. package lotus.notes.addins;
  2.  
  3. import java.text.Format;
  4. import java.text.MessageFormat;
  5. import java.util.Locale;
  6. import java.util.PropertyResourceBundle;
  7. import java.util.ResourceBundle;
  8. import lotus.notes.JavaString;
  9.  
  10. public class InternationalResources {
  11.    private PropertyResourceBundle resource;
  12.    private JavaString agent_resources = new JavaString("lotus.notes.AgentResources");
  13.  
  14.    public InternationalResources(String var1) {
  15.       Object var2 = null;
  16.  
  17.       try {
  18.          if (System.getProperty("user.region") == null) {
  19.             var4 = new Locale(System.getProperty("user.language"), "");
  20.          } else {
  21.             var4 = new Locale(System.getProperty("user.language"), System.getProperty("user.region"));
  22.          }
  23.       } catch (Exception var3) {
  24.          System.err.println("JVM unable to obtain system locale. Defaulting to English.");
  25.          var4 = new Locale("en", "US");
  26.       }
  27.  
  28.       this.resource = (PropertyResourceBundle)ResourceBundle.getBundle(var1, var4);
  29.    }
  30.  
  31.    public String getString(String var1) {
  32.       return this.resource.getString(var1);
  33.    }
  34.  
  35.    public String getFormattedString(String var1, String var2, String var3) {
  36.       Object[] var4 = new Object[]{var2, var3};
  37.       MessageFormat var5 = new MessageFormat(this.resource.getString(var1));
  38.       return ((Format)var5).format(var4);
  39.    }
  40.  
  41.    public String getFormattedString(String var1, String var2) {
  42.       Object[] var3 = new Object[]{var2};
  43.       MessageFormat var4 = new MessageFormat(this.resource.getString(var1));
  44.       return ((Format)var4).format(var3);
  45.    }
  46. }
  47.