Re: [Freeciv-Dev] (PR#40059) BUG: i18n: Publishing year on historian reports

2008-01-29 Thread William Allen Simpson

http://bugs.freeciv.org/Ticket/Display.html?id=40059 >

Based on discussion on the -i18n list, it seems that removing the
possessive names is highly desirable.  And, that swapping the fields is
common.  Also, there's a list of sentence fragments immediately following
the header.  Changed to allow translators more flexibility.

Committed S2_2 revision 14346.
Committed trunk revision 14347.

Index: server/report.c
===
--- server/report.c (revision 14346)
+++ server/report.c (working copy)
@@ -53,22 +53,35 @@
 #define HISTORIAN_LAST HISTORIAN_LARGEST
 
 static const char *historian_message[]={
-N_("%s report on the RICHEST Civilizations in the World %s."),
-N_("%s report on the most ADVANCED Civilizations in the World %s."),
-N_("%s report on the most MILITARIZED Civilizations in the World %s."),
-N_("%s report on the HAPPIEST Civilizations in the World %s."),
-N_("%s report on the LARGEST Civilizations in the World %s.")
+/* TRANS: year  reports ... */
+N_("%s %s reports on the RICHEST Civilizations in the World."),
+/* TRANS: year  reports ... */
+N_("%s %s reports on the most ADVANCED Civilizations in the World."),
+/* TRANS: year  reports ... */
+N_("%s %s reports on the most MILITARIZED Civilizations in the World."),
+/* TRANS: year  reports ... */
+N_("%s %s reports on the HAPPIEST Civilizations in the World."),
+/* TRANS: year  reports ... */
+N_("%s %s reports on the LARGEST Civilizations in the World.")
 };
 
 static const char *historian_name[]={
-N_("Herodotus'"),
-N_("Thucydides'"),
-N_("Pliny the Elder's"),
-N_("Livy's"),
-N_("Toynbee's"),
-N_("Gibbon's"),
-N_("Ssu-ma Ch'ien's"),
-N_("Pan Ku's")
+/* TRANS: [year]  [reports ...] */
+N_("Herodotus"),
+/* TRANS: [year]  [reports ...] */
+N_("Thucydides"),
+/* TRANS: [year]  [reports ...] */
+N_("Pliny the Elder"),
+/* TRANS: [year]  [reports ...] */
+N_("Livy"),
+/* TRANS: [year]  [reports ...] */
+N_("Toynbee"),
+/* TRANS: [year]  [reports ...] */
+N_("Gibbon"),
+/* TRANS: [year]  [reports ...] */
+N_("Ssu-ma Ch'ien"),
+/* TRANS: [year]  [reports ...] */
+N_("Pan Ku")
 };
 
 static const char scorelog_magic[] = "#FREECIV SCORELOG2 ";
@@ -145,13 +158,25 @@
  ((const struct player_score_entry *)a)->value);
 }
 
-static const char *greatness[MAX_NUM_PLAYERS] = {
-  N_("Magnificent"),  N_("Glorious"), N_("Great"), N_("Decent"),
-  N_("Mediocre"), N_("Hilarious"), N_("Worthless"), N_("Pathetic"),
-  N_("Useless"), "Useless", "Useless", "Useless", "Useless", "Useless",
-  "Useless", "Useless", "Useless", "Useless", "Useless", "Useless",
-  "Useless", "Useless", "Useless", "Useless", "Useless", "Useless",
-  "Useless", "Useless", "Useless", "Useless"
+static const char *greatness[] = {
+  /* TRANS: <1>: The  Poles */
+  N_("%2d: The Magnificent %s"),
+  /* TRANS: <2>: The  Poles */
+  N_("%2d: The Great %s"),
+  /* TRANS: <3>: The  Poles */
+  N_("%2d: The Glorious %s"),
+  /* TRANS: <4>: The  Poles */
+  N_("%2d: The Excellent %s"),
+  /* TRANS: <5>: The  Poles */
+  N_("%2d: The Average %s"),
+  /* TRANS: <6>: The  Poles */
+  N_("%2d: The Mediocre %s"),
+  /* TRANS: <7>: The  Poles */
+  N_("%2d: The Pathetic %s"),
+  /* TRANS: <8>: The  Poles */
+  N_("%2d: The Useless %s"),
+  /* TRANS: <9>: The  Poles */
+  N_("%2d: The Worthless %s"),
 };
 
 /**
@@ -195,17 +220,23 @@
   buffer[0] = '\0';
   for (i = 0; i < j; i++) {
 if (i == 0 || size[i].value < size[i - 1].value) {
-  rank = i;
+  if (i >= sizeof(greatness)) {
+rank = sizeof(greatness) - 1;
+  } else if (j >= sizeof(greatness)) {
+rank = i;
+  } else {
+rank = (i * sizeof(greatness)) / j;
+  }
 }
 cat_snprintf(buffer, sizeof(buffer),
-_("%2d: The %s %s\n"),
+_(greatness[rank]),
 rank + 1,
-_(greatness[rank]),
 nation_plural_for_player(size[i].player));
+mystrlcat(buffer, "\n", sizeof(buffer));
   }
   my_snprintf(title, sizeof(title), _(historian_message[which_news]),
-  _(historian_name[myrand(ARRAY_SIZE(historian_name))]),
-  textyear(game.info.year));
+  textyear(game.info.year),
+  _(historian_name[myrand(ARRAY_SIZE(historian_name))]));
   page_conn_etype(game.est_connections, _("Historian Publishes!"),
  title, buffer, E_BROADCAST_REPORT);
 }
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#40059) BUG: i18n: Publishing year on historian reports

2008-01-28 Thread William Allen Simpson

http://bugs.freeciv.org/Ticket/Display.html?id=40059 >

PR#34192 added a trailing year.  Not only does that make no sense as English
grammar, the patch didn't update all (any) of the translations, and thus
creates a msgstr error report.

The existing reports use a possessive for the names of the historians.  They
are listed to be translated, so a really good translator can probably handle
the pairing of the messages nearby the historian names.  But a TRANS comment
would certainly be useful.

Absent any discussion, here's my proposed patch:



Index: server/report.c
===
--- server/report.c (revision 14336)
+++ server/report.c (working copy)
@@ -53,21 +53,34 @@
 #define HISTORIAN_LAST HISTORIAN_LARGEST
 
 static const char *historian_message[]={
-N_("%s report on the RICHEST Civilizations in the World %s."),
-N_("%s report on the most ADVANCED Civilizations in the World %s."),
-N_("%s report on the most MILITARIZED Civilizations in the World %s."),
-N_("%s report on the HAPPIEST Civilizations in the World %s."),
-N_("%s report on the LARGEST Civilizations in the World %s.")
+/* TRANS:   report ... */
+N_("%s %s report on the RICHEST Civilizations in the World."),
+/* TRANS:   report ... */
+N_("%s %s report on the most ADVANCED Civilizations in the World."),
+/* TRANS:   report ... */
+N_("%s %s report on the most MILITARIZED Civilizations in the World."),
+/* TRANS:   report ... */
+N_("%s %s report on the HAPPIEST Civilizations in the World."),
+/* TRANS:   report ... */
+N_("%s %s report on the LARGEST Civilizations in the World.")
 };
 
 static const char *historian_name[]={
+/* TRANS:  [year report ...] */
 N_("Herodotus'"),
+/* TRANS:  [year report ...] */
 N_("Thucydides'"),
+/* TRANS:  [year report ...] */
 N_("Pliny the Elder's"),
+/* TRANS:  [year report ...] */
 N_("Livy's"),
+/* TRANS:  [year report ...] */
 N_("Toynbee's"),
+/* TRANS:  [year report ...] */
 N_("Gibbon's"),
+/* TRANS:  [year report ...] */
 N_("Ssu-ma Ch'ien's"),
+/* TRANS:  [year report ...] */
 N_("Pan Ku's")
 };
 
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev