Index: trunk/jabberit_messenger/java_source/src/nu/fw/jeti/applet/Jeti.java
===================================================================
--- trunk/jabberit_messenger/java_source/src/nu/fw/jeti/applet/Jeti.java	(revision 1014)
+++ trunk/jabberit_messenger/java_source/src/nu/fw/jeti/applet/Jeti.java	(revision 1064)
@@ -66,13 +66,13 @@
 {
 	private Start start;
-	public static JLabel from;
 	private static Jeti applet;
 	private URL exitURL;
 	private static String groupchatRoom;
 	private static String groupchatServer;
-	public static LoginInfo loginInfo;
 	private Backend backend;
 	private boolean started = false;
 	private SecureMethodRunner secureMethodInvoker;
+	public static JLabel from;
+	public static LoginInfo loginInfo;
 	public static String SERVEREXPRESSO;
 	public static String NAMECOMPANY;
@@ -82,4 +82,7 @@
 	public static List GROUPSUSER;
 	public static String SERVERJABBER;
+	public static String COUNTRY;
+	public static String LANGUAGE;
+	
 	/**
 	 * @Author	: Alexandre Correia - alexandrecorreia@celepar.pr.gov.br
@@ -109,5 +112,7 @@
 				String nameCompany = new String(applet.getParameter("NAMECOMPANY"));
 				String cnName = new String(applet.getParameter("CNNAME"));
-				
+				String country = new String(applet.getParameter("COUNTRY"));
+				String language = new String(applet.getParameter("LANGUAGE"));
+
 				/**
 				 * @Author : Alexandre Correia - alexandrecorreia@celepar.pr.gov.br
@@ -125,4 +130,9 @@
 				USEHTTPS = useHttps;
 				CNNAME = cnName;
+				LANGUAGE = language;
+				COUNTRY = country;
+
+				// Reinit languages incase they changed
+				I18N.init(language, country);
 				
 				groupchatRoom = getParameter("GROUPCHATROOM");
@@ -144,5 +154,5 @@
 						loginInfo = new LoginInfo(server,host,user,password,resource,port,ssl,0,false);
 				}
-				
+
 				Start.programURL = getCodeBase();
 				Start.applet = true;
@@ -150,7 +160,4 @@
 				start = new Start(getCodeBase().toString(),panel);
 				
-				// Reinit languages incase they changed
-				I18N.init();
-
 				backend = start.getBackend();
 				backend.getMain().translate();
Index: trunk/jabberit_messenger/java_source/src/nu/fw/jeti/languages/languages.java
===================================================================
--- trunk/jabberit_messenger/java_source/src/nu/fw/jeti/languages/languages.java	(revision 1064)
+++ trunk/jabberit_messenger/java_source/src/nu/fw/jeti/languages/languages.java	(revision 1064)
@@ -0,0 +1,187 @@
+package nu.fw.jeti.languages;
+
+public interface languages
+{
+	public static final Object[][] language_pt_BR =
+	{  
+		{ "Abort" , "&Abortar"},
+		{ "Apply" , "&Aplicar"},
+		{ "Cancel" , "Cancelar"},
+		{ "Close" , "&Fechar"},
+		{ "Loading" , "Carregando"},
+		{ "main.about.About_JETI" , "Sobre Jeti"},
+		{ "main.about.Version" , "Jeti Versão"},
+		{ "main.AddContact.Add_Contact" , "Adicionar contatos"},
+		{ "main.AddContact.Address" , "Endereço"},
+		{ "main.AddContact.Group" , "&Grupo"},
+		{ "main.AddContact.Nickname" , "&Apelido"},
+		{ "main.AddContact.Other" , "Outro"},
+		{ "main.AddContact.Screen_Name" , "Apelido na Tela"},
+		{ "main.AddContact.Select_Service" , "&Selecionar serviço:"},
+		{ "main.ChangePassword.Change_Password" , "Trocar senha"},
+		{ "main.ChangePassword.New_Password" , "Nova senha"},
+		{ "main.ChangePassword.Old_Password" , "Senha antiga"},
+		{ "main.ChangePassword.Password_not_equal" , "Senha não confere"},
+		{ "main.chat.{0}_(offline)" , "{0} (desconectado)"},
+		{ "main.chat.{0}_says_{1}" , "{0} diz: {1}"},
+		{ "main.chat.changed_status_to" , "trocou status para:"},
+		{ "main.chat.Chat_started_on" , "Chat iniciou em: "},
+		{ "main.chat.is_currently_offline" , " está desconectado"},
+		{ "main.chat.menu" , "Menu"},
+		{ "main.chat.menu.Close" , "Fechar aba"},
+		{ "main.chat.menu.Convert_to_tab" , "Converter aba em janela"},
+		{ "main.chat.menu.Move_to_Window" , "Move para janela"},
+		{ "main.chat.menu.To_front_on_new_message" , "Para frente numa nova mensagem"},
+		{ "main.chat.with_status_message" , "com status de mensagem:"},
+		{ "main.chat.You_are_about_to_close_{0}_tabs_Are_you_sure_you_want_to_close_them?" , "Você vai fechar {0} abas. Tem certeza que deseja fechá-las?"}, 
+		{ "main.error.{0}_contains_no_plugins" , "{0} não contém plugins"},
+		{ "main.error.{0}_is_not_valid" , "{0} não é válido"},
+		{ "main.error.{0}_plugin_failed_to_load" , "{0} plugin falhou ao carregar"},
+		{ "main.error.{0}_plugin_not_found" , "{0} plugin não encontrado"},
+		{ "main.error.Error" , "Erro"},
+		{ "main.error.Error_in_chat" , "Erro no bate-papo:"},
+		{ "main.error.Illegal_errorcode" , "Código de erro ilegal"},
+		{ "main.error.invalid_server" , "servidor inválido"},
+		{ "main.error.invalid_url_in_OOB_packet" , "url inválida no pacote OOB"},
+		{ "main.error.Last_Seen_Error" , "Último erro"},
+		{ "main.error.No_JID_found" , "JID não encontrado"},
+		{ "main.error.No_services" , "Sem serviço"},
+		{ "main.error.No_type" , "Sem tipo"},
+		{ "main.error.Register_Error" , "Erro no registro"},
+		{ "main.error.Register_Services" , "Registrar serviços"},
+		{ "main.error.registration_aborted,_code_{0}" , "registro abortado, código {0}."},
+		{ "main.error.Server_doesn't_support_browse" , "Servidor não suporta navegação"},
+		{ "main.error.Server_has_no_value" , "Servidor não tem valor"},
+		{ "main.error.Server_must_start_with_a_letter_(see_english_translation)" , "Servidor precisa começar com uma letra ou conter [A-Z], [a-z], [0-9], '.' or '-'"},
+		{ "main.error.Server_or_Username_contains_a_'@'" , "Servidor ou Usuário contém '@'"},
+		{ "main.error.Service_error" , "Erro de serviço"},
+		{ "main.error.Time_Error" , "Erro de tempo"},
+		{ "main.error.type_must_be_specified" , "tipo precisa ser informado"},
+		{ "main.error.Unknown_error" , "erro desconhecido"},
+		{ "main.error.Unknown_Extension" , "extensão desconhecida"},
+		{ "main.error.Unknown_Packet" , "pacote desconhecido"},
+		{ "main.error.User_{0}_could_not_be_found" , "Usuário {0} não foi encontrado"},
+		{ "main.error.Username_>_255_Characters" , "Usuário > 255 caracteres"},
+		{ "main.error.Username_contains_illegal_chars_(see_english_translation)" , "Usuário contém caracteres inválidos"},
+		{ "main.error.Version_Error" , "Erro na versão"},
+		{ "main.error.Wrong_contact_name" , "Nome de contato inválido"},
+		{ "main.error.Wrong_Jabber_Identifier" , "Identificador Jabber inválido (JID)"},
+		{ "main.error.wrong_type" , "tipo errado"},
+		{ "main.log.Clear_Log" , "&Texto puro"},
+		{ "main.log.Errors" , "Erros"},
+		{ "main.log.For_security_reasons_it_is_not_possible_to_change_passwords,_please_use_the_jeti_functions_for_that" , "Por razões de segurança, não é possível trocar sua senha, use as funções do Jeti para isso."},
+		{ "main.log.For_security_reasons_it_is_not_possible_to_remove_accounts,_please_use_the_jeti_functions_for_that" , "Por razões de segurança, não é possível remover contas, use as funções do Jeti para isso."},
+		{ "main.log.JETI_Log" , "Jeti Log"},
+		{ "main.log.Please_wait_loading_log" , "Por favor aguarde, carregando log"},
+		{ "main.log.Refresh" , "&Atualizar"},
+		{ "main.log.Send_XML" , "Enviar XML"},
+		{ "main.log.Send_XML_to_the_Jabber_server,_use_this_at_your_own_risk" , "Enviar XML para o servidor Jabber, use isso por sua conta própria."},
+		{ "main.log.XML" , "XML"},
+		{ "main.log.XML_Errors" , "XML Erros"},
+		{ "main.loginstatus.Could_not_login_with_SHA" , "Não poder carregar login com SHA"},
+		{ "main.loginstatus.Could_not_open_input_because" , "Não pode abrir entrada porque"},
+		{ "main.loginstatus.Could_not_open_output_because" , "Não pode abrir saída porque"}, 
+		{ "main.loginstatus.Lost_Input" , "Entrada perdida"},
+		{ "main.loginstatus.Not_logged_in_because" , "Não conectado porque"},
+		{ "main.loginstatus.Server_{0}_could_not_be_found" , "Servidor {0} não pode ser encontrado."},
+		{ "main.main.jetimenu.About" , "Sobre Jeti"},
+		{ "main.main.jetimenu.Add_Contact" , "Adicionar Contato"},
+		{ "main.main.jetimenu.Chat" , "&Bate-papo"},
+		{ "main.main.jetimenu.Exit" , "Sair"},
+		{ "main.main.jetimenu.Show_Log" , "Mostrar Jeti &Log"},
+		{ "main.main.List_Contacts" , "Lista de Contatos"},
+		{ "main.main.Offline", "Desconectado" },
+		{ "main.main.Online",  "Conectado" },
+		{ "main.main.presencebutton.Available", "&Conectado"},
+		{ "main.main.presencebutton.Away","&Ausente"},
+		{ "main.main.presencebutton.DND","&Não pertube"},
+		{ "main.main.presencebutton.FreeforChat","&Livre para bate-papo"},
+		{ "main.main.presencebutton.Invisible", "&Invisível"},
+		{ "main.main.presencebutton.Offline", "&Desconectado"},
+		{ "main.main.presencebutton.XA", "&Ausência prolongada"},
+		{ "main.main.roster.Friends" , "Contatos"},
+		{ "main.main.roster.Servers" , "Servidores"},
+		{ "main.main.roster.Status" , "Status:"},
+		{ "main.main.roster.Subscription" , "Descrição:"},
+		{ "main.main.roster.Unfiled" , "Sem Grupo"},
+		{ "main.main.roster.Waiting_Status" , "Aguardando Status:"},
+		{ "main.main.rostermenu.Add_to_Group" , "Adicionar no grupo"},
+		{ "main.main.rostermenu.Change_Group" , "Trocar Grupo"},
+		{ "main.main.rostermenu.Chat" , "&Bate-papo"},
+		{ "main.main.rostermenu.Edit_Registration" , "Editar registro"},
+		{ "main.main.rostermenu.Group" , "&Grupo"},
+		{ "main.main.rostermenu.Invisible" , "&Invisível"},
+		{ "main.main.rostermenu.Last_Seen" , "Último acesso"},
+		{ "main.main.rostermenu.Local_Time" , "Local &Data"},
+		{ "main.main.rostermenu.Local_Version" , "Local &Versão"},
+		{ "main.main.rostermenu.Log_Off" , "Desconectar"},
+		{ "main.main.rostermenu.Log_On" , "Conectar"},
+		{ "main.main.rostermenu.Message" , "&Mensagem"},
+		{ "main.main.rostermenu.Remove" , "Remover"},
+		{ "main.main.rostermenu.Remove_from_group" , "&Remover do grupo"},
+		{ "main.main.rostermenu.Rename" , "&Renomear"},
+		{ "main.main.rostermenu.Set_Invisible" , "Ficar invisível"},
+		{ "main.main.rostermenu.Set_Visible" , "Ficar visível"},
+		{ "main.main.rostermenu.Subscribe_from" , "Autorizar"},
+		{ "main.main.rostermenu.Subscriptions" , "Autorizações"},
+		{ "main.main.rostermenu.Unsubscribe_from" , "Cancelar autorização"},
+		{ "main.main.statusmenu.Change_message" , "&Trocar mensagem"},
+		{ "main.main.statusmenu.Manage_messages" , "&Gerenciar mensagens"},
+		{ "main.main.statusmenu.Status_message" , "Mensagem de Status:"},
+		{ "main.manageservices.Change_Server" , "&Trocar servidor"},
+		{ "main.manageservices.Manage_Services" , "&Gerenciar serviços"},
+		{ "main.manageservices.Register" , "&Registrar"},
+		{ "main.manageservices.Server" , "&Servidor"},
+		{ "main.popup.{0}_is_in_the_last_group,_remove_completely?" , "{0} é o \u00FAltimo grupo, remover completamente?"},
+		{ "main.popup.{0}_is_in_timezone_{1}" , "{0} fuso-horário {1}"},
+		{ "main.popup.{0}_not_found" , "{0} não encontrado."},
+		{ "main.popup.{0}_not_found_until_the_end_of_this_file,_start_again_from_the_beginning?" , "{0} não encontrado o final no arquivo, começar novamente no início do arquivo?"},
+		{ "main.popup.{0}_uses_{1},_version_{2},_On_{3}" , "{0} use: {1}, versão: {2}, On: {3}"},
+		{ "main.popup.{0}_wants_to_subscribe_to_your_presence" , "{0} quer registrar sua presença"},
+		{ "main.popup.{0}_was_last_seen_{1}_seconds_ago" , "{0} foi visto {1} segundos atrás."},
+		{ "main.popup.{0}_was_last_seen_on_{1}" , "{0} foi visto em {1}"},
+		{ "main.popup.Add_{0}_to" , "Adicionar {0} para :"},
+		{ "main.popup.Add_to_roster" , "Adicionar para roster"},
+		{ "main.popup.Change_{0}_from_{1}_to" , "Trocar {0} para {1} to :"},
+		{ "main.popup.Deny_subscription" , "Negar registrar"},
+		{ "main.popup.Enter_the_text_to_search_for" , "Entre o texto de pesquisa para"}, 
+		{ "main.popup.Find" , "Procurar"},
+		{ "main.popup.Last_Seen" , "Visto em"},
+		{ "main.popup.Local_time_for_{0}_is" , "Hora local para {0} é"},
+		{ "main.popup.logged_in_as_{0}_on_server_{1}_with_resource_{2}" , "Logado como: {0}non server: {1}nwith resource: {2}\nJID "  ,"\"{0}@{1}/{2}\""},
+		{ "main.popup.Message" , "Mensagem"},
+		{ "main.popup.Really_remove_{0}_from_all_groups_?" , "Realmente remover {0} todos os grupos?"},
+		{ "main.popup.Really_remove_{0}?_All_JIDs_in_this_group_will_be_removed!" , "Realmente remover {0}? Todos JIDs neste grupo serão removidos!"},
+		{ "main.popup.Remove_Group" , "Remover Grupo"},
+		{ "main.popup.Rename_{0}_to" , "Renomear {0} to:"},
+		{ "main.popup.Reply" , "Responder"},
+		{ "main.popup.Subject" , "Informação"},
+		{ "main.popup.Subscription_request" , "Requer assinatura"},
+		{ "main.popup.Time" , "Tempo"},
+		{ "main.popup.Version" , "Versão"},
+		{ "main.presence.Available" , "Disponível"},
+		{ "main.presence.Away" , "Ausente"},
+		{ "main.presence.Do_not_Disturb" , "Não Perturbe"},
+		{ "main.presence.Extended_Away" , "Ausência Prolongada"},
+		{ "main.presence.Free_for_Chat" , "Bate-papo"},
+		{ "main.presence.Invisible" , "Invisível"},
+		{ "main.presence.Unavailable" , "Indisponível"},
+		{ "main.presence.Unknown" , "Desconhecido"},
+		{ "main.register.Instructions" , "Instruções"},
+		{ "main.register.Password" , "Senha"},
+		{ "main.register.Register" , "Registar"},
+		{ "main.register.registration_succeded" , "registrado com sucesso."},
+		{ "main.register.Username" , "Usuário"},
+		{ "main.statusmessages.Add" , "&Adicionar"},
+		{ "main.statusmessages.Manage_Status_Messages" , "Gerenciar Mensagens"},
+		{ "main.statusmessages.Remove" , "&Remover"},
+		{ "Name" , "Nome"},
+		{ "OK" , "&OK"},
+		{ "Organization" , "Organização"},
+		{ "Remove" , "&Remover"},
+		{ "Retry" , "&Tentar"},
+		{ "Save" , "Salvar"},
+		{ "Send" , "&Enviar"},
+	};
+	
+}
Index: trunk/jabberit_messenger/java_source/src/nu/fw/jeti/languages/languagesPlugins.java
===================================================================
--- trunk/jabberit_messenger/java_source/src/nu/fw/jeti/languages/languagesPlugins.java	(revision 1064)
+++ trunk/jabberit_messenger/java_source/src/nu/fw/jeti/languages/languagesPlugins.java	(revision 1064)
@@ -0,0 +1,67 @@
+package nu.fw.jeti.languages;
+
+public interface languagesPlugins
+{
+	/**
+	 *  Loag Lang PT_BR for plugins
+	 */
+	
+	public static final Object[][] languagePlugins_pt_BR =
+	{
+		{ "filetransfer.{0}_already_exist,_overwrite?" , "{0} já existe, sobrescrever?"},
+		{ "filetransfer.{0}_could_not_be_openend_in_write_mode" , "{0} não pode ser aberto em modo de escrita."},
+		{ "filetransfer.{0}_did_not_accept_the_file" , "{0} não pode aceitar o arquivo"},
+		{ "filetransfer.{0}_does_not_exist" , "{0} não existe"},
+		{ "filetransfer.{0}_does_not_support_file_transfer_or_is_offline" , "{0} não suporta transferência de arquivos ou está offline."},
+		{ "filetransfer.{0}_is_not_online" , "{0} não esta online."},
+		{ "filetransfer.{0}_is_not_readable" , "{0} não esta legível."},
+		{ "filetransfer.Abort" , "Abortar"},
+		{ "filetransfer.automatic" , "automático"},
+		{ "filetransfer.behind_firewall_or_NAT" , "atrás de um firewall ou  NAT"},
+		{ "filetransfer.Can_not_transfer_directories" , "Não pode transferir diretórios"},
+		{ "filetransfer.Close" , "Fechar"},
+		{ "filetransfer.close_download_windows_when_download_ready" , "Fechar a janela quando terminar o download."},
+		{ "filetransfer.Description" , "&Descrição"},
+		{ "filetransfer.Download" , "Download"},
+		{ "filetransfer.File_Error" , "Erro no arquivo"},
+		{ "filetransfer.File_Name" , "&Nome do arquivo"},
+		{ "filetransfer.File_Size" , "Tamhando do arquivo"},
+		{ "filetransfer.File_Transfer" , "Transferência de arquivo"},
+		{ "filetransfer.From" , "De"},
+		{ "filetransfer.ip" , "ip"},
+		{ "filetransfer.No_compatible_transfer_protocols_found" , "Sem protocolos compatíveis para transferência"},
+		{ "filetransfer.No_recipient_specified" , "Destinatário não especificado."},
+		{ "filetransfer.Opening_connection" , "Estabelecendo conexão"},
+		{ "filetransfer.port" , "porta"},
+		{ "filetransfer.Problem_during_file_transfer,_transfer_aborted" , "Problemas durante a transferência, transferência abortada."},
+		{ "filetransfer.Recipient?" , "Destinatário?"},
+		{ "filetransfer.Send" , "&Enviar"},
+		{ "filetransfer.Send_file_to" , "Mandar arquivo para"},
+		{ "filetransfer.To" , "Para"},
+		{ "filetransfer.Transfer_complete" , "Transferência completa"},
+		{ "filetransfer.Transfer_File" , "Transferir arquivo"},
+		{ "filetransfer.Transferring" , "Transferindo"},
+		{ "filetransfer.URL" , "&URL"},
+		{ "xhtml.{0}_does_not_support_formatted_messages" , "{0} não suporta mensagens formatadas" },
+		{ "xhtml.background" , "fundo" },
+		{ "xhtml.Bold" , "Negrito" },
+		{ "xhtml.BoldItalic" , "Negrito/Itálico" },
+		{ "xhtml.Choose_Font" , "Escolher fonte" },
+		{ "xhtml.Color" , "Cor" },
+		{ "xhtml.Font" , "Fonte" },
+		{ "xhtml.Font_Family" , "Família de Fonte" },
+		{ "xhtml.foreground" , "primeiro plano" },
+		{ "xhtml.Formats_messages" , "Formartar mensagens" },
+		{ "xhtml.Italic" , "Itálico" },
+		{ "xhtml.Plain" , "Plano" },
+		{ "xhtml.Preview" , "Pre-vizualizar" },
+		{ "xhtml.Select_Color" , "Selecionar cor" },
+		{ "xhtml.Size" , "Tamanho" },
+		{ "xhtml.Style" , "Estilo" },
+		{ "xhtml.Transfer_File" , "Transferência de Arquivo" },
+		{ "xhtml.The_font_used_when_sending_messages" , "A fonte usada para mandar mensagem" },
+		{ "xhtml.The_quick_brown_fox_jumped_over_the_lazy_dogs" , "A ligeira raposa ultrapassou os lobos preguiçosos" }, 
+		{ "xhtml.Underline" , "Sublinhado" }
+	};
+
+}
Index: trunk/jabberit_messenger/java_source/src/nu/fw/jeti/backend/Start.java
===================================================================
--- trunk/jabberit_messenger/java_source/src/nu/fw/jeti/backend/Start.java	(revision 1014)
+++ trunk/jabberit_messenger/java_source/src/nu/fw/jeti/backend/Start.java	(revision 1064)
@@ -56,5 +56,4 @@
 {
 	public static final String VERSION = "0.7.7";
-	//public final static String OS2 = "/2";
 	public final static String OS2 = "";
 	public static String BUILD_DATE;
@@ -89,7 +88,7 @@
 			ex.printStackTrace();
 		}
-		if(!applet && System.getProperty("jnlpx.home")!=null)webstart = true;
-		
-		if (urlString == null) urlString = getPath();
+		
+		if ( urlString == null) 
+			urlString = getPath();
 		
 		if (System.getProperty("file.separator").equals("/"))
@@ -97,63 +96,16 @@
 			pluginPath = urlString.substring(5);
 		}
-		else pluginPath = urlString.substring(6);
+		else 
+			pluginPath = urlString.substring(6);
+		
 		pluginPath = pluginPath.replace('/', File.separatorChar);
 		
-		
-		
-		if(programURL==null)
-		{
-			try
-			{
-				programURL = new URL(urlString);
-				
-				if(webstart || (path!=null&&path.equals("home")))
-				{
-					path = System.getProperty("user.home")+ File.separatorChar
-												+ ".jeti" +File.separatorChar;
-					File dir =new File(path);
-					if(!dir.exists())
-					{
-						if(!dir.mkdir())
-						{
-							JOptionPane.showMessageDialog(null, "Directory " + dir + " could not be created, Jeti will close");
-							System.exit(1);
-						}
-					}
-					dataURL = new URL("file:/"+path);
-				}
-				else if(path!=null)
-				{
-					File dir =new File(path);
-					if(!dir.exists())
-					{
-						if(!dir.mkdir())
-						{
-							JOptionPane.showMessageDialog(null, "Directory " + dir + " could not be created, Jeti will close");
-							System.exit(1);
-						}
-					}
-					dataURL = new URL("file:/"+path);
-				}
-				else
-				{
-					dataURL = programURL;
-					path = pluginPath;
-				}
-				System.out.println(programURL);
-				System.out.println(dataURL);
-			}
-			catch (MalformedURLException ex)
-			{
-				ex.printStackTrace();
-			}
-		}
-		else 
-		{
-			//if programurl null applet or network so use program path as data path 
-			dataURL = programURL;
-			path = pluginPath;
-		}
-						
+		/**
+		 * Se o programurl for null, applet ou network tb usa program path como data path
+		 */
+		
+		dataURL = programURL;
+		path = pluginPath;
+
 		try
 		{
@@ -162,5 +114,6 @@
 			BUILD_DATE = p.getProperty("buildDate");
 			BUILD_NUM = p.getProperty("buildNum");
-		} catch (Exception e)
+		} 
+		catch (Exception e)
 		{
 			System.out.println("Can't find the version.properties file");
@@ -170,27 +123,6 @@
 		backend = new Backend(this);
 		new Preferences(backend, parser);
-		I18N.init();
-		//Preferences.initMessages();
 		JFrame.setDefaultLookAndFeelDecorated(Preferences.getBoolean("jeti","javadecorations",false));
 		
-		if(Preferences.getBoolean("jeti", "nativeLnF", false))
-		{
-			try
-			{
-				UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-			} catch (ClassNotFoundException e)
-			{
-				e.printStackTrace();
-			} catch (InstantiationException e)
-			{
-				e.printStackTrace();
-			} catch (IllegalAccessException e)
-			{
-				e.printStackTrace();
-			} catch (UnsupportedLookAndFeelException e)
-			{
-				e.printStackTrace();
-			}
-		}
 		//parse plugins? make better or make comments
 		new StatusIcons(parser);
Index: trunk/jabberit_messenger/java_source/src/nu/fw/jeti/ui/models/LocaleModel.java
===================================================================
--- trunk/jabberit_messenger/java_source/src/nu/fw/jeti/ui/models/LocaleModel.java	(revision 1014)
+++ 	(revision )
@@ -1,109 +1,0 @@
-/* 
- *	Jeti, a Java Jabber client, Copyright (C) 2004 E.S. de Boer  
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- *	For questions, comments etc, 
- *	use the website at http://jeti.jabberstudio.org
- *  or mail me at eric@jeti.tk or Jabber at jeti@jabber.org
- *
- *	Created on 10-jul-2004
- */
- 
-package nu.fw.jeti.ui.models;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemListener;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.swing.AbstractListModel;
-import javax.swing.ComboBoxModel;
-import javax.swing.JComboBox;
-
-import nu.fw.jeti.util.I18N;
-
-/**
- * @author E.S. de Boer
- *
- */
-public class LocaleModel extends AbstractListModel implements ComboBoxModel, ActionListener
-{
-	private Map countries;
-	private List currentCountries;
-	private Object selectedItem;
-	
-	public LocaleModel(I18N i18n)
-	{
-		countries = i18n.getCountries();
-		//currentCountries = (List)countries.get("en");
-	}
-		
-	/* (non-Javadoc)
-	 * @see javax.swing.ComboBoxModel#getSelectedItem()
-	 */
-	public Object getSelectedItem()
-	{
-		return selectedItem;
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.swing.ComboBoxModel#setSelectedItem(java.lang.Object)
-	 */
-	public void setSelectedItem(Object arg0)
-	{
-		selectedItem = arg0;
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.swing.ListModel#getSize()
-	 */
-	public int getSize()
-	{
-		return currentCountries.size();
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.swing.ListModel#getElementAt(int)
-	 */
-	public Object getElementAt(int pos)
-	{
-		return currentCountries.get(pos);
-	}
-
-	/**
-	 * react to language combobox events
-	 */
-	public void actionPerformed(ActionEvent e)
-	{
-		  JComboBox cb = (JComboBox)e.getSource();
-		  String languageCode =((I18N.Language)cb.getSelectedItem()).getLanguageCode();
-		 // if(currentCountries!=null) fireIntervalRemoved(this,0,currentCountries.size());
-		  currentCountries = (List) countries.get(languageCode);
-	      //fireIntervalAdded(this,0,currentCountries.size());
-	      
-	      fireContentsChanged(this,0,currentCountries.size());
-	}
-
-}
-
-/*
- * Overrides for emacs
- * Local variables:
- * tab-width: 4
- * End:
- */
Index: trunk/jabberit_messenger/java_source/src/nu/fw/jeti/ui/Jeti.java
===================================================================
--- trunk/jabberit_messenger/java_source/src/nu/fw/jeti/ui/Jeti.java	(revision 1014)
+++ trunk/jabberit_messenger/java_source/src/nu/fw/jeti/ui/Jeti.java	(revision 1064)
@@ -455,18 +455,4 @@
 		}
         
-		if(Preferences.getBoolean("jeti","jetimenuShowOptions",true))
-        {
-			menuItem = new JMenuItem(I18N.gettext("main.main.jetimenu.Options")+"...");
-			I18N.setMnemonic("main.main.jetimenu.Options",menuItem);
-			menuItem.addActionListener(new java.awt.event.ActionListener()
-			{
-				public void actionPerformed(ActionEvent e)
-				{
-					new OptionsWindow(backend).setVisible(true);
-				}
-			});
-		    addMenuItem(menuItem);
-        }
-        
         menuItem = new JMenuItem();
 		I18N.setTextAndMnemonic("main.main.jetimenu.About",menuItem,true);
Index: trunk/jabberit_messenger/java_source/src/nu/fw/jeti/ui/PluginsPanel.java
===================================================================
--- trunk/jabberit_messenger/java_source/src/nu/fw/jeti/ui/PluginsPanel.java	(revision 1014)
+++ 	(revision )
@@ -1,165 +1,0 @@
-/* 
- *	Jeti, a Java Jabber client, Copyright (C) 2002 E.S. de Boer  
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- *	For questions, comments etc, 
- *	use the website at http://jeti.jabberstudio.org
- *  or mail me at eric@jeti.tk
- */
-
-
-package nu.fw.jeti.ui;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.io.File;
-import java.text.MessageFormat;
-import java.util.List;
-
-import javax.swing.JButton;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.table.DefaultTableCellRenderer;
-
-import nu.fw.jeti.backend.Start;
-import nu.fw.jeti.plugins.PluginData;
-import nu.fw.jeti.plugins.PluginsInfo;
-import nu.fw.jeti.plugins.PreferencesPanel;
-import nu.fw.jeti.ui.models.ListTableModel;
-import nu.fw.jeti.util.I18N;
-import nu.fw.jeti.util.Preferences;
-import nu.fw.jeti.util.TableSorter;
-
-/**
- * @author E.S. de Boer
- * @version 1.0
- */
-public class PluginsPanel extends PreferencesPanel
-{//change to jtreetable http://java.sun.com/products/jfc/tsc/articles/treetable2/index.html
-    private JScrollPane jScrollPane1 = new JScrollPane();
-    private JTable jTable1;
-    private JButton jButton1 = new JButton();
-	private OptionsWindow prefWindow;
-    private List plugins;
-    private ListTableModel dataModel;
-
-    public PluginsPanel(OptionsWindow pref)
-    {
-		prefWindow = pref;
-		
-        plugins = Preferences.getTranslatedPlugins();
-        dataModel = new ListTableModel(
-            new String[]{
-                I18N.gettext("main.options.Name"),
-                I18N.gettext("main.options.Enabled"),
-                I18N.gettext("main.options.Description")},
-            plugins);
-        TableSorter sorter = new TableSorter(dataModel);
-        jTable1 = new JTable(sorter);
-        sorter.setTableHeader(jTable1.getTableHeader());
-        sorter.setSortingStatus(0, TableSorter.ASCENDING);
-        jTable1.setDefaultRenderer(String.class, new PluginRenderer());
-		jTable1.setRowSelectionAllowed(false);
-        jTable1.getColumnModel().getColumn(0).setPreferredWidth(60);
-        jTable1.getColumnModel().getColumn(1).setPreferredWidth(15);
-        jTable1.getColumnModel().getColumn(2).setPreferredWidth(180);
-        
-		setLayout(new BorderLayout());
-		if (!Start.applet && new File(Start.path + "plugins").exists())
-		{	
-	        jButton1.setText(I18N.gettext("main.options.Scan_plugins"));
-	        jButton1.addActionListener(new java.awt.event.ActionListener()
-	        {
-	            public void actionPerformed(ActionEvent e)
-	            {
-	                jButton1_actionPerformed(e);
-	            }
-	        });
-	        add(jButton1, BorderLayout.SOUTH);
-		}
-        add(jScrollPane1, BorderLayout.CENTER);
-        jScrollPane1.getViewport().add(jTable1);
-    }
-
-    void jButton1_actionPerformed(ActionEvent e)
-    {
-		new PluginData().scanPlugins();
-		dataModel.reload(Preferences.getTranslatedPlugins());
-			
-    }
-
-	public void savePreferences()
-	{
-		List oldStatus = nu.fw.jeti.util.Preferences.getPlugins();
-		List newStatus =dataModel.getPlugins();
-		for(int i=0;i<newStatus.size();i++)
-		{
-			Object[] newS =(Object[]) newStatus.get(i);
-			Object[] oldS =(Object[]) oldStatus.get(i);
-			if(!newS[1].equals(oldS[1]))
-			{
-				oldS[1] = newS[1];
-				String name =(String)oldS[0];
-				if(((Boolean)oldS[1]).booleanValue())
-				{//load
-					PluginsInfo.loadPlugin(name);
-					prefWindow.addPanel(name);
-				}
-				else
-				{//unload
-					PluginsInfo.unloadPlugin(name);
-					prefWindow.removePanel(name);
-				}
-			}
-		}
-	}
-	
-	  class PluginRenderer extends DefaultTableCellRenderer {
-        String format;
-	
-        public PluginRenderer() {
-            super();
-            format = I18N.gettext("main.options.Version_{0}_(Jeti_{1})");
-        }
-
-        public Component getTableCellRendererComponent(JTable table,
-                                                       Object value,
-                                                       boolean isSelected,
-                                                       boolean hasFocus,
-                                                       int row,
-                                                       int column) {
-        	if(row<plugins.size())
-        	{
-	            String pluginVersion = (String)((Object[])plugins.get(row))[3];
-	            String jetiVersion = (String)((Object[])plugins.get(row))[4];
-        	
-	            setToolTipText(
-	            		MessageFormat.format(
-	            			format, new Object[]{pluginVersion, jetiVersion}));
-        	}
-            return super.getTableCellRendererComponent(
-                table, value, isSelected, hasFocus, row, column);
-        }
-    }
-
-}
-/*
- * Overrides for emacs
- * Local variables:
- * tab-width: 4
- * End:
- */
Index: trunk/jabberit_messenger/java_source/src/nu/fw/jeti/ui/OptionsWindow.java
===================================================================
--- trunk/jabberit_messenger/java_source/src/nu/fw/jeti/ui/OptionsWindow.java	(revision 1014)
+++ 	(revision )
@@ -1,250 +1,0 @@
-/* 
- *	Jeti, a Java Jabber client, Copyright (C) 2001 E.S. de Boer  
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- *	For questions, comments etc, 
- *	use the website at http://jeti.jabberstudio.org
- *  or mail me at eric@jeti.tk
- */
-
-package nu.fw.jeti.ui;
-
-import java.awt.BorderLayout;
-import java.awt.CardLayout;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.KeyEvent;
-import java.io.File;
-import java.lang.reflect.Constructor;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.swing.*;
-import javax.swing.border.EtchedBorder;
-import javax.swing.event.TreeSelectionEvent;
-import javax.swing.event.TreeSelectionListener;
-import javax.swing.tree.*;
-
-import nu.fw.jeti.backend.Start;
-import nu.fw.jeti.images.IconPrefPanel;
-import nu.fw.jeti.jabber.Backend;
-import nu.fw.jeti.jabber.elements.IQPrivate;
-import nu.fw.jeti.jabber.elements.InfoQuery;
-import nu.fw.jeti.plugins.PluginsInfo;
-import nu.fw.jeti.plugins.PreferencesPanel;
-import nu.fw.jeti.util.I18N;
-import nu.fw.jeti.util.Preferences;
-import nu.fw.jeti.util.Utils;
-
-/**
- * @author E.S. de Boer
- * @version 1.0
- * window for the user and plugin preferences
- */
-
-public class OptionsWindow extends JFrame
-{
-	//private JTabbedPane jTabbedPane1 = new JTabbedPane();
-	private JPanel cards = new JPanel(new CardLayout());
-	private JTree tree;
-	private JPanel jPanel2 = new JPanel();
-	private JButton btnApply = new JButton();
-	private JButton btnCancel = new JButton();
-	private JButton btnOK = new JButton();
-	private Map panels = new HashMap();
-	private Map nodes = new HashMap(); //needed to delete from tree
-	private Backend backend;
-	private PreferencesPanel pluginPanel;
-	
-	public OptionsWindow(Backend backend)
-	{
-		this.backend = backend;
-		DefaultMutableTreeNode node = new DefaultMutableTreeNode();
-		//setIconImage(nu.fw.jeti.images.StatusIcons.getImageIcon("jeti").getImage());
-		setTitle(I18N.gettext("main.options.Options"));
-		I18N.setTextAndMnemonic("Apply",btnApply);
-		btnApply.addActionListener(new java.awt.event.ActionListener()
-		{
-			public void actionPerformed(ActionEvent e)
-			{
-				btnApply_actionPerformed(e);
-			}
-		});
-		Action cancelAction = new AbstractAction(I18N.gettext("Cancel"))
-		{
-			public void actionPerformed(ActionEvent e)
-			{
-				btnCancel_actionPerformed(e);
-			}
-		};
-		Utils.addCancelButton(this, btnCancel, cancelAction);
-		
-		btnOK.setText(I18N.gettext("OK"));
-		getRootPane().setDefaultButton(btnOK);
-		btnOK.addActionListener(new java.awt.event.ActionListener()
-		{
-			public void actionPerformed(ActionEvent e)
-			{
-				btnOK_actionPerformed(e);
-			}
-		});
-		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
-		
-		jPanel2.add(btnOK);
-		jPanel2.add(btnCancel);
-		jPanel2.add(btnApply);
-		
-		pluginPanel = new PluginsPanel(this);
-		panels.put(I18N.gettext("main.options.Plugins"), pluginPanel);
-		cards.add(pluginPanel, I18N.gettext("main.options.Plugins"));
-		PreferencesPanel panel = null;
-		node.add(new DefaultMutableTreeNode(I18N.gettext("main.options.Plugins")));
-
-		panel = new StdPreferencesPanel(backend);
-		panels.put(I18N.gettext("main.options.Standard"), panel);
-		cards.add(panel, I18N.gettext("main.options.Standard"));
-		node.add(new DefaultMutableTreeNode(I18N.gettext("main.options.Standard")));
-		
-		for (Iterator i = PluginsInfo.loadedPreferencePanels.entrySet().iterator(); i.hasNext();)
-		{
-			Map.Entry temp = (Map.Entry) i.next();
-			try
-			{
-				Class c = (Class) temp.getValue();
-				Constructor co = c.getConstructor(new Class[] { Backend.class });
-				panel = (PreferencesPanel) co.newInstance(new Object[] { backend });
-			}
-			catch (Exception e2)
-			{
-				e2.printStackTrace();
-				break;
-			}
-            if (!panel.inhibited()) {
-                String name = (String) temp.getKey();
-                panels.put(name, panel);
-                cards.add(panel, name);
-                DefaultMutableTreeNode mnode= new DefaultMutableTreeNode(name);
-                nodes.put(name, mnode);
-                node.add(mnode);
-            }
-		}
-		panel = null;
-		
-		tree = new JTree(new DefaultTreeModel(node));
-		tree.setPreferredSize(new Dimension(100,10));
-		tree.setRootVisible(false);
-		tree.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
-		DefaultTreeCellRenderer renderer =	new DefaultTreeCellRenderer();
-		renderer.setLeafIcon(null);
-		renderer.setOpenIcon(null);
-		renderer.setClosedIcon(null);
-		tree.setCellRenderer(renderer);
-		
-		tree.addTreeSelectionListener(new TreeSelectionListener()
-		{
-			public void valueChanged(TreeSelectionEvent e) 
-			{
-				DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
-				if (node == null) return;
-				String nodeInfo = (String) node.getUserObject();
-				if(panels.containsKey(nodeInfo))
-				{
-					((CardLayout)cards.getLayout()).show(cards, nodeInfo);
-				}
-			}
-		});
-		getContentPane().add(cards, BorderLayout.CENTER);
-		getContentPane().add(tree, BorderLayout.WEST);
-		getContentPane().add(jPanel2, BorderLayout.SOUTH);
-		pack();
-		setLocationRelativeTo(null);
-	}
-
-	public void removePanel(String name)
-	{
-		if(panels.containsKey(name))
-		{	
-			cards.remove((Component) panels.get(name));
-			DefaultTreeModel model = (DefaultTreeModel)tree.getModel();
-			model.removeNodeFromParent((DefaultMutableTreeNode)nodes.get(name));
-			nodes.remove(name);
-			panels.remove(name);
-		}
-	}
-
-	public void addPanel(String name)
-	{
-		PreferencesPanel panel = null;
-		try
-		{
-			Class c = (Class) PluginsInfo.loadedPreferencePanels.get(name);
-			Constructor co = c.getConstructor(new Class[] { Backend.class });
-			panel = (PreferencesPanel) co.newInstance(new Object[] { backend });
-		}
-		catch (Exception e2)
-		{
-			//System.err.println("no preferences panel");
-			return;
-		}
-        if (!panel.inhibited()) {
-            panels.put(name, panel);
-            cards.add(panel, name);
-            DefaultTreeModel model = (DefaultTreeModel)tree.getModel();
-            DefaultMutableTreeNode mnode= new DefaultMutableTreeNode(name);
-            nodes.put(name, mnode);
-            model.insertNodeInto(mnode,(MutableTreeNode)model.getRoot(),((TreeNode)model.getRoot()).getChildCount());
-        }
-	}
-
-	public void savePreferences()
-	{
-		for (Iterator i = panels.values().iterator(); i.hasNext();)
-		{
-			PreferencesPanel pp = (PreferencesPanel) i.next();
-			if(pp!=pluginPanel) pp.savePreferences();
-		}
-		pluginPanel.savePreferences();
-		if(Start.applet)backend.send(new InfoQuery("set",new IQPrivate(new nu.fw.jeti.applet.JetiPrivatePreferencesExtension(new Preferences()))));
-		else Preferences.save();
-	}
-
-	void btnApply_actionPerformed(ActionEvent e)
-	{
-		savePreferences();
-	}
-
-	void btnCancel_actionPerformed(ActionEvent e)
-	{
-		panels = null;
-		cards.removeAll();
-		cards = null;
-		this.dispose();
-	}
-
-	void btnOK_actionPerformed(ActionEvent e)
-	{
-		savePreferences();
-		btnCancel_actionPerformed(null);
-	}
-}
-/*
- * Overrides for emacs
- * Local variables:
- * tab-width: 4
- * End:
- */
Index: trunk/jabberit_messenger/java_source/src/nu/fw/jeti/ui/StdPreferencesPanel.java
===================================================================
--- trunk/jabberit_messenger/java_source/src/nu/fw/jeti/ui/StdPreferencesPanel.java	(revision 1014)
+++ 	(revision )
@@ -1,282 +1,0 @@
-package nu.fw.jeti.ui;
-
-import java.awt.Dimension;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.File;
-import java.util.Locale;
-
-import javax.swing.*;
-
-import nu.fw.jeti.jabber.Backend;
-import nu.fw.jeti.plugins.PreferencesPanel;
-import nu.fw.jeti.ui.models.LocaleModel;
-import nu.fw.jeti.util.I18N;
-import nu.fw.jeti.util.ImageFileFilter;
-import nu.fw.jeti.util.Preferences;
-import nu.fw.jeti.util.SwingWorker;
-
-/**
- * @author E.S. de Boer
- *
- * 
- */
-public class StdPreferencesPanel extends PreferencesPanel
-{
-	private Backend backend;
-	private JCheckBox chkEnter;
-	public static JCheckBox chkBeep;
-	private JCheckBox chkNick;
-	private JCheckBox chkBMW;
-	private JCheckBox chkTaskbar;
-	private JCheckBox chkTitle;
-	private JCheckBox chkOFFline;
-	private JCheckBox chkToFrontOnNewMessage;
-	private JCheckBox chkJetiPos;
-	private JCheckBox chkJetiTabs;
-	private JCheckBox chkShowTimestamp;
-	private JCheckBox chkImageScaled;
-	private JComboBox cmbLanguage;
-	private JComboBox cmbCountry;
-	private boolean oldOFFline;
-	private JTextField txtBackground;
-
-	public StdPreferencesPanel(Backend backend)
-	{
-		this.backend = backend;
-
-        setLayout(new GridBagLayout());
-        GridBagConstraints c = new GridBagConstraints();
-        c.gridwidth = GridBagConstraints.REMAINDER;
-        c.anchor = GridBagConstraints.LINE_START;
-        c.insets = new Insets(3, 5, 0, 3);
-
-		chkEnter = new JCheckBox(I18N.gettext("main.options.standard.Enter_key_sends_messages"));
-		chkEnter.setToolTipText(I18N.gettext("main.options.standard.tooltip.Send_message_with_enter_key_instead_of_ctrl_or_shift_and_enter"));
-		chkEnter.setSelected(Preferences.getBoolean("jeti","enterSends",true));
-        add(chkEnter, c);
-
-        chkToFrontOnNewMessage = new JCheckBox(I18N.gettext("main.options.standard.To_front_on_new_message"));
-        //chkToFrontOnNewMessage.setToolTipText(I18N.gettext("main.options.standard.tooltip.Send_message_with_enter_key_instead_of_ctrl_or_shift_and_enter"));
-        chkToFrontOnNewMessage.setSelected(Preferences.getBoolean("jeti", "toFrontOnNewMessage", false));
-        add(chkToFrontOnNewMessage, c);
-                
-        
-		chkShowTimestamp = new JCheckBox(I18N.gettext("main.options.standard.Show_timestamps"));
-		chkShowTimestamp.setToolTipText(I18N.gettext("main.options.standard.tooltip.Show_timestamps_on_all_messages"));
-		chkShowTimestamp.setSelected(Preferences.getBoolean("jeti","showTimestamp",true));
-        add(chkShowTimestamp, c);
-
-		chkBeep = new JCheckBox(I18N.gettext("main.options.standard.Beep_on_new_message"));
-        chkBeep.setToolTipText(I18N.gettext("main.options.standard.tooltip.Beep_on_new_message_arrival")); 
-		chkBeep.setSelected(Preferences.getBoolean("jeti","beep",true));
-        add(chkBeep, c);
-		
-		chkNick = new JCheckBox(I18N.gettext("main.options.standard.Show_remote_msn_nicknames"));
-		chkNick.setToolTipText(I18N.gettext("main.options.standard.tooltip.Show_remote_nicknames_instead_of_the_local_ones")); 
-		chkNick.setSelected(Preferences.getBoolean("jeti","showRealNick", false));
-        add(chkNick, c);
-				
-		chkOFFline = new JCheckBox(I18N.gettext("main.options.standard.Show_Offline_contacts"));
-		chkOFFline.setToolTipText(I18N.gettext("main.options.standard.tooltip.Show_Offline_contacts")); 
-		oldOFFline = Preferences.getBoolean("jeti","showoffline",true);
-		chkOFFline.setSelected(oldOFFline);
-        add(chkOFFline, c);
-
-		chkTaskbar = new JCheckBox(I18N.gettext("main.options.standard.Don't_show_the_mainscreen_in_the_taskbar"));
-		chkTaskbar.setToolTipText(I18N.gettext("main.options.standard.tooltip.Restart_required")); 
-		chkTaskbar.setSelected(Preferences.getBoolean("jeti","showNotInTaskbar",false));
-        add(chkTaskbar, c);
-		
-		chkBMW = new JCheckBox(I18N.gettext("main.options.standard.White_background_main_window"));
-		chkBMW.setToolTipText(I18N.gettext("main.options.standard.tooltip.Makes_the_main_window_white_(restart_required)")); 
-		chkBMW.setSelected(Preferences.getBoolean("jeti","bmw",true));
-        add(chkBMW, c);
-        		
-		chkTitle = new JCheckBox(I18N.gettext("main.options.standard.Java_window_decorations"));
-		chkTitle.setToolTipText(I18N.gettext("main.options.standard.tooltip.Set_java_look_and_feel_decorations_for_windows_(restart_required)"));
-		chkTitle.setSelected(Preferences.getBoolean("jeti","javadecorations",false));
-        add(chkTitle, c);
-
-        chkJetiPos = new JCheckBox(I18N.gettext("main.options.standard.Jeti_as_Menu_instead_of_button"));
-		chkJetiPos.setToolTipText(I18N.gettext("main.options.standard.tooltip.Change_the_Jeti_button_to_a_menu_(restart_required)"));
-		chkJetiPos.setSelected(Preferences.getBoolean("jeti","menutop",false));
-        add(chkJetiPos, c);
-        
-        chkJetiTabs = new JCheckBox(I18N.gettext("main.options.standard.Jeti_with_tabs"));
-		//chkJetiTabs.setToolTipText(I18N.gettext("main.options.standard.tooltip."));
-		chkJetiTabs.setSelected(Preferences.getBoolean("jeti","tabs",false));
-        add(chkJetiTabs, c);
-        
-        c.weightx = 0;
-        c.gridwidth = 4;
-        JLabel label = new JLabel(I18N.gettext("main.options.standard.Background_image"));
-        add(label,c);
-		label.setToolTipText(I18N.gettext("main.options.standard.tooltip.Adds_an_image_to_the_main_window_(White_background_main_window_should_be_off)")); 
-		txtBackground = new JTextField(Preferences.getString("jeti","backgroundImage",null));
-		c.weightx = 100;
-		c.fill = GridBagConstraints.HORIZONTAL;
-		add(txtBackground, c);
-		c.weightx = 0;
-		JButton button = new JButton("...");
-		button.addActionListener(new ActionListener()
-		{
-		
-			public void actionPerformed(ActionEvent e)
-			{
-				JFileChooser chooser = new JFileChooser();
-				chooser.setCurrentDirectory(new File(txtBackground.getText()));
-				chooser.setFileFilter(new ImageFileFilter());
-				int result = chooser.showOpenDialog(StdPreferencesPanel.this);
-				if(result==JFileChooser.APPROVE_OPTION)
-				{
-					txtBackground.setText(chooser.getSelectedFile().getAbsolutePath());
-				}
-			}
-		});
-		add(button,c);
-		chkImageScaled = new JCheckBox(I18N.gettext("main.options.standard.Scaled"));
-			//chkJetiTabs.setToolTipText(I18N.gettext("main.options.standard.tooltip."));
-		chkImageScaled.setSelected(Preferences.getBoolean("jeti","backgroundImageScaled",true));
-		c.gridwidth = GridBagConstraints.REMAINDER;
-		add(chkImageScaled, c);
-        
-        GridBagConstraints cl = new GridBagConstraints();
-        cl.gridwidth = 1;
-        cl.anchor = GridBagConstraints.LINE_START;
-        cl.insets = new Insets(3, 5, 0, 3);
-
-        add(new JLabel(I18N.gettext("main.options.standard.Language")), cl);
-		cmbLanguage = new JComboBox(new Object[]{I18N.gettext("main.options.standard.Loading_Languages,_please_wait")});
-        cmbLanguage.setPreferredSize(new Dimension(200, 21));
-        add(cmbLanguage, c);
-
-        add(new JLabel(I18N.gettext("main.options.standard.Country")), cl);
-		cmbCountry = new JComboBox();
-        cmbCountry.setPreferredSize(new Dimension(200, 21));
-        add(cmbCountry, c);
-
-        c.gridwidth = 3;
-        c.weighty = 1.0;
-        c.weightx = 1.0;
-        add(Box.createVerticalGlue(), c);
-
-	    SwingWorker worker = new SwingWorker() 
-		{
-	    	I18N i18n;
-
-	    	public Object construct() 
-	    	{
-	        	i18n = new I18N();
-	            return null;
-	        }
-
-	        //Runs on the event-dispatching thread.
-	        public void finished() 
-	        {
-	        	cmbLanguage.setModel(new DefaultComboBoxModel(i18n.getLanguages()));
-	        	LocaleModel lm = new LocaleModel(i18n);
-	        	cmbLanguage.addActionListener(lm);
-	        	String languageCode = Preferences.getString("jeti","language",getDefaultLocale().getLanguage());
-	        	ComboBoxModel model = cmbLanguage.getModel();
-	    		boolean selected=false;
-	        	for(int i=0;i<model.getSize();i++)
-	    		{
-	    			if(((I18N.Language)model.getElementAt(i)).getLanguageCode().equals(languageCode))
-	    			{
-	    				cmbLanguage.setSelectedIndex(i);
-	    				selected=true;
-	    				break;
-	    			}
-	    		}
-	    		if(!selected)
-	    		{//language not found so set to default language
-	    			languageCode = Locale.getDefault().getLanguage();
-	    			for(int i=0;i<model.getSize();i++)
-		    		{
-		    			if(((I18N.Language)model.getElementAt(i)).getLanguageCode().equals(languageCode))
-		    			{
-		    				cmbLanguage.setSelectedIndex(i);
-		    				break;
-		    			}
-		    		}
-	    		}
-	        	String countryCode = Preferences.getString("jeti","country",getDefaultLocale().getCountry());
-	    		cmbCountry.setModel(lm);
-	    		model = cmbCountry.getModel();
-	    		selected=false;
-	    		for(int i=0;i<model.getSize();i++)
-	    		{
-	    			if(((I18N.Country)model.getElementAt(i)).getCountryCode().equals(countryCode))
-	    			{
-	    				cmbCountry.setSelectedIndex(i);
-	    				selected=true;
-	    				break;
-	    			}
-	    		}
-	    		if(!selected)
-	    		{//country not found so set to other
-	    			countryCode = "";
-	    			for(int i=0;i<model.getSize();i++)
-		    		{
-		    			if(((I18N.Country)model.getElementAt(i)).getCountryCode().equals(countryCode))
-		    			{
-		    				cmbCountry.setSelectedIndex(i);
-		    				break;
-		    			}
-		    		}
-	    		}
-	        }
-	    };
-	    worker.start(); 
-	}
-
-	public void savePreferences()
-	{
-		Preferences.putBoolean("jeti","enterSends", chkEnter.isSelected());
-		Preferences.putBoolean("jeti","toFrontOnNewMessage", chkToFrontOnNewMessage.isSelected());
-		Preferences.putBoolean("jeti","showTimestamp", chkShowTimestamp.isSelected());
-		Preferences.putBoolean("jeti","beep", chkBeep.isSelected());
-		Preferences.putBoolean("jeti","showRealNick", chkNick.isSelected());
-		Preferences.putBoolean("jeti","bmw",chkBMW.isSelected());
-		Preferences.putBoolean("jeti","showNotInTaskbar",chkTaskbar.isSelected());
-		Preferences.putBoolean("jeti","javadecorations",chkTitle.isSelected());
-		Preferences.putBoolean("jeti","menutop",chkJetiPos.isSelected());
-		Preferences.putBoolean("jeti","tabs",chkJetiTabs.isSelected());
-		Preferences.putBoolean("jeti","backgroundImageScaled",chkImageScaled.isSelected());
-		String b = Preferences.getString("jeti","backgroundImage","");
-		if(!txtBackground.getText().equals(b))
-		{
-			Preferences.putString("jeti","backgroundImage",txtBackground.getText());
-			backend.getMain().refreshBackgroundImage();
-		}
-		if (oldOFFline != chkOFFline.isSelected())
-		{//only update when there is a change
-			Preferences.putBoolean("jeti","showoffline", chkOFFline.isSelected());
-			oldOFFline = chkOFFline.isSelected();
-			backend.getMain().changeOFFlinePanel(oldOFFline);
-		}
-		if(cmbCountry.getSelectedIndex()!=-1) Preferences.putString("jeti", "country",((I18N.Country) cmbCountry.getSelectedItem()).getCountryCode());
-		if(cmbLanguage.getSelectedIndex()!=-1
-                    && cmbLanguage.getSelectedItem() instanceof I18N.Language)
-		{
-			String languageCode = ((I18N.Language)cmbLanguage.getSelectedItem()).getLanguageCode();
-			if(!Preferences.getString("jeti","language",getDefaultLocale().getLanguage()).equals(languageCode))
-			{//only update when there is a change
-				Preferences.putString("jeti", "language",languageCode);
-				I18N.init();
-				backend.getMain().translate();
-			}
-		}
-	}
-}
-
-/*
- * Overrides for emacs
- * Local variables:
- * tab-width: 4
- * End:
- */
Index: trunk/jabberit_messenger/java_source/src/nu/fw/jeti/util/Preferences.java
===================================================================
--- trunk/jabberit_messenger/java_source/src/nu/fw/jeti/util/Preferences.java	(revision 1014)
+++ trunk/jabberit_messenger/java_source/src/nu/fw/jeti/util/Preferences.java	(revision 1064)
@@ -65,5 +65,4 @@
 	{
 		Preferences.backend = backend;
-
 		InputStream data = null;
 
@@ -77,10 +76,5 @@
 			addPreferences(parser, data, defaults);
 		}
-		catch(IOException ex)
-		{
-			// Do Nothing
-			//javax.swing.JOptionPane.showMessageDialog(null, 
-			//		"Comentar esta linha em Preferences.java\n" + "\nERRO : \n" + ex.getMessage() + "\n" + ex + "\n" );
-		}
+		catch(IOException ex){}
 
 		// Initialize presence messages if none have been specified
@@ -91,10 +85,16 @@
 	}
 
-    private void addPreferences(SAXParser parser, InputStream data,Map store) {
-        try {
+    private void addPreferences(SAXParser parser, InputStream data,Map store)
+    {
+        try
+        {
             parser.parse(data,new PreferencesHandler(store));
-        } catch (SAXException ex) {
+        }
+        catch (SAXException ex)
+        {
             ex.printStackTrace();
-        } catch (IOException ex) {
+        }
+        catch (IOException ex)
+        {
             ex.printStackTrace();
         }
@@ -109,22 +109,23 @@
 		
 		List tempList = new ArrayList(10);
-		tempList.add("DisponÃ­vel");
-		tempList.add("Livre p/ Chat");
-		mapMessages.put("chat", tempList);
-		mapMessages.put("available", tempList);
-		tempList = new ArrayList(10);
-		tempList.add("Em reuniÃ£o");
-		tempList.add("Ocupado");
-		tempList.add("Trabalhando");
-		mapMessages.put("dnd", tempList);
-		tempList = new ArrayList(10);
-		tempList.add("No telefone");
-		tempList.add("Volto Logo");
-		mapMessages.put("away", tempList);
-		tempList = new ArrayList(10);
-		tempList.add("FÃ©rias");
-		tempList.add("Em casa");
-		tempList.add("Ausente");
-		mapMessages.put("xa", tempList);
+			tempList.add("Disponível");
+			tempList.add("Livre p/ Chat");
+			mapMessages.put("chat", tempList);
+			mapMessages.put("available", tempList);
+			tempList = new ArrayList(10);
+			tempList.add("Em reunião");
+			tempList.add("Ocupado");
+			tempList.add("Trabalhando");
+			mapMessages.put("dnd", tempList);
+			tempList = new ArrayList(10);
+			tempList.add("No telefone");
+			tempList.add("Volto Logo");
+			mapMessages.put("away", tempList);
+			tempList = new ArrayList(10);
+			tempList.add("FÃ©rias");
+			tempList.add("Em casa");
+			tempList.add("Ausente");
+			mapMessages.put("xa", tempList);
+		
 		return mapMessages;
 	}
Index: trunk/jabberit_messenger/java_source/src/nu/fw/jeti/util/FindAction.java
===================================================================
--- trunk/jabberit_messenger/java_source/src/nu/fw/jeti/util/FindAction.java	(revision 1014)
+++ trunk/jabberit_messenger/java_source/src/nu/fw/jeti/util/FindAction.java	(revision 1064)
@@ -45,5 +45,4 @@
 	
 	public FindAction(){
-		//super("find", EditorUtilities.loadIcon("icons/Find16.gif"));
 		super(I18N.gettext("main.popup.Find"));
 		putValue(MNEMONIC_KEY, new Integer(KeyEvent.VK_F));
@@ -60,5 +59,6 @@
 				JTextComponent text = (JTextComponent) o;
 				if(e.getModifiers() == 0 )
-				{//find Next
+				{ 
+					//find Next
 					if (searchString==null) askSearchString(text);
 					if (searchString!=null)search(text,text.getCaretPosition());
@@ -83,11 +83,4 @@
 		String fulltext = text.getText();
 
-//		//	strip out the surplus \r characters
-//		StringTokenizer tokenizer = new StringTokenizer(fulltext, "\r");
-//		StringBuffer buffer = new StringBuffer();
-//		while( tokenizer.hasMoreTokens() ){
-//			buffer.append( tokenizer.nextToken() );
-//		}
-
 		//get the substring based on the requested start position
 		fulltext = ( fulltext ).substring(startPositionIn);
@@ -96,16 +89,14 @@
 		// so long as we can find the text in the file, go ahead and highlight it
 		// if we can't show the dialog
-		if(fulltext.indexOf(searchString) > -1){
+		if(fulltext.indexOf(searchString) > -1)
+		{
 			startPoint = (fulltext.indexOf(searchString) ) + startPositionIn;
-
 			endPoint = startPoint + searchStringLength;
 			text.requestFocus();
 			text.setCaretPosition(startPoint);
-		//move caret to endPoint - thus highlighting the selected text
 			text.moveCaretPosition(endPoint);
-		//make the selection visible
-			//text.getCaret().setSelectionVisible(true);
 		}
-		else if (startPositionIn!=0){
+		else if (startPositionIn!=0)
+		{
 			if(JOptionPane.showConfirmDialog(text.getTopLevelAncestor(),MessageFormat.format(I18N.gettext("main.popup.{0}_not_found_until_the_end_of_this_file,_start_again_from_the_beginning?"),new Object[]{searchString})) == JOptionPane.OK_OPTION)
 			{
Index: trunk/jabberit_messenger/java_source/src/nu/fw/jeti/util/I18N.java
===================================================================
--- trunk/jabberit_messenger/java_source/src/nu/fw/jeti/util/I18N.java	(revision 1014)
+++ trunk/jabberit_messenger/java_source/src/nu/fw/jeti/util/I18N.java	(revision 1064)
@@ -1,194 +1,40 @@
 /*
- * Creado el 30/06/2004 por Rodolfo Gonzalez Gonzalez <rodolfo@equinoxe.g-networks.net>
+ * @Author(s) - Alexndre Correia
  *
- * This class is a wrapper for easier i18n of Jeti. It uses the standard i18n 
- * mechanisms given by Java. 
+ * This class is a wrapper for easier i18n of Jeti. 
+ * It uses the standard i18n mechanisms given by Java. 
  * 
+ * Created on - 30/06/2009
  */
+
 package nu.fw.jeti.util;
 
-import java.io.*;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.MalformedURLException;
-import java.net.URL;
 import java.util.*;
 
 import javax.swing.AbstractButton;
-import javax.swing.JComponent;
 import javax.swing.JLabel;
-import javax.swing.UIManager;
+import nu.fw.jeti.languages.*;
 
-import nu.fw.jeti.backend.Start;
-import nu.fw.jeti.backend.URLClassloader;
-
-/**
- * @author Rodolfo Gonzalez <rodolfo@equinoxe.g-networks.net>
- */
-public class I18N
+public class I18N implements languages, languagesPlugins
 {
-	private static ResourceBundle jetiBundle;
-	private static Map pluginsBundle;
-	private Language[] languages;
-	private Map countries;
-
-	public I18N()
+	private static HashMap messagesLang;
+	private static HashMap messagesLangPlugins;
+	
+	public static String getText(String type, String messageID)
 	{
-		countries = new HashMap();
-		if ( Start.applet || Start.webstart )
-		{
-			try
-			{
-				BufferedReader data = null;
-				InputStream is  = getClass().getResourceAsStream("/languages/list.txt");
-				if(is==null)return;//no languages
-				data =new BufferedReader(new InputStreamReader(is));
-				//data =new BufferedReader(new InputStreamReader(new URL(Start.programURL + "languages/list.txt").openStream()));
-				List locales = new LinkedList();
-				while (true)
-				{
-					String file = data.readLine();
-					if (file ==null) break;//end of stream
-					locales.add(new Locale(file));
-				}
-				data.close();
-				extractLanguages(locales);
-				extractCountries();
-			}
-			catch (IOException ex){ex.printStackTrace();}
-		}
-		else
-		{
-			extractLanguages(searchTranslations());
-			extractCountries();
-		}
-	}
-
-	private List searchTranslations()
-	{
-		String urlString = Start.path + "languages" + File.separator;
-		File path = new File(urlString);
-		File file[] = path.listFiles();
-		List locales = new LinkedList();
-		//locales.add(new Locale("en"));//english is available, but java always selects default locale before base locale
-		if (file == null) return locales;
-		for (int i = 0; i < file.length; i++)
-		{
-			Locale locale = getLocale(file[i].getName());
-			if (locale != null) locales.add(locale);
-		}
-		return locales;
-	}
-
-	private Locale getLocale(String filename)
-	{
-		if (!filename.startsWith("jeti") || !filename.endsWith(".properties")) return null;
-		int nlen = "jeti".length();
-		String language, country = "";
-		switch (filename.length() - nlen - 11)
-		{
-			case 6:
-				// E.g. name+"_en_US"+".properties"
-				if (filename.charAt(3 + nlen) != '_') return null;
-				country = filename.substring(nlen + 4, nlen + 6);
-			// no break; here!
-			case 3:
-				if (filename.charAt(nlen) != '_') return null;
-				language = filename.substring(nlen + 1, nlen + 3);
-				Locale locale = new Locale(language, country);
-				return locale;
-		}
-		return null;
-	}
-
-	private void extractLanguages(List availableLocales)
-	{
-		Set lang = new HashSet();
-		for (Iterator i = availableLocales.iterator(); i.hasNext();)
-		{
-			Locale l = (Locale) i.next();
-			String language = l.getLanguage();
-			List langLocs = (List) countries.get(language);
-			if (langLocs == null)
-			{
-				langLocs = new ArrayList();
-				countries.put(language, langLocs);
-			}
-			langLocs.add(new Country(l));
-			lang.add(new Language(l));
-		}
-		//add default locale:
-		Locale l = Locale.getDefault();
-		String language = l.getLanguage();
-		List langLocs = (List) countries.get(language);
-		if (langLocs == null)
-		{
-			langLocs = new ArrayList();
-			countries.put(language, langLocs);
-		}
-		lang.add(new Language(l));
-		languages = (Language[]) lang.toArray(new Language[0]);
-	}
-
-	private void extractCountries()
-	{
-		Locale[] allLocales = Locale.getAvailableLocales();
-		for (int i = 0; i < allLocales.length; i++)
-		{
-			String language = allLocales[i].getLanguage();
-			for (int j = 0; j < languages.length; j++)
-			{
-				if (language.equals(languages[j].getLanguageCode()))
-				{
-					List langLocs = (List) countries.get(language);
-					Country country = new Country(allLocales[i]);
-					if (!langLocs.contains(country)) langLocs.add(country);
-					//System.out.println(allLocales[i].getDisplayCountry());
-				}
-			}
-		}
-	}
-
-	/**
-	 * @return The available languages
-	 */
-	public Language[] getLanguages()
-	{
-		return languages;
-	}
-
-	/**
-	 * @return The countries that are possible with the available languages
-	 */
-	public Map getCountries()
-	{
-		return countries;
-	}
-
-	
-	public static String getText(String type, String messageID) {
-		ResourceBundle bundle = (ResourceBundle)pluginsBundle.get(type);
-		if(bundle == null) bundle = jetiBundle;
-		return getText(bundle,messageID);
+		return getText(messageID);
 	}
 	
-	/**
-	 * Gives back a translation of the input key without '&' (which is used for mnemonics)
-	 * 
-	 * @param messageID is the English phrase used as key, following the GNU gettext style
-	 * @param bundle is the name of the base resource bundle file
-	 * @return result (or messageID in case of error)
-	 */
 	public static String gettext(String messageID)
 	{
-		return getText(jetiBundle, messageID);
+		return getText(messageID);
 	}
 	
-	private static String getText(ResourceBundle bundle, String messageID)
+	private static String getText( String messageID )
 	{
-		if (messageID==null)return null;
-		String translation = getTextWithAmp(bundle,messageID);
+		if ( messageID == null )
+			return null;
+		
+		String translation = getTextWithAmp(messageID);
 		//remove &
 		int i = translation.indexOf("&");
@@ -196,84 +42,81 @@
 		{
 			translation = translation.substring(0, i) + translation.substring(i + 1, translation.length());
-			//i = translation.indexOf("&",i);
 		}
+
 		return translation;
 	}
 
-	/**
-	 * Gives back a translation of the input key
-	 * 
-	 * @param messageID is the English phrase used as key, following the GNU gettext style
-	 * @param bundle is the name of the base resource bundle file
-	 * @return result (or messageID in case of error)
-	 */
 	public static String getTextWithAmp(String messageID)
-	{//TODO change back to private when string prep is implemented
-		return getTextWithAmp(jetiBundle, messageID);
+	{ 
+		return I18N.getText_WithAmp(messageID);
 	}
 	
-	private static String getTextWithAmp(ResourceBundle bundle, String messageID)
+	private static String getText_WithAmp( String messageID )
 	{
-		if (messageID==null)return null;
-		if(bundle!=null)
+		String translation = (String)messagesLang.get(messageID);
+		
+		if( translation == null )
 		{
-			try
-			{
-				return (String) bundle.getObject(messageID);
-			} catch (MissingResourceException e)
-			{
-				System.out.println(messageID + " is not translated");
-			}
+			int dotPos = messageID.lastIndexOf('.');
+			
+			if ( dotPos > 0 )
+				messageID = messageID.substring(dotPos+1);
+			
+			return messageID.replace('_',' ');			
 		}
-		int dotPos = messageID.lastIndexOf('.');
-		if (dotPos>0) messageID = messageID.substring(dotPos+1);
-		//return messageID.replaceAll("_"," "); 
-		return messageID.replace('_',' '); 
+
+		return translation; 
 	}
 
-	public static void setTextAndMnemonic(String messageID,JLabel label) {
+	public static void setTextAndMnemonic(String messageID,JLabel label)
+	{
         setTextAndMnemonic(messageID, label, false);
     }
 
-	public static void setTextAndMnemonic(String messageID,JLabel label, boolean addDots)
+	public static void setTextAndMnemonic(String messageID, JLabel label, boolean addDots )
 	{
-		String mnemonicText = getTextWithAmp(messageID);
+		String mnemonicText = I18N.getTextWithAmp(messageID);
 		String translation=mnemonicText;
 		int pos = mnemonicText.indexOf("&");
+		
 		if (pos > -1)
-		{
 			translation = mnemonicText.substring(0, pos) + mnemonicText.substring(pos + 1, mnemonicText.length());
-		}
-        if (addDots) {
+        
+		if (addDots)
             translation += "...";
-        }
+		
 		label.setText(translation);
-		pos = getMnemonicPosition(mnemonicText);
-		if(pos>-1) label.setDisplayedMnemonic(mnemonicText.charAt(pos));
-		if(pos>0) label.setDisplayedMnemonicIndex(pos-1);
+		pos = ( (int)mnemonicText.indexOf("&") >= 0 ) ? ((int)mnemonicText.indexOf("&")) + 1 : -1;
+		
+		if ( pos > -1)
+			label.setDisplayedMnemonic(mnemonicText.charAt(pos));
+		
+		if ( pos > 0 )
+			label.setDisplayedMnemonicIndex(pos-1);
 	}
 	
 	public static void setMnemonic(String messageID, JLabel label)
 	{
-		String translation = getTextWithAmp(messageID);
-		int pos = getMnemonicPosition(translation);
-		if(pos>-1)label.setDisplayedMnemonic(translation.charAt(pos));
-		if(pos>1)label.setDisplayedMnemonicIndex(pos-1);
+		String translation = I18N.getTextWithAmp(messageID);
+		int pos = ( (int)translation.indexOf("&") >= 0 ) ? ((int)translation.indexOf("&")) + 1 : -1;
+		
+		if ( pos > -1)
+			label.setDisplayedMnemonic(translation.charAt(pos));
+		
+		if ( pos > 1)
+			label.setDisplayedMnemonicIndex(pos-1);
 	}
 	
 	public static void setMnemonic(String messageID, AbstractButton button)
 	{
-		String translation = getTextWithAmp(messageID);
-		int pos = getMnemonicPosition(translation);
-		if(pos>-1)button.setMnemonic(translation.charAt(pos));
-		if(pos>1)button.setDisplayedMnemonicIndex(pos-1);
+		String translation = I18N.getTextWithAmp(messageID);
+		int pos = ( (int)translation.indexOf("&") >= 0 ) ? ((int)translation.indexOf("&")) + 1 : -1;
+		
+		if ( pos >- 1) 
+			button.setMnemonic(translation.charAt(pos));
+		if ( pos > 1)
+			button.setDisplayedMnemonicIndex(pos-1);
 	}
 
-	/**
-	 * @param messageID is the English phrase used as key, following the
-     *              GNU gettext style
-	 * @param bundle is the name of the base resource bundle file
-	 * @param button The button to set the mnemonic on
-	 */
 	public static void setTextAndMnemonic(String messageID,AbstractButton button)
 	{
@@ -281,153 +124,59 @@
     }
 
-	/**
-	 * @param messageID is the English phrase used as key, following the
-     *              GNU gettext style
-	 * @param bundle is the name of the base resource bundle file
-	 * @param button The button to set the mnemonic on
-	 * @param addDots If true add '...' to the translated text
-	 */
-	public static void setTextAndMnemonic(String messageID,AbstractButton button,
-                                          boolean addDots)
+	public static void setTextAndMnemonic(String messageID,AbstractButton button, boolean addDots)
 	{
 		String mnemonicText = getTextWithAmp(messageID);
+		String translation=mnemonicText;
 		
-		String translation=mnemonicText;
 		int pos = mnemonicText.indexOf("&");
+		
 		if (pos > -1)
-		{
 			translation = mnemonicText.substring(0, pos) + mnemonicText.substring(pos + 1, mnemonicText.length());
-		}
-        if (addDots) {
+        
+		if (addDots)
             translation += "...";
-        }
-		button.setText(translation);
-		pos = getMnemonicPosition(mnemonicText);
-		if(pos>-1)button.setMnemonic(mnemonicText.charAt(pos));
-		if(pos>0) button.setDisplayedMnemonicIndex(pos-1);
+		
+        button.setText(translation);
+        
+		pos = ( (int)mnemonicText.indexOf("&") >= 0 ) ? ((int)mnemonicText.indexOf("&")) + 1 : -1;
+
+		if( pos > -1)
+			button.setMnemonic(mnemonicText.charAt(pos));
+
+		if( pos > 0 )
+			button.setDisplayedMnemonicIndex(pos-1);
 		
 	}
 
-	private static int getMnemonicPosition(String translation)
+	private static void loadLanguages(Locale myLocale)
 	{
-		int index = translation.indexOf("&");
-		if (index >= 0) return index+1;
-		return -1;
+		if ( myLocale.toString().equals("pt_BR"))
+		{
+			for( int i = 0; i < language_pt_BR.length; i++ )
+				messagesLang.put(language_pt_BR[i][0].toString(), language_pt_BR[i][1].toString());
+			
+			for( int i = 0 ; i < languagePlugins_pt_BR.length; i++)
+				messagesLangPlugins.put(languagePlugins_pt_BR[i][0].toString(), languagePlugins_pt_BR[i][1].toString());
+		}
 	}
+	
+	public static void init(String myLanguage, String myCountry)
+	{
+		messagesLang = new HashMap();
+		messagesLangPlugins = new HashMap();
 
-	static public void init()
-	{
-		ClassLoader classLoader=null;
-        if (!Start.applet && !Start.webstart) {
-            try {
-				URL url = new URL(Start.programURL, "languages/");
-                classLoader = new URLClassloader(
-                    new URL[] { url}, I18N.class.getClassLoader());
-            } catch (MalformedURLException e) {
-				e.printStackTrace();
-			}
-		} else classLoader = I18N.class.getClassLoader();
-		//		 see if the user has some preferences
-		String myLanguage = Preferences.getString("jeti", "language", "");
-		String myCountry = Preferences.getString("jeti", "country", "");
-		Locale myLocale=null;
-        if (myLanguage != "") {
-            myLocale = new Locale(myLanguage, myCountry);
-        } else {
-            myLocale = Locale.getDefault();
-        }
-        jetiBundle = loadLanguage("jeti",classLoader,myLocale);
-        if(jetiBundle==null || jetiBundle.getLocale().getLanguage().equals(""))
-        {
-	        // Make it fall back to English, this way we always get at least
-	        // the english texts (which contains the menu mnemonic markings)
-        	myLocale= new Locale(Locale.ENGLISH.getLanguage(),myCountry);
-        	System.out.println("lang not found, default: " + myLocale);
-        	jetiBundle = loadLanguage("jeti",classLoader,myLocale);
-        }
-        pluginsBundle = new HashMap();
-        pluginsBundle.put("drawing",loadLanguage("drawing",classLoader,myLocale));
-        JComponent.setDefaultLocale(myLocale);
-		   
-        //loadLanguage(classLoader, myLocale);
-		UIManager.put("OptionPane.okButtonText", gettext("OK"));
-		UIManager.put("OptionPane.cancelButtonText", gettext("Cancel"));
+		// Preferences
+		Locale myLocale   = null;
+
+		if( myLanguage != "" )
+			myLocale = new Locale(myLanguage, myCountry);
+		else
+			myLocale = new Locale("en", "US");
+
+		System.out.println("Valor de myLocale : " + myLocale);
 		
-	}
-
-	private static ResourceBundle loadLanguage(String type, ClassLoader classLoader, Locale myLocale)
-	{
-		try {
-            return ResourceBundle.getBundle("languages/" +type, myLocale);
-        } catch (MissingResourceException e) {
-            try {
-                return ResourceBundle.getBundle(type,
-                                                      myLocale, classLoader);
-            } catch (MissingResourceException e2) {
-                System.out.println(e2.getMessage());
-                return null;
-            }
-        }
-	}
-
-	public static class Country
-	{
-		private String country;
-		private String countryCode;
-
-		public Country(Locale locale)
-		{
-			country = locale.getDisplayCountry();
-			if (country.equals("")) country = gettext("main.options.standard.Other");
-			countryCode = locale.getCountry();
-		}
-
-		public String getCountryCode()
-		{
-			return countryCode;
-		}
-
-		public String toString()
-		{
-			return country;
-		}
-
-	}
-
-	public static class Language
-	{
-		private String language;
-		private String languageCode;
-
-		public Language(Locale locale)
-		{
-			language = locale.getDisplayLanguage();
-			languageCode = locale.getLanguage();
-		}
-
-		public String getLanguageCode()
-		{
-			return languageCode;
-		}
-
-		public String toString()
-		{
-			return language;
-		}
-		
-		public boolean equals(Object obj)
-		{
-			return language.equals(((Language)obj).language);
-		}
-		
-		public int hashCode()
-		{
-			return language.hashCode();
-		}
-		
-		
+		I18N.loadLanguages(myLocale);
 	}
 }
-
 
 /*
