summaryrefslogtreecommitdiffstats
path: root/apps/language.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/language.c')
-rw-r--r--apps/language.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/language.c b/apps/language.c
index 7253ec275b..73ed0fe39b 100644
--- a/apps/language.c
+++ b/apps/language.c
@@ -98,3 +98,16 @@ int lang_load(const char *filename)
close(fd);
return retcode;
}
+
+int lang_english_to_id(const char* english)
+{
+ int i;
+ unsigned char *ptr = (unsigned char *) language_builtin;
+
+ for (i = 0; i < LANG_LAST_INDEX_IN_ARRAY; i++) {
+ if (!strcmp(ptr, english))
+ return i;
+ ptr += strlen((char *)ptr) + 1; /* advance pointer to next string */
+ }
+ return -1;
+}