Index: /trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java	(revision 5914)
+++ /trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java	(revision 5915)
@@ -24,5 +24,4 @@
 import org.openstreetmap.josm.data.osm.TagCollection;
 import org.openstreetmap.josm.gui.conflict.tags.PasteTagsConflictResolverDialog;
-import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.TextTagParser;
@@ -40,5 +39,4 @@
 
     private static final String help = ht("/Action/PasteTags");
-    private static final String helpUrl = HelpUtil.getHelpTopicUrl(HelpUtil.buildAbsoluteHelpTopic(help));
     
     public PasteTagsAction() {
@@ -267,5 +265,5 @@
         List<Command> commands = new ArrayList<Command>();
         if (tags==null || tags.isEmpty()) {
-            TextTagParser.showBadBufferMessage(helpUrl);
+            TextTagParser.showBadBufferMessage(help);
             return false;
         }
Index: /trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java	(revision 5914)
+++ /trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java	(revision 5915)
@@ -50,4 +50,5 @@
 import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.LanguageInfo.LocaleType;
 import org.openstreetmap.josm.tools.OpenBrowser;
 import org.openstreetmap.josm.tools.Utils;
@@ -261,6 +262,6 @@
                 relativeHelpTopic,
                 Locale.getDefault().getDisplayName(),
-                getHelpTopicEditUrl(buildAbsoluteHelpTopic(relativeHelpTopic)),
-                getHelpTopicEditUrl(buildAbsoluteHelpTopic(relativeHelpTopic, Locale.ENGLISH))
+                getHelpTopicEditUrl(buildAbsoluteHelpTopic(relativeHelpTopic, LocaleType.DEFAULT)),
+                getHelpTopicEditUrl(buildAbsoluteHelpTopic(relativeHelpTopic, LocaleType.ENGLISH))
         );
         loadTopic(message);
@@ -294,19 +295,28 @@
      */
     protected void loadRelativeHelpTopic(String relativeHelpTopic) {
-        String url = HelpUtil.getHelpTopicUrl(HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic));
+        String url = HelpUtil.getHelpTopicUrl(HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic, LocaleType.DEFAULTNOTENGLISH));
         String content = null;
         try {
             content = reader.fetchHelpTopicContent(url, true);
         } catch(MissingHelpContentException e) {
-            url = HelpUtil.getHelpTopicUrl(HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic, Locale.ENGLISH));
+            url = HelpUtil.getHelpTopicUrl(HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic, LocaleType.BASELANGUAGE));
             try {
                 content = reader.fetchHelpTopicContent(url, true);
             } catch(MissingHelpContentException e1) {
-                this.url = url;
-                handleMissingHelpContent(relativeHelpTopic);
-                return;
+                url = HelpUtil.getHelpTopicUrl(HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic, LocaleType.ENGLISH));
+                try {
+                    content = reader.fetchHelpTopicContent(url, true);
+                } catch(MissingHelpContentException e2) {
+                    this.url = url;
+                    handleMissingHelpContent(relativeHelpTopic);
+                    return;
+                } catch(HelpContentReaderException e2) {
+                    e2.printStackTrace();
+                    handleHelpContentReaderException(relativeHelpTopic, e2);
+                    return;
+                }
             } catch(HelpContentReaderException e1) {
                 e1.printStackTrace();
-                handleHelpContentReaderException(relativeHelpTopic,e1);
+                handleHelpContentReaderException(relativeHelpTopic, e1);
                 return;
             }
Index: /trunk/src/org/openstreetmap/josm/gui/help/HelpContentReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/help/HelpContentReader.java	(revision 5914)
+++ /trunk/src/org/openstreetmap/josm/gui/help/HelpContentReader.java	(revision 5915)
@@ -42,4 +42,6 @@
      */
     public String fetchHelpTopicContent(String helpTopicUrl, boolean dotest) throws HelpContentReaderException {
+        if(helpTopicUrl == null)
+            throw new MissingHelpContentException();
         HttpURLConnection con = null;
         BufferedReader in = null;
Index: /trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java	(revision 5914)
+++ /trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java	(revision 5915)
@@ -14,4 +14,5 @@
 import org.openstreetmap.josm.actions.HelpAction;
 import org.openstreetmap.josm.tools.LanguageInfo;
+import org.openstreetmap.josm.tools.LanguageInfo.LocaleType;
 
 public class HelpUtil {
@@ -40,11 +41,12 @@
      * @param absoluteHelpTopic the absolute help topic
      * @return the url
-     * @see #buildAbsoluteHelpTopic(String)
-     * @see #buildAbsoluteHelpTopic(String, Locale)
+     * @see #buildAbsoluteHelpTopic
      */
     static public String getHelpTopicUrl(String absoluteHelpTopic) {
+        if(absoluteHelpTopic == null)
+            return null;
         String ret = getWikiBaseHelpUrl();
         ret = ret.replaceAll("\\/+$", "");
-        absoluteHelpTopic  =absoluteHelpTopic.replace(" ", "%20");
+        absoluteHelpTopic = absoluteHelpTopic.replace(" ", "%20");
         absoluteHelpTopic = absoluteHelpTopic.replaceAll("^\\/+", "/");
         return ret + absoluteHelpTopic;
@@ -72,8 +74,10 @@
     static public String extractRelativeHelpTopic(String url) {
         String topic = extractAbsoluteHelpTopic(url);
-        if (topic == null) return null;
-        String pattern = "/[A-Z][a-z]:" + getHelpTopicPrefix(Locale.ENGLISH).replaceAll("^\\/+", "");
-        if (url.matches(pattern))
+        if (topic == null)
+            return null;
+        String pattern = "/[A-Z][a-z]{1,2}(_[A-Z]{2})?:" + getHelpTopicPrefix(LocaleType.ENGLISH).replaceAll("^\\/+", "");
+        if (url.matches(pattern)) {
             return topic.substring(pattern.length());
+        }
         return null;
     }
@@ -89,27 +93,13 @@
         if (!url.startsWith(getWikiBaseHelpUrl())) return null;
         url = url.substring(getWikiBaseHelpUrl().length());
-        String prefix = getHelpTopicPrefix(Locale.ENGLISH);
+        String prefix = getHelpTopicPrefix(LocaleType.ENGLISH);
         if (url.startsWith(prefix))
             return url;
 
-        String pattern = "/[A-Z][a-z]:" + prefix.replaceAll("^\\/+", "");
+        String pattern = "/[A-Z][a-z]{1,2}(_[A-Z]{2})?:" + prefix.replaceAll("^\\/+", "");
         if (url.matches(pattern))
             return url;
 
         return null;
-    }
-
-    /**
-     * Replies the help topic prefix for the current locale. Examples:
-     * <ul>
-     *   <li>/Help if the current locale is a locale with language "en"</li>
-     *   <li>/De:Help if the current locale is a locale with language "de"</li>
-     * </ul>
-     *
-     * @return the help topic prefix
-     * @see #getHelpTopicPrefix(Locale)
-     */
-    static public String getHelpTopicPrefix() {
-        return getHelpTopicPrefix(Locale.getDefault());
     }
 
@@ -121,16 +111,13 @@
      * </ul>
      *
-     * @param locale the locale. {@link Locale#ENGLISH} assumed, if null.
+     * @param type the type of the locale to use
      * @return the help topic prefix
-     * @see #getHelpTopicPrefix(Locale)
-     */
-    static public String getHelpTopicPrefix(Locale locale) {
-        if (locale == null) {
-            locale = Locale.ENGLISH;
-        }
-        String ret = Main.pref.get("help.pathhelp", "/Help");
-        ret = ret.replaceAll("^\\/+", ""); // remove leading /
-        ret = "/" + LanguageInfo.getWikiLanguagePrefix(locale) + ret;
-        return ret;
+     */
+    static private String getHelpTopicPrefix(LocaleType type) {
+        String ret = LanguageInfo.getWikiLanguagePrefix(type);
+        if(ret == null)
+            return ret;
+        ret = "/" + ret + Main.pref.get("help.pathhelp", "/Help").replaceAll("^\\/+", ""); // remove leading /;
+        return ret.replaceAll("\\/+", "\\/"); // collapse sequences of //
     }
 
@@ -142,34 +129,13 @@
      *
      * @param topic the relative help topic. Home help topic assumed, if null.
-     * @param locale the locale. {@link Locale#ENGLISH} assumed, if null.
+     * @param type the locale. {@link Locale#ENGLISH} assumed, if null.
      * @return the absolute, localized help topic
      */
-    static public String buildAbsoluteHelpTopic(String topic, Locale locale) {
-        if (locale == null) {
-            locale = Locale.ENGLISH;
-        }
-        if (topic == null || topic.trim().length() == 0 || topic.trim().equals("/"))
-            return getHelpTopicPrefix(locale);
-        String ret = getHelpTopicPrefix(locale);
-        if (topic.startsWith("/")) {
-            ret += topic;
-        } else {
-            ret += "/" + topic;
-        }
-        ret = ret.replaceAll("\\/+", "\\/"); // just in case, collapse sequences of //
-        return ret;
-    }
-
-    /**
-     * Replies the absolute, localized help topic for the given topic and the
-     * current locale.
-     *
-     * @param topic the relative help topic. Home help topic assumed, if null.
-     * @return the absolute, localized help topic
-     * @see Locale#getDefault()
-     * @see #buildAbsoluteHelpTopic(String, Locale)
-     */
-    static public String buildAbsoluteHelpTopic(String topic) {
-        return buildAbsoluteHelpTopic(topic, Locale.getDefault());
+    static public String buildAbsoluteHelpTopic(String topic, LocaleType type) {
+        String prefix = getHelpTopicPrefix(type);
+        if (prefix == null || topic == null || topic.trim().length() == 0 || topic.trim().equals("/"))
+            return prefix;
+        prefix += "/" + topic;
+        return prefix.replaceAll("\\/+", "\\/"); // collapse sequences of //
     }
 
Index: /trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java	(revision 5914)
+++ /trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java	(revision 5915)
@@ -2,31 +2,48 @@
 package org.openstreetmap.josm.tools;
 
-import static org.openstreetmap.josm.tools.I18n.tr;
+import static org.openstreetmap.josm.tools.I18n.marktr;
+
+import org.openstreetmap.josm.Main;
 
 import java.util.Locale;
 
 public class LanguageInfo {
+    /** Type of the locale to use */
+    public enum LocaleType {
+        /** The current default language */
+        DEFAULT,
+        /** The current default language, but not english */
+        DEFAULTNOTENGLISH,
+        /** The base language (i.e. pt for pt_BR) */
+        BASELANGUAGE,
+        /** The standard english texts */
+        ENGLISH
+    };
 
     /**
      * Replies the wiki language prefix for the given locale. The wiki language
      * prefix has the form 'Xy:' where 'Xy' is a ISO 639 language code in title
-     * case.
+     * case (or Xy_AB: for sub languages).
      *
-     * @param locale  the locale
-     * @return the wiki language prefix
+     * @param type the type 
+     * @return the wiki language prefix or {@code null} for {@link LocaleType#BASELANGUAGE}, when
+     * base language is identical to default or english
+     * @since 8636
      */
-    static public String getWikiLanguagePrefix(Locale locale) {
-        String code = getJOSMLocaleCode(locale);
-        if (code.length() == 2) {
-            if (code.equals("en")) return "";
-        } else if (code.equals("zh_TW") || code.equals("zh_CN")) {
-            /* do nothing */
-        } else if (code.matches("[^_]+_[^_]+")) {
-            code = code.substring(0,2);
-            if (code.equals("en")) return "";
-        } else {
-            System.err.println(tr("Warning: failed to derive wiki language prefix from JOSM locale code ''{0}''. Using default code ''en''.", code));
-            return "";
-        }
+    static public String getWikiLanguagePrefix(LocaleType type) {
+        if(type == LocaleType.ENGLISH)
+          return "";
+
+        String code = getJOSMLocaleCode();
+        if(type == LocaleType.BASELANGUAGE) {
+            if(code.matches("[^_]+_[^_]+")) {
+                code = code.substring(0,2);
+                if(code == "en")
+                    return null;
+            } else {
+                return null;
+            }
+        } else if(type == LocaleType.DEFAULTNOTENGLISH && code == "en")
+            return null;
         return code.substring(0,1).toUpperCase() + code.substring(1) + ":";
     }
@@ -37,8 +54,8 @@
      * @return the wiki language prefix
      * @see Locale#getDefault()
-     * @see #getWikiLanguagePrefix(Locale)
+     * @see #getWikiLanguagePrefix(LocaleType)
      */
     static public String getWikiLanguagePrefix() {
-        return getWikiLanguagePrefix(Locale.getDefault());
+        return getWikiLanguagePrefix(LocaleType.DEFAULT);
     }
 
Index: /trunk/src/org/openstreetmap/josm/tools/TextTagParser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/TextTagParser.java	(revision 5914)
+++ /trunk/src/org/openstreetmap/josm/tools/TextTagParser.java	(revision 5915)
@@ -11,6 +11,8 @@
 import javax.swing.JPanel;
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.io.XmlWriter;
+import org.openstreetmap.josm.tools.LanguageInfo.LocaleType;
 
 import static org.openstreetmap.josm.tools.I18n.tr;
@@ -279,11 +281,13 @@
     /**
      * Shows message that the buffer can not be pasted, allowing user to clean the buffer
-     * @param helpUrl
+     * @param helpTopic the help topic of the parent action
+     * TODO: Replace by proper HelpAwareOptionPane instead of self-made help link
      */
-    public static void showBadBufferMessage(String helpUrl) {
+    public static void showBadBufferMessage(String helpTopic) {
         String msg = tr("<html><p> Sorry, it is impossible to paste tags from buffer. It does not contain any JOSM object"
             + " or suitable text. </p></html>");
         JPanel p = new JPanel(new GridBagLayout());
         p.add(new JLabel(msg),GBC.eop());
+        String helpUrl = HelpUtil.getHelpTopicUrl(HelpUtil.buildAbsoluteHelpTopic(helpTopic, LocaleType.DEFAULT));
         if (helpUrl != null) {
             p.add(new UrlLabel(helpUrl), GBC.eop());
Index: /trunk/src/org/openstreetmap/josm/tools/WikiReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/WikiReader.java	(revision 5914)
+++ /trunk/src/org/openstreetmap/josm/tools/WikiReader.java	(revision 5915)
@@ -7,4 +7,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.LanguageInfo.LocaleType;
 
 /**
@@ -45,10 +46,27 @@
 
     public String readLang(String text) throws IOException {
-        String languageCode = LanguageInfo.getWikiLanguagePrefix();
-        String res = readLang(new URL(baseurl + "/wiki/" + languageCode + text));
-        if (res.isEmpty() && !languageCode.isEmpty()) {
-            res = readLang(new URL(baseurl + "/wiki/" + text));
+        String languageCode;
+        String res = "";
+
+        languageCode = LanguageInfo.getWikiLanguagePrefix(LocaleType.DEFAULTNOTENGLISH);
+        if(languageCode != null) {
+            res = readLang(new URL(baseurl + "/wiki/" + languageCode + text));
         }
-        if (res.isEmpty()) {
+
+        if(res.isEmpty()) {
+            languageCode = LanguageInfo.getWikiLanguagePrefix(LocaleType.BASELANGUAGE);
+            if(languageCode != null) {
+                res = readLang(new URL(baseurl + "/wiki/" + languageCode + text));
+            }
+        }
+
+        if(res.isEmpty()) {
+            languageCode = LanguageInfo.getWikiLanguagePrefix(LocaleType.ENGLISH);
+            if(languageCode != null) {
+                res = readLang(new URL(baseurl + "/wiki/" + languageCode + text));
+            }
+        }
+
+        if(res.isEmpty()) {
             throw new IOException(text + " does not exist");
         } else {
@@ -101,7 +119,5 @@
                 // will render a thick  border around images inside an <a> element
                 //
-                b += line.replaceAll("<img src=\"/", "<img border=\"0\" src=\"" + baseurl + "/").replaceAll("href=\"/",
-                        "href=\"" + baseurl + "/").replaceAll(" />", ">")
-                        + "\n";
+                b += line.replaceAll("<img ", "<img border=\"0\" ").replaceAll(" />", ">") + "\n";
             } else if (transl && line.contains("</div>")) {
                 transl = false;
@@ -114,5 +130,5 @@
         || b.indexOf(" does not exist. You can create it here.</p>") >= 0)
             return "";
-        return "<html>" + b + "</html>";
+        return "<html><base href=\""+baseurl+"\"> " + b + "</html>";
     }
 }
