Index: trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 4158)
+++ trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 4159)
@@ -61,4 +61,5 @@
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.tools.I18n;
 import org.openstreetmap.josm.tools.ImageProvider;
 
@@ -448,4 +449,5 @@
             allPluginLibraries.addAll(info.libraries);
             File pluginJar = new File(pluginDir, info.name + ".jar");
+            I18n.addTexts(pluginJar);
             URL pluginJarUrl = PluginInformation.fileToURL(pluginJar);
             allPluginLibraries.add(pluginJarUrl);
Index: trunk/src/org/openstreetmap/josm/tools/I18n.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/I18n.java	(revision 4158)
+++ trunk/src/org/openstreetmap/josm/tools/I18n.java	(revision 4159)
@@ -3,5 +3,8 @@
 
 import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
 import java.io.InputStream;
+import java.io.IOException;
 import java.net.URL;
 import java.text.MessageFormat;
@@ -9,4 +12,6 @@
 import java.util.Comparator;
 import java.util.HashMap;
+import java.util.jar.JarInputStream;
+import java.util.zip.ZipEntry;
 import java.util.Locale;
 import java.util.Vector;
@@ -27,4 +32,5 @@
         MODE_CS, MODE_AR, MODE_PL/*, MODE_RO*/, MODE_RU, MODE_SK/*, MODE_SL*/}
     private static PluralMode pluralMode = PluralMode.MODE_NOTONE; /* english default */
+    private static String loadedCode = "en";
 
     /* Localization keys for file chooser (and color chooser). */
@@ -340,4 +346,61 @@
     }
 
+    public static void addTexts(File source)
+    {
+        FileInputStream fis = null;
+        JarInputStream jar = null;
+        FileInputStream fisTrans = null;
+        JarInputStream jarTrans = null;
+        String enfile = "data/en.lang";
+        String langfile = "data/"+loadedCode+".lang";
+        try
+        {
+            ZipEntry e;
+            fis = new FileInputStream(source);
+            jar = new JarInputStream(fis);
+            boolean found = false;
+            while(!found && (e = jar.getNextEntry()) != null)
+            {
+                String name = e.getName();
+                if(name.equals(enfile))
+                    found = true;
+            }
+            if(found)
+            {
+                fisTrans = new FileInputStream(source);
+                jarTrans = new JarInputStream(fisTrans);
+                found = false;
+                while(!found && (e = jarTrans.getNextEntry()) != null)
+                {
+                    String name = e.getName();
+                    if(name.equals(langfile))
+                        found = true;
+                }
+                if(found)
+                    load(jar, jarTrans, true);
+            }
+        }
+        catch(IOException e)
+        {
+        }
+        finally
+        {
+            try
+            {
+                if(jar != null)
+                    jar.close();
+                if(fis != null)
+                    fis.close();
+                if(jarTrans != null)
+                    jarTrans.close();
+                if(fisTrans != null)
+                    fisTrans.close();
+            }
+            catch(IOException e)
+            {
+            }
+        }
+    }
+
     private static boolean load(String l)
     {
@@ -353,5 +416,5 @@
             return false;
         URL tr = Main.class.getResource("/data/"+l+".lang");
-        if(tr == null)
+        if(tr == null || !languages.containsKey(l))
         {
             int i = l.indexOf('_');
@@ -360,10 +423,36 @@
             }
             tr = Main.class.getResource("/data/"+l+".lang");
-            if(tr == null)
+            if(tr == null || !languages.containsKey(l))
                 return false;
         }
-
-        HashMap<String, String> s = new HashMap<String, String>();
-        HashMap<String, String[]> p = new HashMap<String, String[]>();
+        try
+        {
+            if(load(en.openStream(), tr.openStream(), false))
+            {
+                pluralMode = languages.get(l);
+                loadedCode = l;
+                return true;
+            }
+        }
+        catch(IOException e)
+        {
+        }
+        return false;
+    }
+
+    private static boolean load(InputStream en, InputStream tr, boolean add)
+    {
+        HashMap<String, String> s;
+        HashMap<String, String[]> p;
+        if(add)
+        {
+            s = strings;
+            p = pstrings;
+        }
+        else
+        {
+            s = new HashMap<String, String>();
+            p = new HashMap<String, String[]>();
+        }
         /* file format:
            for all single strings:
@@ -383,6 +472,6 @@
         try
         {
-            InputStream ens = new BufferedInputStream(en.openStream());
-            InputStream trs = new BufferedInputStream(tr.openStream());
+            InputStream ens = new BufferedInputStream(en);
+            InputStream trs = new BufferedInputStream(tr);
             byte[] enlen = new byte[2];
             byte[] trlen = new byte[2];
@@ -430,5 +519,5 @@
                         trstrings[i] = new String(str, 0, val, "utf-8");
                     }
-                    if(trnum > 0) {
+                    if(trnum > 0 && !p.containsKey(enstrings[0])) {
                         p.put(enstrings[0], trstrings);
                     }
@@ -471,5 +560,6 @@
                                 return false;
                             String trstr = new String(str, 0, trval, "utf-8");
-                            s.put(enstr, trstr);
+                            if(!s.containsKey(enstr))
+                                s.put(enstr, trstr);
                         }
                     }
@@ -477,13 +567,12 @@
             }
         }
-        catch(Exception e)
+        catch(IOException e)
         {
             return false;
         }
-        if(!s.isEmpty() && languages.containsKey(l))
+        if(!s.isEmpty())
         {
             strings = s;
             pstrings = p;
-            pluralMode = languages.get(l);
             return true;
         }
