Mi aldonas hungaran transliterigon.
authorviric@mandarina
Mon, 21 Jul 2008 00:05:50 +0200
changeset 42 df0d043aac70
parent 41 b33eedeeabd3
child 48 f3660feedd64
Mi aldonas hungaran transliterigon.
src/jdict/AskWord.java
src/jdict/Replace.java
--- a/src/jdict/AskWord.java	Mon Aug 13 23:57:15 2007 +0200
+++ b/src/jdict/AskWord.java	Mon Jul 21 00:05:50 2008 +0200
@@ -19,6 +19,7 @@
     private String translit_neniu;
     private String translit_iksa;
     private String translit_rusa;
+    private String translit_hungara;
     private StringItem showSearch;
     private String vortaro;
     private DictIndex index;
@@ -60,6 +61,7 @@
         translit_neniu = T.t("Neniu");
         translit_iksa = T.t("Iksa sistemo");
         translit_rusa = T.t("ASCII-rusa");
+        translit_hungara = T.t("ASCII-hungara");
 
 		myform = new Form(vortaro);
 
@@ -79,6 +81,9 @@
         translit.append(translit_rusa, null);
         if (tselected != null && tselected.equals(translit_rusa))
             translit.setSelectedIndex(lindex, true);
+        translit.append(translit_hungara, null);
+        if (tselected != null && tselected.equals(translit_hungara))
+            translit.setSelectedIndex(lindex, true);
         if (tselected == null)
             translit.setSelectedIndex(0, true);
         myform.append(translit);
@@ -118,6 +123,9 @@
         else if (translit.getString(translit.getSelectedIndex())
                 .equals(translit_rusa))
             out = Replace.AsciiAlRusa(from);
+        else if (translit.getString(translit.getSelectedIndex())
+                .equals(translit_hungara))
+            out = Replace.AsciiAlHungara(from);
 
         return out;
     }
--- a/src/jdict/Replace.java	Mon Aug 13 23:57:15 2007 +0200
+++ b/src/jdict/Replace.java	Mon Jul 21 00:05:50 2008 +0200
@@ -80,4 +80,21 @@
 
         return result;
     }
+
+    public static String AsciiAlHungara(String original)
+    {
+        String result = original;
+
+        result = replace_sub(result, "'a", "á");
+        result = replace_sub(result, "'e", "é");
+        result = replace_sub(result, "'i", "í");
+        result = replace_sub(result, "'o", "ó");
+        result = replace_sub(result, "'u", "ú");
+        result = replace_sub(result, "_o", "ô");
+        result = replace_sub(result, "\"o", "ö");
+        result = replace_sub(result, "_u", "û");
+        result = replace_sub(result, "\"u", "ü");
+
+        return result;
+    }
 }