<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40689 >

As reported on freeciv-i18n by Sini Ruohomaa, the attached
patches fix two instances of "%s of the %s" ("<government>
of the <nation plural>") contruct in translated strings.

The strings are replaced by "?nationgovernment:%s %s"
(i.e. "<nation adjective> <government>").


-----------------------------------------------------------------------
英語の文法はめちゃくちゃじゃないか。
 client/text.c   |   18 ++++++++++--------
 server/report.c |   10 ++++++----
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/client/text.c b/client/text.c
index e2c2b71..81c52ca 100644
--- a/client/text.c
+++ b/client/text.c
@@ -1165,21 +1165,23 @@ const char *get_score_text(const struct player *pplayer)
 const char *get_report_title(const char *report_name)
 {
   static struct astring str = ASTRING_INIT;
+  const struct player *pplayer = client.conn.playing;
 
   astr_clear(&str);
 
   astr_add_line(&str, "%s", report_name);
 
-  if (NULL != client.conn.playing) {
-    /* TRANS: "Republic of the Poles" */
-    astr_add_line(&str, _("%s of the %s"),
-		  government_name_for_player(client.conn.playing),
-		  nation_plural_for_player(client.conn.playing));
+  if (pplayer != NULL) {
+    /* TRANS: <nation adjective> <government name>.
+     * E.g. "Polish Republic". */
+    astr_add_line(&str, _("?nationgovernment:%s %s"),
+                  nation_adjective_for_player(pplayer),
+                  government_name_for_player(pplayer));
 
     astr_add_line(&str, "%s %s: %s",
-		  ruler_title_translation(client.conn.playing),
-		  player_name(client.conn.playing),
-		  textyear(game.info.year));
+                  ruler_title_translation(pplayer),
+                  player_name(pplayer),
+                  textyear(game.info.year));
   } else {
     /* TRANS: "Observer: 1985" */
     astr_add_line(&str, _("Observer: %s"),
diff --git a/server/report.c b/server/report.c
index 52cbe04..f650d93 100644
--- a/server/report.c
+++ b/server/report.c
@@ -791,10 +791,12 @@ void report_demographics(struct connection *pconn)
     return;
   }
 
-  my_snprintf(civbuf, sizeof(civbuf), _("The %s of the %s (%s)"),
-	      government_name_for_player(pplayer),
-	      nation_plural_for_player(pplayer),
-	      textyear(game.info.year));
+  /* TRANS: <nation adjective> <government name> (<year>).
+   * E.g. "Polish Despotism (200 AD)". */
+  my_snprintf(civbuf, sizeof(civbuf), _("%s %s (%s)"),
+              nation_adjective_for_player(pplayer),
+              government_name_for_player(pplayer),
+              textyear(game.info.year));
 
   buffer[0] = '\0';
   for (i = 0; i < ARRAY_SIZE(rowtable); i++) {
 client/text.c   |   18 ++++++++++--------
 server/report.c |   10 ++++++----
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/client/text.c b/client/text.c
index 9295f14..a1d9a2e 100644
--- a/client/text.c
+++ b/client/text.c
@@ -1117,21 +1117,23 @@ const char *get_score_text(const struct player *pplayer)
 const char *get_report_title(const char *report_name)
 {
   static struct astring str = ASTRING_INIT;
+  const struct player *pplayer = game.player_ptr;
 
   astr_clear(&str);
 
   astr_add_line(&str, "%s", report_name);
 
-  if (game.player_ptr) {
-    /* TRANS: "Republic of the Poles" */
-    astr_add_line(&str, _("%s of the %s"),
-		  government_name_for_player(game.player_ptr),
-		  nation_plural_for_player(game.player_ptr));
+  if (pplayer != NULL) {
+    /* TRANS: <nation adjective> <government name>.
+     * E.g. "Polish Republic". */
+    astr_add_line(&str, _("?nationgovernment:%s %s"),
+                  nation_adjective_for_player(pplayer),
+                  government_name_for_player(pplayer));
 
     astr_add_line(&str, "%s %s: %s",
-		  ruler_title_translation(game.player_ptr),
-		  player_name(game.player_ptr),
-		  textyear(game.info.year));
+                  ruler_title_translation(pplayer),
+                  player_name(pplayer),
+                  textyear(game.info.year));
   } else {
     /* TRANS: "Observer: 1985" */
     astr_add_line(&str, _("Observer: %s"),
diff --git a/server/report.c b/server/report.c
index 7bb265e..ef64d6e 100644
--- a/server/report.c
+++ b/server/report.c
@@ -745,10 +745,12 @@ void report_demographics(struct connection *pconn)
     return;
   }
 
-  my_snprintf(civbuf, sizeof(civbuf), _("The %s of the %s (%s)"),
-	      government_name_for_player(pplayer),
-	      nation_plural_for_player(pplayer),
-	      textyear(game.info.year));
+  /* TRANS: <nation adjective> <government name> (<year>).
+   * E.g. "Polish Despotism (200 AD)". */
+  my_snprintf(civbuf, sizeof(civbuf), _("%s %s (%s)"),
+              nation_adjective_for_player(pplayer),
+              government_name_for_player(pplayer),
+              textyear(game.info.year));
 
   buffer[0] = '\0';
   for (i = 0; i < ARRAY_SIZE(rowtable); i++) {
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to