summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2009-05-09 18:56:12 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2009-05-09 18:56:12 +0000
commitc523d9f20b57ceb4d015be87a7bef8841dbc5e2b (patch)
tree816592f08e3617e00e74552039818fd2f3ef974b /amiga
parent1612d0f40dc1c4eb20c2a98098a4d6776f018d86 (diff)
downloadnetsurf-c523d9f20b57ceb4d015be87a7bef8841dbc5e2b.tar.gz
netsurf-c523d9f20b57ceb4d015be87a7bef8841dbc5e2b.tar.bz2
Populate option_accept_language with the user's preferred languages, in order.
LangNames now contains the language codes for all languages available with OS4.1, plus Welsh (http://aminet.net/package/misc/misc/welsh_lang). There are no other 3rd party .language files available for OS4 that I am aware of, but any new ones can easily be added if/when they become available. These may now not be exactly the same as the RISC OS names, but that can be resolved by renaming directories for new translations (current ones are OK), or reverting back to the AmigaOS names for Messages files paths. svn path=/trunk/netsurf/; revision=7452
Diffstat (limited to 'amiga')
-rwxr-xr-xamiga/gui.c24
-rwxr-xr-xamiga/resources/LangNames60
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