summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormiham <miham@openttd.org>2005-02-17 07:49:31 +0000
committermiham <miham@openttd.org>2005-02-17 07:49:31 +0000
commit7678a937e4356b4b3b25290edd364877068db77e (patch)
treea50c67a635fcc162ee1691b5435f32666411d188
parent7a690eb5fb9c942d4710ef4d602a081df980f070 (diff)
downloadopenttd-7678a937e4356b4b3b25290edd364877068db77e.tar.xz
(svn r1880) [Codechange] Added isocodes to langfiles and support code to strgen (Lauri Nurmi)
-rw-r--r--lang/american.txt1
-rw-r--r--lang/catalan.txt1
-rw-r--r--lang/czech.txt1
-rw-r--r--lang/danish.txt1
-rw-r--r--lang/dutch.txt1
-rw-r--r--lang/english.txt1
-rw-r--r--lang/finnish.txt1
-rw-r--r--lang/french.txt1
-rw-r--r--lang/galician.txt1
-rw-r--r--lang/german.txt1
-rw-r--r--lang/hungarian.txt1
-rw-r--r--lang/icelandic.txt1
-rw-r--r--lang/italian.txt1
-rw-r--r--lang/norwegian.txt1
-rw-r--r--lang/origveh.txt1
-rw-r--r--lang/polish.txt1
-rw-r--r--lang/portuguese.txt1
-rw-r--r--lang/romanian.txt1
-rw-r--r--lang/slovak.txt1
-rw-r--r--lang/spanish.txt1
-rw-r--r--lang/swedish.txt1
-rw-r--r--strgen/strgen.c6
-rw-r--r--strings.c1
23 files changed, 27 insertions, 1 deletions
diff --git a/lang/american.txt b/lang/american.txt
index 109fcae6a..0219769ca 100644
--- a/lang/american.txt
+++ b/lang/american.txt
@@ -1,5 +1,6 @@
##name American
##ownname English (US)
+##isocode en_US
##id 0x0000
STR_NULL :
diff --git a/lang/catalan.txt b/lang/catalan.txt
index 75b16fa1b..121cfb1b4 100644
--- a/lang/catalan.txt
+++ b/lang/catalan.txt
@@ -1,5 +1,6 @@
##name Catalan
##ownname Català
+##isocode ca
##id 0x0000
STR_NULL :
diff --git a/lang/czech.txt b/lang/czech.txt
index 178b13170..9829521cf 100644
--- a/lang/czech.txt
+++ b/lang/czech.txt
@@ -1,5 +1,6 @@
##name Czech
##ownname Cesky
+##isocode cs
##id 0x0000
STR_NULL :
diff --git a/lang/danish.txt b/lang/danish.txt
index b3f105622..f0693293a 100644
--- a/lang/danish.txt
+++ b/lang/danish.txt
@@ -1,5 +1,6 @@
##name Danish
##ownname Dansk
+##isocode da
##id 0x0000
STR_NULL :
diff --git a/lang/dutch.txt b/lang/dutch.txt
index 24e2d81c4..4d672aae7 100644
--- a/lang/dutch.txt
+++ b/lang/dutch.txt
@@ -1,5 +1,6 @@
##name Dutch
##ownname Nederlands
+##isocode nl
##id 0x0000
STR_NULL :
diff --git a/lang/english.txt b/lang/english.txt
index 6b69dc772..d91046ca0 100644
--- a/lang/english.txt
+++ b/lang/english.txt
@@ -1,5 +1,6 @@
##name English
##ownname English (UK)
+##isocode en_GB
##id 0x0000
STR_NULL :
diff --git a/lang/finnish.txt b/lang/finnish.txt
index efb7605b8..3a1f4e23b 100644
--- a/lang/finnish.txt
+++ b/lang/finnish.txt
@@ -1,5 +1,6 @@
##name Finnish
##ownname Suomi
+##isocode fi
##id 0x0000
STR_NULL :
diff --git a/lang/french.txt b/lang/french.txt
index 3edaeccce..2776dee62 100644
--- a/lang/french.txt
+++ b/lang/french.txt
@@ -1,5 +1,6 @@
##name French
##ownname Français
+##isocode fr
##id 0x0000
STR_NULL :
diff --git a/lang/galician.txt b/lang/galician.txt
index 2955524e3..583c9b3ed 100644
--- a/lang/galician.txt
+++ b/lang/galician.txt
@@ -1,5 +1,6 @@
##name Galician
##ownname Galego
+##isocode gl
##id 0x0000
STR_NULL :
diff --git a/lang/german.txt b/lang/german.txt
index 5d13a0a59..3a2c22c49 100644
--- a/lang/german.txt
+++ b/lang/german.txt
@@ -1,5 +1,6 @@
##name German
##ownname Deutsch
+##isocode de
##id 0x0000
STR_NULL :
diff --git a/lang/hungarian.txt b/lang/hungarian.txt
index 16664a64d..1c1430213 100644
--- a/lang/hungarian.txt
+++ b/lang/hungarian.txt
@@ -1,5 +1,6 @@
##name Hungarian
##ownname Magyar
+##isocode hu
##id 0x0000
STR_NULL :
diff --git a/lang/icelandic.txt b/lang/icelandic.txt
index 945ce07eb..ce45c9f11 100644
--- a/lang/icelandic.txt
+++ b/lang/icelandic.txt
@@ -1,5 +1,6 @@
##name Icelandic
##ownname Íslenska
+##isocode is
##id 0x0000
STR_NULL :
diff --git a/lang/italian.txt b/lang/italian.txt
index bfbf6a5ed..c6de0a39f 100644
--- a/lang/italian.txt
+++ b/lang/italian.txt
@@ -1,5 +1,6 @@
##name Italian
##ownname Italian (IT)
+##isocode it
##id 0x0000
STR_NULL :
diff --git a/lang/norwegian.txt b/lang/norwegian.txt
index 4b3124864..46aba9d14 100644
--- a/lang/norwegian.txt
+++ b/lang/norwegian.txt
@@ -1,5 +1,6 @@
##name Norwegian
##ownname Norsk, bokmål
+##isocode nb
##id 0x0000
STR_NULL :
diff --git a/lang/origveh.txt b/lang/origveh.txt
index 438ca19ae..78388c0a7 100644
--- a/lang/origveh.txt
+++ b/lang/origveh.txt
@@ -1,5 +1,6 @@
##name Original vehicle names (ENG)
##ownname Original vehicle names (ENG)
+##isocode xx
##id 0x8000
STR_8000_KIRBY_PAUL_TANK_STEAM :Collett Pannier Tank (Steam)
diff --git a/lang/polish.txt b/lang/polish.txt
index f6d226eec..62704fc17 100644
--- a/lang/polish.txt
+++ b/lang/polish.txt
@@ -1,5 +1,6 @@
##name Polish
##ownname Polski
+##isocode pl
##id 0x0000
STR_NULL :
diff --git a/lang/portuguese.txt b/lang/portuguese.txt
index d84918d2b..f4555989f 100644
--- a/lang/portuguese.txt
+++ b/lang/portuguese.txt
@@ -1,5 +1,6 @@
##name Portuguese
##ownname Português
+##isocode pt
##id 0x0000
STR_NULL :
diff --git a/lang/romanian.txt b/lang/romanian.txt
index 578dd7eb3..4cc827e7b 100644
--- a/lang/romanian.txt
+++ b/lang/romanian.txt
@@ -1,5 +1,6 @@
##name Romanian
##ownname Românã
+##isocode ro
##id 0x0000
STR_NULL :
diff --git a/lang/slovak.txt b/lang/slovak.txt
index 2de803d8b..4a8276173 100644
--- a/lang/slovak.txt
+++ b/lang/slovak.txt
@@ -1,5 +1,6 @@
##name Slovak
##ownname Slovensky
+##isocode sk
##id 0x0000
STR_NULL :
diff --git a/lang/spanish.txt b/lang/spanish.txt
index a9c5fa313..2b39bc68a 100644
--- a/lang/spanish.txt
+++ b/lang/spanish.txt
@@ -1,5 +1,6 @@
##name Spanish
##ownname Español (ES)
+##isocode es
##id 0x0000
STR_NULL :
diff --git a/lang/swedish.txt b/lang/swedish.txt
index 5c536fd58..d0d2f6734 100644
--- a/lang/swedish.txt
+++ b/lang/swedish.txt
@@ -1,5 +1,6 @@
##name Swedish
##ownname Svenska
+##isocode sv
##id 0x0000
STR_NULL :
diff --git a/strgen/strgen.c b/strgen/strgen.c
index 481640643..805da6755 100644
--- a/strgen/strgen.c
+++ b/strgen/strgen.c
@@ -26,6 +26,7 @@ typedef struct {
uint32 version; // 32-bits of auto generated version info which is basically a hash of strings.h
char name[32]; // the international name of this language
char own_name[32]; // the localized name of this language
+ char isocode[16]; // the ISO code for the language (not country code)
uint16 offsets[32]; // the offsets
} LanguagePackHeader;
@@ -45,7 +46,7 @@ int _cur_line;
bool _warnings;
uint32 _hash;
-char _lang_name[32], _lang_ownname[32];
+char _lang_name[32], _lang_ownname[32], _lang_isocode[16];
#define HASH_SIZE 1023
LineName *_hash_head[HASH_SIZE];
@@ -362,6 +363,8 @@ void handle_pragma(char *str)
ttd_strlcpy(_lang_name, str + 5, sizeof(_lang_name));
} else if (!memcmp(str, "ownname ", 8)) {
ttd_strlcpy(_lang_ownname, str + 8, sizeof(_lang_ownname));
+ } else if (!memcmp(str, "isocode ", 8)) {
+ ttd_strlcpy(_lang_isocode, str + 8, sizeof(_lang_isocode));
} else {
error("unknown pragma '%s'", str);
}
@@ -700,6 +703,7 @@ void write_langfile(const char *filename, int show_todo)
hdr.version = TO_LE32(_hash);
strcpy(hdr.name, _lang_name);
strcpy(hdr.own_name, _lang_ownname);
+ strcpy(hdr.isocode, _lang_isocode);
fwrite(&hdr, sizeof(hdr), 1, f);
diff --git a/strings.c b/strings.c
index d4cd69752..75c5401e5 100644
--- a/strings.c
+++ b/strings.c
@@ -23,6 +23,7 @@ typedef struct LanguagePack {
uint32 version; // 32-bits of auto generated version info which is basically a hash of strings.h
char name[32]; // the international name of this language
char own_name[32]; // the localized name of this language
+ char isocode[16]; // the ISO code for the language (not country code)
uint16 offsets[32]; // the offsets
char data[VARARRAY_SIZE];
} LanguagePack;