[uim-commit] r1305 - trunk/uim

tkng at freedesktop.org tkng at freedesktop.org
Wed Aug 24 12:51:44 PDT 2005


Author: tkng
Date: 2005-08-24 12:51:40 -0700 (Wed, 24 Aug 2005)
New Revision: 1305

Modified:
   trunk/uim/uim-util.c
   trunk/uim/uim-util.h
Log:
* uim/uim-util.c, uim/uim-util.h:
 -(uim_get_language_code_from_language_name): New function.


Modified: trunk/uim/uim-util.c
===================================================================
--- trunk/uim/uim-util.c	2005-08-24 14:33:00 UTC (rev 1304)
+++ trunk/uim/uim-util.c	2005-08-24 19:51:40 UTC (rev 1305)
@@ -597,6 +597,18 @@
   return get_language_name_from_locale(localename);
 }
 
+const char *
+uim_get_language_code_from_language_name(const char *language_name)
+{
+  unsigned int i;
+  for (i = 0; i < NR_LOCALE_LANGUAGE; i++) {
+    if (strcmp(locale_language_table[i].language, language_name) == 0) {
+      return locale_language_table[i].locale;
+    }
+  }
+  return NULL;
+}
+
 static uim_lisp
 lang_code_to_lang_name_raw(uim_lisp code_)
 {

Modified: trunk/uim/uim-util.h
===================================================================
--- trunk/uim/uim-util.h	2005-08-24 14:33:00 UTC (rev 1304)
+++ trunk/uim/uim-util.h	2005-08-24 19:51:40 UTC (rev 1305)
@@ -52,6 +52,9 @@
 const char *
 uim_get_language_name_from_locale(const char *localename);
 
+const char *
+uim_get_language_code_from_language_name(const char *language_name);
+
 int
 is_setugid(void);
 



More information about the uim-commit mailing list