diff options
-rwxr-xr-x | amiga/gui.c | 24 | ||||
-rwxr-xr-x | amiga/resources/LangNames | 60 |
2 files changed, 73 insertions, 11 deletions
diff --git a/amiga/gui.c b/amiga/gui.c index 13f14837d..402345151 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -181,7 +181,7 @@ static void *myrealloc(void *ptr, size_t len, void *pw); void gui_init(int argc, char** argv) { struct Locale *locale; - char lang[100],throbberfile[100]; + char lang[100],throbberfile[100],tempacceptlangs[100] = "\0"; bool found=FALSE; int i; BPTR lock=0,amiupdatefh; @@ -271,6 +271,25 @@ void gui_init(int argc, char** argv) strcpy(lang,"PROGDIR:Resources/en/Messages"); } + for(i=0;i<10;i++) + { + if(locale->loc_PrefLanguages[i]) + { + if(messages_get(locale->loc_PrefLanguages[i]) != locale->loc_PrefLanguages[i]) + { + if(tempacceptlangs[0] != '\0') + { + strcat(tempacceptlangs,", "); + } + strcat(tempacceptlangs,messages_get(locale->loc_PrefLanguages[i])); + } + } + else + { + continue; + } + } + CloseLocale(locale); messages_load(lang); @@ -288,6 +307,9 @@ void gui_init(int argc, char** argv) css_scrollbar_bg_colour = 0x00833c3c; css_scrollbar_arrow_colour = 0x00d6d6d6; + if((!option_accept_language) || (option_accept_language[0] == '\0')) + option_accept_language = (char *)strdup(tempacceptlangs); + if((!option_cookie_file) || (option_cookie_file[0] == '\0')) option_cookie_file = (char *)strdup("PROGDIR:Resources/Cookies"); diff --git a/amiga/resources/LangNames b/amiga/resources/LangNames index 10c3a55f2..51c00e74e 100755 --- a/amiga/resources/LangNames +++ b/amiga/resources/LangNames @@ -1,19 +1,59 @@ # LangNames file for NetSurf AmigaOS # # Maps AmigaOS locale.library language names to the two character -# RISC OS equivalents, enabling localised text strings files -# shareable with the RISC OS version of NetSurf, without the -# hassle of renaming directories. +# ISO-639 codes, enabling localised text strings files shareable +# with the RISC OS version of NetSurf, without the hassle of +# renaming directories, and to specify accept-language encoding +# with no additional configuration. # -# Format is <Locale language name>:<two character language code> +# Format is <Locale language name>:<language tag> # -# Netsurf will use the full AmigaOS language name if it is not -# present in this file. If you add a translation please use the -# RISC OS naming scheme when possible and add it to this file! +# NetSurf will use the full AmigaOS language name if it is not +# present in this file. # -english-british:en +albanian:sq +belarusian:be +bosnian:bs +bulgarian:bg +catalan:ca +croatian:hr +czech:cs +danish:da +dutch:nl english:en -german:de +english-british:en-GB +esperanto:eo +estonian:et +faroese:fo +finnish:fi french:fr -dutch:nl +galician:gl +german:de +greek:el +hebrew:he +hungarian:hu +icelandic:is +irish:ga italian:it +latvian:lv +lithuanian:lt +macedonian:mk +malay-indonesian:id +malay-malaysian:ms +maltese:mt +norwegian:nb +norwegian-nynorsk:nn +polish:pl +portuguese:pt +portuguese-brazil:pr-BR +romanian:ro +russian:ru +serbian:sr +slovak:sk +slovenian:sl +spanish:es +swedish:sv +thai:th +turkish:tr +ukrainian:uk +welsh:cy |