From 594dd34e84e78b03e1cdeb7cf262707fd714a5fa Mon Sep 17 00:00:00 2001 From: ludde Date: Sat, 16 Jul 2005 20:58:04 +0000 Subject: (svn r2594) Fix: [strgen] Misc updates to the string system. - Renamed the plural command to "P" instead of "PLURAL". Now write something like this to append an s on plural: {P "" s}. (You can optionally still add an argument index to explicitly specifiy which number that's used) - Removed the pluralized cargo strings from the string files. The new method is to use the plural specifier {P} - Added support for genders. First add "##gender der das die" on top, then use {G=der} on a cargoname/industry to set the gender, and to switch between genders do something like {G neu neu neue} {STRING} - Updated the swedish/english translation with P strings. --- strgen/strgen.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 73 insertions(+), 15 deletions(-) (limited to 'strgen') diff --git a/strgen/strgen.c b/strgen/strgen.c index 5cac8147c..5b3e95e5b 100644 --- a/strgen/strgen.c +++ b/strgen/strgen.c @@ -59,6 +59,9 @@ static uint32 _hash; static char _lang_name[32], _lang_ownname[32], _lang_isocode[16]; static byte _lang_pluralform; +static char _genders[8][8]; +static int _numgenders; + // for each plural value, this is the number of plural forms. static const byte _plural_form_counts[] = { 2,1,2,3,3,3,3,3,4 }; @@ -245,16 +248,28 @@ char *ParseWord(char **buf) // Forward declaration static int TranslateArgumentIdx(int arg, bool relative); +static void EmitWordList(char **words, int nw) +{ + int i,j; + + PutByte(nw); + for(i=0; i