예제 #1
0
  private static String loadString(String key) {
    if (lang == null) {
      String langFile = Config.getInstance().langFileName();
      if (langFile == null) lang = new Hashtable();
      else lang = new StringLoader().hashtableLoader(langFile);
      System.out.print("Loading locale ");
      System.out.println(langFile);
      MS_XMLLANG = (String) lang.get("xmlLang");

      MS_IFACELANG = MS_XMLLANG;
      if (MS_IFACELANG == null) MS_IFACELANG = "en";

      presences = new Hashtable();
      presences.put("online", loadString("online"));
      presences.put("chat", loadString("free for chat"));
      presences.put("away", loadString("away"));
      presences.put("xa", loadString("not available"));
      presences.put("invisible", loadString("invisible"));
      presences.put("dnd", loadString("do not disturb"));
      presences.put("unavailable", loadString("offline"));
    }
    String value = (String) lang.get(key);
    // #if LOCALE_DEBUG
    if (value == null) {
      if (!lang.isEmpty()) {
        System.out.print("Can't find local string for <");
        System.err.print(key);
        System.err.println('>');
      }
    }
    // #endif
    return (value == null) ? key : value;
  }
 /** Creates a new instance of GroupChatForm */
 public ConferenceForm(Display display) {
   String room = Config.getInstance().defGcRoom;
   String server = null;
   // trying to split string like room@server
   int roomE = room.indexOf('@');
   if (roomE > 0) {
     server = room.substring(roomE + 1);
     room = room.substring(0, roomE);
   }
   // default server
   if (server == null) server = "conference." + sd.account.getServer();
   createForm(display, room, server, null, null);
 }