Index: client/packhand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v retrieving revision 1.111 diff -u -r1.111 packhand.c --- packhand.c 2000/01/19 16:33:13 1.111 +++ packhand.c 2000/01/25 20:26:43 @@ -1282,6 +1282,7 @@ gov->ruler_titles[p->id].nation = p->nation; sz_strlcpy(gov->ruler_titles[p->id].male_title, p->male_title); sz_strlcpy(gov->ruler_titles[p->id].female_title, p->female_title); + sz_strlcpy(gov->ruler_titles[p->id].country_title, p->country_title); } /************************************************************************** Index: client/gui-gtk/repodlgs.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/repodlgs.c,v retrieving revision 1.23 diff -u -r1.23 repodlgs.c --- repodlgs.c 2000/01/02 11:55:28 1.23 +++ repodlgs.c 2000/01/25 20:26:43 @@ -131,13 +131,21 @@ ****************************************************************/ char *get_report_title(char *report_name) { + char country_name[512]; char buf[512]; - - my_snprintf(buf, sizeof(buf), _("%s\n%s of the %s\n%s %s: %s"), + + my_snprintf(country_name, sizeof(country_name), + get_country_name(game.player_ptr->government, + game.player_ptr->nation), + get_government_name(game.player_ptr->government), + get_nation_name_plural(game.player_ptr->nation) + ); + + my_snprintf(buf, sizeof(buf), _("%s\n%s\n%s %s: %s"), report_name, - get_government_name(game.player_ptr->government), - get_nation_name_plural(game.player_ptr->nation), - get_ruler_title(game.player_ptr->government, game.player_ptr->is_male, game.player_ptr->nation), + country_name, + get_ruler_title(game.player_ptr->government, + game.player_ptr->is_male, game.player_ptr->nation), game.player_ptr->name, textyear(game.year)); Index: client/gui-xaw/repodlgs.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/repodlgs.c,v retrieving revision 1.17 diff -u -r1.17 repodlgs.c --- repodlgs.c 2000/01/02 11:55:33 1.17 +++ repodlgs.c 2000/01/25 20:26:44 @@ -151,12 +151,19 @@ ****************************************************************/ char *get_report_title(char *report_name) { + char country_name[512]; char buf[512]; - - my_snprintf(buf, sizeof(buf), _("%s\n%s of the %s\n%s %s: %s"), + + my_snprintf(country_name, sizeof(country_name), + get_country_name(game.player_ptr->government, + game.player_ptr->nation), + get_government_name(game.player_ptr->government), + get_nation_name_plural(game.player_ptr->nation) + ); + + my_snprintf(buf, sizeof(buf), _("%s\n%s\n%s %s: %s"), report_name, - get_government_name(game.player_ptr->government), - get_nation_name_plural(game.player_ptr->nation), + country_name, get_ruler_title(game.player_ptr->government, game.player_ptr->is_male, game.player_ptr->nation), game.player_ptr->name, Index: common/game.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/game.c,v retrieving revision 1.61 diff -u -r1.61 game.c --- game.c 2000/01/19 16:33:20 1.61 +++ game.c 2000/01/25 20:26:44 @@ -974,6 +974,8 @@ sz_strlcpy(that->male_title, Q_(that->male_title_orig)); sz_strlcpy(that->female_title_orig, that->female_title); sz_strlcpy(that->female_title, Q_(that->female_title_orig)); + sz_strlcpy(that->country_title_orig, that->country_title); + sz_strlcpy(that->country_title, Q_(that->country_title_orig)); } } for (i=0; i #include +#include "config.h" +#include "fcintl.h" #include "game.h" #include "log.h" #include "mem.h" @@ -192,12 +194,14 @@ char *get_ruler_title(int gov, int male, int nation) { struct government *g = get_government(gov); + struct ruler_title *default_match = NULL; struct ruler_title *best_match = NULL; int i; for(i=0; inum_ruler_titles; i++) { struct ruler_title *title = &g->ruler_titles[i]; if (title->nation == DEFAULT_TITLE && best_match == NULL) { + default_match = title; best_match = title; } else if (title->nation == nation) { best_match = title; @@ -205,6 +209,10 @@ } } + if ((male ? best_match->male_title : best_match->female_title)[0]=='-') { + best_match = default_match; + } + if (best_match) { return male ? best_match->male_title : best_match->female_title; } else { @@ -215,6 +223,37 @@ } } + +/*************************************************************** +... +***************************************************************/ +char *get_country_name(int gov, int nation) +{ + struct government *g = get_government(gov); + struct ruler_title *best_match = NULL; + char *country_title = ""; + int i; + + for(i=0; inum_ruler_titles; i++) { + struct ruler_title *title = &g->ruler_titles[i]; + if (title->nation == DEFAULT_TITLE && best_match == NULL) { + best_match = title; + } else if (title->nation == nation) { + best_match = title; + break; + } + } + + if (best_match) { + country_title = best_match->country_title; + } + + if (country_title[0]=='-') + country_title = _("The %s of the %s"); + + return country_title; +} + /*************************************************************** ... ***************************************************************/ @@ -273,7 +312,7 @@ ... ***************************************************************/ void set_ruler_title(struct government *gov, int nation, - char *male, char *female) + char *male, char *female, char *country) { struct ruler_title *title; @@ -286,4 +325,5 @@ title->nation = nation; sz_strlcpy(title->male_title, male); sz_strlcpy(title->female_title, female); + sz_strlcpy(title->country_title, country); } Index: common/government.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/government.h,v retrieving revision 1.15 diff -u -r1.15 government.h --- government.h 2000/01/08 13:58:04 1.15 +++ government.h 2000/01/25 20:26:44 @@ -56,6 +56,10 @@ /* untranslated copies: */ char male_title_orig[MAX_LEN_NAME]; char female_title_orig[MAX_LEN_NAME]; + + /* name of the country (and translated) */ + char country_title[MAX_LEN_NAME]; + char country_title_orig[MAX_LEN_NAME]; }; /* This is struct government itself. All information about @@ -176,10 +180,11 @@ int get_government_civil_war_prob(int type); char *get_government_name(int type); char *get_ruler_title(int gov, int male, int nation); +char *get_country_name(int gov, int nation); int can_change_to_government(struct player *pplayer, int government); void set_ruler_title(struct government *gov, int nation, - char *male, char *female); + char *male, char *female, char *country); #endif /* FC__GOVERNMENT_H */ Index: common/packets.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/packets.c,v retrieving revision 1.87 diff -u -r1.87 packets.c --- packets.c 2000/01/19 16:33:21 1.87 +++ packets.c 2000/01/25 20:26:44 @@ -2724,6 +2724,7 @@ cptr=put_string(cptr, packet->male_title); cptr=put_string(cptr, packet->female_title); + cptr=put_string(cptr, packet->country_title); put_uint16(buffer, cptr-buffer); return send_connection_data(pc, buffer, cptr-buffer); @@ -2825,6 +2826,7 @@ iget_string(&iter, packet->male_title, sizeof(packet->male_title)); iget_string(&iter, packet->female_title, sizeof(packet->female_title)); + iget_string(&iter, packet->country_title, sizeof(packet->country_title)); pack_iter_end(&iter, pc); remove_packet_from_buffer(&pc->buffer); Index: common/packets.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/packets.h,v retrieving revision 1.60 diff -u -r1.60 packets.h --- packets.h 2000/01/19 16:33:21 1.60 +++ packets.h 2000/01/25 20:26:44 @@ -660,6 +660,7 @@ int nation; char male_title[MAX_LEN_NAME]; char female_title[MAX_LEN_NAME]; + char country_title[MAX_LEN_NAME]; }; struct packet_ruleset_nation { Index: data/default/governments.ruleset =================================================================== RCS file: /home/freeciv/CVS/freeciv/data/default/governments.ruleset,v retrieving revision 1.13 diff -u -r1.13 governments.ruleset --- governments.ruleset 1999/12/28 12:16:26 1.13 +++ governments.ruleset 2000/01/25 20:26:44 @@ -142,6 +142,7 @@ ruler_male_title = _("Mr.") ruler_female_title = _("Ms.") +ruler_country_title = _("%s of the %s") helptext = _("\ Anarchy is simply the absence of any recognizable government.\ @@ -212,6 +213,7 @@ ruler_male_title = _("Emperor") ruler_female_title = _("Empress") +ruler_country_title = _("%s of the %s") helptext = _("\ Under Despotism, you are the absolute ruler of your people. Your\ @@ -281,6 +283,7 @@ ruler_male_title = _("King") ruler_female_title = _("Queen") +ruler_country_title = _("%s of the %s") helptext = _("\ Under Monarchy, a king or queen serves as a hereditary figurehead\ @@ -349,6 +352,7 @@ ruler_male_title = _("Comrade") ruler_female_title = _("Comrade") +ruler_country_title = _("%s of the %s") helptext = _("\ A Communist government is based on the ideal that all people are\ @@ -424,6 +428,7 @@ ruler_male_title = _("Consul") ruler_female_title = _("Consul") +ruler_country_title = _("%s of the %s") helptext = _("\ Under a Republican government, citizens hold an election to select a\ @@ -503,6 +508,7 @@ ruler_male_title = _("President") ruler_female_title = _("President") +ruler_country_title = _("%s of the %s") helptext = _("\ Under Democracy, citizens govern directly by voting on issues.\ Index: data/default/nations.ruleset =================================================================== RCS file: /home/freeciv/CVS/freeciv/data/default/nations.ruleset,v retrieving revision 1.21 diff -u -r1.21 nations.ruleset --- nations.ruleset 2000/01/25 16:03:05 1.21 +++ nations.ruleset 2000/01/25 20:26:45 @@ -57,9 +57,9 @@ flag_alt = "-" city_style = "Classical" -ruler_titles = { "government", "male_title", "female_title" - "Despotism", _("Dictator"), _("Dictator") - "Monarchy", _("Imperator"), _("Imperatrix") +ruler_titles = { "government", "male_title", "female_title", "country_title" + "Despotism", _("Dictator"), _("Dictator"), _("Roman Empire") + "Monarchy", _("Imperator"), _("Imperatrix"), _("Roman Empire") } attack=1 @@ -128,9 +128,10 @@ flag="f.germany" flag_alt = "-" city_style = "European" -ruler_titles = { "government", "male_title", "female_title" - "Democracy", _("Chancellor"), _("Chancellor") - "Fundamentalism", _("Archbishop"), _("Archbishop") +ruler_titles = { "government", "male_title", "female_title", "country_title" + "Communism", "-", "-", _("German Democratic Republic") + "Democracy", _("Chancellor"), _("Chancellor"), _("Federal Republic of Germany") + "Fundamentalism", _("Archbishop"), _("Archbishop"), "-" } attack=2 @@ -204,9 +205,10 @@ flag="f.usa" flag_alt = "-" city_style = "European" -ruler_titles = { "government", "male_title", "female_title" - "Republic", _("Speaker"), _("Speaker") - "Fundamentalism", _("Reverend"), _("Reverend") +ruler_titles = { "government", "male_title", "female_title", "country_title" + "Republic", _("Speaker"), _("Speaker"), _("United Colonies of New England") + "Fundamentalism", _("Reverend"), _("Reverend"), "-" + "Democracy", "-", "-", _("United States of America") } attack=0 @@ -313,9 +315,11 @@ flag_alt = "-" city_style = "European" -ruler_titles = { "government", "male_title", "female_title", - "Monarchy", _("Czar"), _("Czarina") - "Fundamentalism", _("Patriarch"), _("Matriarch") +ruler_titles = { "government", "male_title", "female_title", "country_title" + "Monarchy", _("Czar"), _("Czarina"), _("Russian Empire") + "Communism", "-", "-", _("Russian Soviet Federative Socialist Republic") + "Fundamentalism", _("Patriarch"), _("Matriarch"), "-" + "Democracy", "-", "-", _("Russian Federation") } attack=2 @@ -435,8 +439,9 @@ flag="f.china" flag_alt = "-" city_style = "Classical" -ruler_titles = { "government", "male_title", "female_title" - "Communism", _("Chairman"), _("Chairperson") +ruler_titles = { "government", "male_title", "female_title", "country_title" + "Communism", _("Chairman"), _("Chairperson"), "People's Republic of China" + "Democracy", "-", "-", "Republic of China" } attack=1 @@ -478,6 +483,7 @@ flag_alt = "f.united_kingdom" city_style = "European" ruler_titles = { "government", "male_title", "female_title" + "Democracy", _("King"), _("King") "Democracy", _("Prime Minister"), _("Prime Minister") "Fundamentalism", _("Lord Protector"), _("Lady Protector") } Index: server/plrhand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v retrieving revision 1.112 diff -u -r1.112 plrhand.c --- plrhand.c 2000/01/19 16:33:25 1.112 +++ plrhand.c 2000/01/25 20:26:45 @@ -843,7 +843,8 @@ return; } - my_snprintf (civbuf, sizeof(civbuf), _("The %s of the %s"), + my_snprintf (civbuf, sizeof(civbuf), get_country_name(pplayer->government, + pplayer->nation), get_government_name (pplayer->government), get_nation_name_plural (pplayer->nation)); Index: server/ruleset.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/ruleset.c,v retrieving revision 1.48 diff -u -r1.48 ruleset.c --- ruleset.c 2000/01/02 11:32:16 1.48 +++ ruleset.c 2000/01/25 20:26:45 @@ -1185,6 +1185,9 @@ secfile_lookup_str(&file, "%s.ruler_male_title", sec[i])); sz_strlcpy(title->female_title, secfile_lookup_str(&file, "%s.ruler_female_title", sec[i])); + sz_strlcpy(title->country_title, + secfile_lookup_str(&file, "%s.ruler_country_title", sec[i])); + } /* subgoals: */ @@ -1323,7 +1326,8 @@ struct nation_type *pl; struct government *gov; int *res, dim, val, i, j; - char temp_name[MAX_LEN_NAME], male[MAX_LEN_NAME], female[MAX_LEN_NAME]; + char temp_name[MAX_LEN_NAME], male[MAX_LEN_NAME], female[MAX_LEN_NAME], + country[MAX_LEN_NAME]; char **cities, **techs, **leaders, **sec; filename = openload_ruleset_file(&file, ruleset_subdir, "nations"); @@ -1412,8 +1416,11 @@ sz_strlcpy(female, secfile_lookup_str(&file, "%s.ruler_titles%d.female_title", sec[i], j)); + sz_strlcpy(country, secfile_lookup_str_default(&file, "", + "%s.ruler_titles%d.country_title", + sec[i], j)); if( (gov = find_government_by_name(g)) != NULL ) { - set_ruler_title(gov, i, male, female); + set_ruler_title(gov, i, male, female, country); } else { freelog(LOG_VERBOSE,"Nation %s, government %s not found", pl->name, g); @@ -1851,6 +1858,7 @@ title.nation = p_title->nation; sz_strlcpy(title.male_title, p_title->male_title); sz_strlcpy(title.female_title, p_title->female_title); + sz_strlcpy(title.country_title, p_title->country_title); for(to=0; to