mirror of https://github.com/OpenTTD/OpenTTD
(svn r1880) [Codechange] Added isocodes to langfiles and support code to strgen (Lauri Nurmi)
parent
7a690eb5fb
commit
7678a937e4
|
@ -1,5 +1,6 @@
|
||||||
##name American
|
##name American
|
||||||
##ownname English (US)
|
##ownname English (US)
|
||||||
|
##isocode en_US
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Catalan
|
##name Catalan
|
||||||
##ownname Catalŕ
|
##ownname Catalŕ
|
||||||
|
##isocode ca
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Czech
|
##name Czech
|
||||||
##ownname Cesky
|
##ownname Cesky
|
||||||
|
##isocode cs
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Danish
|
##name Danish
|
||||||
##ownname Dansk
|
##ownname Dansk
|
||||||
|
##isocode da
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Dutch
|
##name Dutch
|
||||||
##ownname Nederlands
|
##ownname Nederlands
|
||||||
|
##isocode nl
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name English
|
##name English
|
||||||
##ownname English (UK)
|
##ownname English (UK)
|
||||||
|
##isocode en_GB
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Finnish
|
##name Finnish
|
||||||
##ownname Suomi
|
##ownname Suomi
|
||||||
|
##isocode fi
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name French
|
##name French
|
||||||
##ownname Français
|
##ownname Français
|
||||||
|
##isocode fr
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Galician
|
##name Galician
|
||||||
##ownname Galego
|
##ownname Galego
|
||||||
|
##isocode gl
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name German
|
##name German
|
||||||
##ownname Deutsch
|
##ownname Deutsch
|
||||||
|
##isocode de
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Hungarian
|
##name Hungarian
|
||||||
##ownname Magyar
|
##ownname Magyar
|
||||||
|
##isocode hu
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Icelandic
|
##name Icelandic
|
||||||
##ownname Íslenska
|
##ownname Íslenska
|
||||||
|
##isocode is
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Italian
|
##name Italian
|
||||||
##ownname Italian (IT)
|
##ownname Italian (IT)
|
||||||
|
##isocode it
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Norwegian
|
##name Norwegian
|
||||||
##ownname Norsk, bokmål
|
##ownname Norsk, bokmål
|
||||||
|
##isocode nb
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Original vehicle names (ENG)
|
##name Original vehicle names (ENG)
|
||||||
##ownname Original vehicle names (ENG)
|
##ownname Original vehicle names (ENG)
|
||||||
|
##isocode xx
|
||||||
|
|
||||||
##id 0x8000
|
##id 0x8000
|
||||||
STR_8000_KIRBY_PAUL_TANK_STEAM :Collett Pannier Tank (Steam)
|
STR_8000_KIRBY_PAUL_TANK_STEAM :Collett Pannier Tank (Steam)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Polish
|
##name Polish
|
||||||
##ownname Polski
|
##ownname Polski
|
||||||
|
##isocode pl
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Portuguese
|
##name Portuguese
|
||||||
##ownname Portuguęs
|
##ownname Portuguęs
|
||||||
|
##isocode pt
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Romanian
|
##name Romanian
|
||||||
##ownname Română
|
##ownname Română
|
||||||
|
##isocode ro
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Slovak
|
##name Slovak
|
||||||
##ownname Slovensky
|
##ownname Slovensky
|
||||||
|
##isocode sk
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Spanish
|
##name Spanish
|
||||||
##ownname Español (ES)
|
##ownname Español (ES)
|
||||||
|
##isocode es
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
##name Swedish
|
##name Swedish
|
||||||
##ownname Svenska
|
##ownname Svenska
|
||||||
|
##isocode sv
|
||||||
|
|
||||||
##id 0x0000
|
##id 0x0000
|
||||||
STR_NULL :
|
STR_NULL :
|
||||||
|
|
|
@ -26,6 +26,7 @@ typedef struct {
|
||||||
uint32 version; // 32-bits of auto generated version info which is basically a hash of strings.h
|
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 name[32]; // the international name of this language
|
||||||
char own_name[32]; // the localized 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
|
uint16 offsets[32]; // the offsets
|
||||||
} LanguagePackHeader;
|
} LanguagePackHeader;
|
||||||
|
|
||||||
|
@ -45,7 +46,7 @@ int _cur_line;
|
||||||
bool _warnings;
|
bool _warnings;
|
||||||
|
|
||||||
uint32 _hash;
|
uint32 _hash;
|
||||||
char _lang_name[32], _lang_ownname[32];
|
char _lang_name[32], _lang_ownname[32], _lang_isocode[16];
|
||||||
|
|
||||||
#define HASH_SIZE 1023
|
#define HASH_SIZE 1023
|
||||||
LineName *_hash_head[HASH_SIZE];
|
LineName *_hash_head[HASH_SIZE];
|
||||||
|
@ -362,6 +363,8 @@ void handle_pragma(char *str)
|
||||||
ttd_strlcpy(_lang_name, str + 5, sizeof(_lang_name));
|
ttd_strlcpy(_lang_name, str + 5, sizeof(_lang_name));
|
||||||
} else if (!memcmp(str, "ownname ", 8)) {
|
} else if (!memcmp(str, "ownname ", 8)) {
|
||||||
ttd_strlcpy(_lang_ownname, str + 8, sizeof(_lang_ownname));
|
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 {
|
} else {
|
||||||
error("unknown pragma '%s'", str);
|
error("unknown pragma '%s'", str);
|
||||||
}
|
}
|
||||||
|
@ -700,6 +703,7 @@ void write_langfile(const char *filename, int show_todo)
|
||||||
hdr.version = TO_LE32(_hash);
|
hdr.version = TO_LE32(_hash);
|
||||||
strcpy(hdr.name, _lang_name);
|
strcpy(hdr.name, _lang_name);
|
||||||
strcpy(hdr.own_name, _lang_ownname);
|
strcpy(hdr.own_name, _lang_ownname);
|
||||||
|
strcpy(hdr.isocode, _lang_isocode);
|
||||||
|
|
||||||
fwrite(&hdr, sizeof(hdr), 1, f);
|
fwrite(&hdr, sizeof(hdr), 1, f);
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ typedef struct LanguagePack {
|
||||||
uint32 version; // 32-bits of auto generated version info which is basically a hash of strings.h
|
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 name[32]; // the international name of this language
|
||||||
char own_name[32]; // the localized 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
|
uint16 offsets[32]; // the offsets
|
||||||
char data[VARARRAY_SIZE];
|
char data[VARARRAY_SIZE];
|
||||||
} LanguagePack;
|
} LanguagePack;
|
||||||
|
|
Loading…
Reference in New Issue