summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2011-10-29 14:14:13 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2011-10-29 14:14:13 +0000
commit4cbe7d9d946b14b404b91a1b6fab9fc21892a271 (patch)
treeabd547178fe811218287508a59c965aa3f802694 /amiga
parentb84ebeed36e7756551be68bbde0e206b0a85d11e (diff)
downloadnetsurf-4cbe7d9d946b14b404b91a1b6fab9fc21892a271.tar.gz
netsurf-4cbe7d9d946b14b404b91a1b6fab9fc21892a271.tar.bz2
Remove any need for LangNames to be imported as a Messages file
svn path=/trunk/netsurf/; revision=13099
Diffstat (limited to 'amiga')
-rwxr-xr-xamiga/gui.c12
1 files changed, 8 insertions, 4 deletions
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';