From 9922cef1af71786ae788903b52a8968e5775d510 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Tue, 5 Jul 2005 03:15:53 +0000 Subject: Save / Load --- ui/rccnames.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'ui/rccnames.c') diff --git a/ui/rccnames.c b/ui/rccnames.c index 961dbbc..2e11165 100644 --- a/ui/rccnames.c +++ b/ui/rccnames.c @@ -3,29 +3,42 @@ #include "internal.h" const char *rccUiGetLanguageName(rcc_ui_context ctx, const char *lang) { + const char *res; unsigned int i; rcc_language_name *names; if ((!ctx)||(!lang)) return NULL; - + names = ctx->language_names; + + if (names) { + for (i=0;names[i].sn;i++) + if (!strcmp(lang, names[i].sn)) return names[i].name; + } - for (i=0;names[i].sn;i++) - if (!strcmp(lang, names[i].sn)) return names[i].name; + + res = rccGetLanguageFullName(lang); + if (res) return res; return lang; } const char *rccUiGetOptionName(rcc_ui_context ctx, rcc_option option) { + const char *res; unsigned int i; rcc_option_name *names; - if (!ctx) return NULL; + if ((!ctx)||(option<0)||(option>RCC_MAX_OPTIONS)) return NULL; names = ctx->option_names; - for (i=0;((i