Index: trunk/src/org/openstreetmap/josm/tools/I18n.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/I18n.java	(revision 7892)
+++ trunk/src/org/openstreetmap/josm/tools/I18n.java	(revision 7893)
@@ -39,5 +39,6 @@
     }
 
-    private enum PluralMode { MODE_NOTONE, MODE_NONE, MODE_GREATERONE,
+    private enum PluralMode {
+        MODE_NOTONE, MODE_NONE, MODE_GREATERONE,
         MODE_CS/*, MODE_AR*/, MODE_PL/*, MODE_RO*/, MODE_RU, MODE_SK/*, MODE_SL*/}
     private static PluralMode pluralMode = PluralMode.MODE_NOTONE; /* english default */
@@ -138,5 +139,5 @@
      * After translation, the localizations are distributed with the main program.
      * <br>
-     * For example, {@code tr("JOSM''s default value is ''{0}''.", val)}.
+     * For example, <code>tr("JOSM''s default value is ''{0}''.", val)</code>.
      * <br>
      * Use {@link #trn} for distinguishing singular from plural text, i.e.,
@@ -149,5 +150,5 @@
      * An apostrophe ' must be quoted by another apostrophe.
      * @param objects the parameters for the string.
-     * Mark occurrences in {@code text} with {@code {0}}, {@code {1}}, ...
+     * Mark occurrences in {@code text} with <code>{0}</code>, <code>{1}</code>, ...
      * @return the translated string.
      * @see #trn
@@ -192,7 +193,7 @@
      * the translatable strings from the source files).
      *
-     * For example, {@code
+     * For example, <code>
      * String[] options = new String[] {marktr("up"), marktr("down")};
-     * lbl.setText(tr(options[0]));}
+     * lbl.setText(tr(options[0]));</code>
      * @param text the string to be marked for translation.
      * @return {@code text} unmodified.
@@ -211,5 +212,5 @@
      * <br>
      * For instance, {@code trn("There was an error!", "There were errors!", i)} or
-     * {@code trn("Found {0} error in {1}!", "Found {0} errors in {1}!", i, Integer.toString(i), url)}.
+     * <code>trn("Found {0} error in {1}!", "Found {0} errors in {1}!", i, Integer.toString(i), url)</code>.
      *
      * @param singularText the singular text to translate.
@@ -223,5 +224,5 @@
      * @param n a number to determine whether {@code singularText} or {@code pluralText} is used.
      * @param objects the parameters for the string.
-     * Mark occurrences in {@code singularText} and {@code pluralText} with {@code {0}}, {@code {1}}, ...
+     * Mark occurrences in {@code singularText} and {@code pluralText} with <code>{0}</code>, <code>{1}</code>, ...
      * @return the translated string.
      * @see #tr
@@ -250,5 +251,5 @@
      * @param n a number to determine whether {@code singularText} or {@code pluralText} is used.
      * @param objects the parameters for the string.
-     * Mark occurrences in {@code singularText} and {@code pluralText} with {@code {0}}, {@code {1}}, ...
+     * Mark occurrences in {@code singularText} and {@code pluralText} with <code>{0}</code>, <code>{1}</code>, ...
      * @return the translated string.
      * @see #tr
@@ -260,14 +261,11 @@
     }
 
-    private static final String gettext(String text, String ctx, boolean lazy)
-    {
+    private static final String gettext(String text, String ctx, boolean lazy) {
         int i;
-        if(ctx == null && text.startsWith("_:") && (i = text.indexOf('\n')) >= 0)
-        {
+        if(ctx == null && text.startsWith("_:") && (i = text.indexOf('\n')) >= 0) {
             ctx = text.substring(2,i-1);
             text = text.substring(i+1);
         }
-        if(strings != null)
-        {
+        if(strings != null) {
             String trans = strings.get(ctx == null ? text : "_:"+ctx+"\n"+text);
             if(trans != null)
@@ -287,5 +285,4 @@
     }
 
-
     /* try without context, when context try fails */
     private static final String gettext_lazy(String text, String ctx) {
@@ -293,14 +290,11 @@
     }
 
-    private static final String gettextn(String text, String plural, String ctx, long num)
-    {
+    private static final String gettextn(String text, String plural, String ctx, long num) {
         int i;
-        if(ctx == null && text.startsWith("_:") && (i = text.indexOf('\n')) >= 0)
-        {
+        if(ctx == null && text.startsWith("_:") && (i = text.indexOf('\n')) >= 0) {
             ctx = text.substring(2,i-1);
             text = text.substring(i+1);
         }
-        if(pstrings != null)
-        {
+        if(pstrings != null) {
             i = pluralEval(num);
             String[] trans = pstrings.get(ctx == null ? text : "_:"+ctx+"\n"+text);
@@ -327,6 +321,5 @@
     public static final Locale[] getAvailableTranslations() {
         Collection<Locale> v = new ArrayList<>(languages.size());
-        if(getTranslationFile("en") != null)
-        {
+        if(getTranslationFile("en") != null) {
             for (String loc : languages.keySet()) {
                 if(getTranslationFile(loc) != null) {
@@ -347,11 +340,17 @@
     }
 
-    public static boolean hasCode(String code)
-    {
+    /**
+     * Determines if a language exists for the given code.
+     * @param code The language code
+     * @return {@code true} if a language exists, {@code false} otherwise
+     */
+    public static boolean hasCode(String code) {
         return languages.containsKey(code);
     }
 
-    public static void init()
-    {
+    /**
+     * I18n initialization.
+     */
+    public static void init() {
         //languages.put("ar", PluralMode.MODE_AR);
         languages.put("bg", PluralMode.MODE_NOTONE);
@@ -499,6 +498,5 @@
            }
          */
-        try
-        {
+        try {
             InputStream ens = new BufferedInputStream(en);
             InputStream trs = new BufferedInputStream(tr);
@@ -507,8 +505,6 @@
             boolean multimode = false;
             byte[] str = new byte[4096];
-            for(;;)
-            {
-                if(multimode)
-                {
+            for(;;) {
+                if(multimode) {
                     int ennum = ens.read();
                     int trnum = trs.read();
@@ -522,6 +518,5 @@
                     String[] enstrings = new String[ennum];
                     String[] trstrings = new String[trnum];
-                    for(int i = 0; i < ennum; ++i)
-                    {
+                    for(int i = 0; i < ennum; ++i) {
                         int val = ens.read(enlen);
                         if(val != 2) /* file corrupt */
@@ -536,6 +531,5 @@
                         enstrings[i] = new String(str, 0, val, StandardCharsets.UTF_8);
                     }
-                    for(int i = 0; i < trnum; ++i)
-                    {
+                    for(int i = 0; i < trnum; ++i) {
                         int val = trs.read(trlen);
                         if(val != 2) /* file corrupt */
@@ -553,7 +547,5 @@
                         p.put(enstrings[0], trstrings);
                     }
-                }
-                else
-                {
+                } else {
                     int enval = ens.read(enlen);
                     int trval = trs.read(trlen);
@@ -569,6 +561,5 @@
                     if(trval == 0xFFFE) /* marks identical string, handle equally to non-translated */
                         trval = 0;
-                    if(enval == 0xFFFF)
-                    {
+                    if(enval == 0xFFFF) {
                         multimode = true;
                         if(trval != 0xFFFF) /* files do not match */
@@ -596,6 +587,5 @@
                 }
             }
-        }
-        catch (IOException e) {
+        } catch (IOException e) {
             return false;
         }
@@ -655,8 +645,6 @@
     }
 
-    private static int pluralEval(long n)
-    {
-        switch(pluralMode)
-        {
+    private static int pluralEval(long n) {
+        switch(pluralMode) {
         case MODE_NOTONE: /* bg, da, de, el, en, en_GB, es, et, eu, fi, gl, is, it, iw_IL, nb, nl, sv */
             return ((n != 1) ? 1 : 0);
