From 4cbe7d9d946b14b404b91a1b6fab9fc21892a271 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 29 Oct 2011 14:14:13 +0000 Subject: Remove any need for LangNames to be imported as a Messages file svn path=/trunk/netsurf/; revision=13099 --- amiga/gui.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'amiga') diff --git a/amiga/gui.c b/amiga/gui.c index 82efa0650..b9e6ce706 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -171,12 +171,15 @@ Object *ami_gui_splash_open(void); void ami_gui_splash_close(Object *win_obj); static uint32 ami_set_search_ico_render_hook(struct Hook *hook, APTR space, struct gpRender *msg); +bool ami_gui_map_filename(char **remapped, const char *path, const char *file, + const char *map); STRPTR ami_locale_langs(void) { struct Locale *locale; STRPTR acceptlangs = NULL, acceptlangs2 = NULL; int i; + char *remapped; if(locale = OpenLocale(NULL)) { @@ -184,18 +187,19 @@ STRPTR ami_locale_langs(void) { if(locale->loc_PrefLanguages[i]) { - if(messages_get(locale->loc_PrefLanguages[i]) != locale->loc_PrefLanguages[i]) + if(ami_gui_map_filename(&remapped, "PROGDIR:Resources", + locale->loc_PrefLanguages[i], "LangNames")) { if(acceptlangs) { acceptlangs2 = acceptlangs; - acceptlangs = ASPrintf("%s, %s",acceptlangs2,messages_get(locale->loc_PrefLanguages[i])); + acceptlangs = ASPrintf("%s, %s",acceptlangs2, remapped); FreeVec(acceptlangs2); acceptlangs2 = NULL; } else { - acceptlangs = ASPrintf("%s",messages_get(locale->loc_PrefLanguages[i])); + acceptlangs = ASPrintf("%s", remapped); } } } @@ -230,7 +234,7 @@ bool ami_gui_map_filename(char **remapped, const char *path, const char *file, c if(realfname = strchr(buffer, ':')) { - if(strncmp(buffer, file, (realfname - buffer)) == 0) + if(strncmp(buffer, file, strlen(file)) == 0) { if(realfname[strlen(realfname)-1] == '\n') realfname[strlen(realfname)-1] = '\0'; -- cgit v1.2.3