Re: [Freeciv-Dev] (PR#40032) server/plrhand.c civil war message plural

2008-01-27 Thread William Allen Simpson

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

Probably should attach the patch as applied to trunk for posterity!
(Also in 2.2, an update-po and vigorous line-by-line po massaging.)

Index: server/citytools.c
===
--- server/citytools.c  (revision 14336)
+++ server/citytools.c  (working copy)
@@ -730,7 +730,6 @@
 Create a palace in a random city. Used when the capital was conquered.
 **/
 static void build_free_small_wonders(struct player *pplayer,
-const char *const old_capital_name,
 bv_imprs *had_small_wonders)
 {
   int size = city_list_size(pplayer->cities);
@@ -742,12 +741,11 @@
 
   improvement_iterate(pimprove) {
 if (BV_ISSET(*had_small_wonders, improvement_index(pimprove))) {
-  struct city *pnew_city;
+  /* FIXME: instead, find central city */
+  struct city *pnew_city = city_list_get(pplayer->cities, myrand(size));
 
   assert(find_city_from_small_wonder(pplayer, pimprove) == NULL);
 
-  pnew_city = city_list_get(pplayer->cities, myrand(size));
-
   city_add_improvement(pnew_city, pimprove);
   pplayer->small_wonders[improvement_index(pimprove)] = pnew_city->id;
 
@@ -757,9 +755,10 @@
*/
   send_player_cities(pplayer);
 
-  notify_player(pplayer, pnew_city->tile, E_CITY_LOST,
-   _("You lost %s. A new %s was built in %s."),
-   old_capital_name,
+  notify_player(pplayer, pnew_city->tile, E_IMP_BUILD,
+   /* FIXME: should already be notified about city loss? */
+   /* TRANS:  ...  */
+   _("A replacement %s was built in %s."),
improvement_name_translation(pimprove),
city_name(pnew_city));
   /* 
@@ -938,7 +937,7 @@
   /* Build a new palace for free if the player lost her capital and
  savepalace is on. */
   if (game.info.savepalace) {
-build_free_small_wonders(pgiver, city_name(pcity), &had_small_wonders);
+build_free_small_wonders(pgiver, &had_small_wonders);
   }
 
   /* Remove the sight points from the giver...and refresh the city's
@@ -1096,7 +1095,6 @@
   struct player *pplayer = city_owner(pcity);
   struct tile *ptile = pcity->tile;
   bv_imprs had_small_wonders;
-  char *cityname = mystrdup(city_name(pcity));
   struct vision *old_vision;
   int id = pcity->id; /* We need this even after memory has been freed */
 
@@ -1214,11 +1212,9 @@
   /* Build a new palace for free if the player lost her capital and
  savepalace is on. */
   if (game.info.savepalace) {
-build_free_small_wonders(pplayer, cityname, &had_small_wonders);
+build_free_small_wonders(pplayer, &had_small_wonders);
   }
 
-  free(cityname);
-
   sync_cities();
 }
 
Index: server/plrhand.c
===
--- server/plrhand.c(revision 14336)
+++ server/plrhand.c(working copy)
@@ -1666,8 +1666,9 @@
 
   if (player_count() >= MAX_NUM_PLAYERS) {
 /* No space to make additional player */
-freelog(LOG_NORMAL, _("Could not throw %s into civil war - too many "
-"players"), player_name(pplayer));
+freelog(LOG_NORMAL,
+_("Could not throw %s into civil war - too many players"),
+nation_plural_for_player(pplayer));
 return;
   }
 
@@ -1682,14 +1683,18 @@
   /* Now split the empire */
 
   freelog(LOG_VERBOSE,
- "%s nation is thrust into civil war, created AI player %s",
+ "%s civil war; created AI %s",
  nation_rule_name(nation_of_player(pplayer)),
- player_name(cplayer));
+ nation_rule_name(nation_of_player(cplayer)));
   notify_player(pplayer, NULL, E_CIVIL_WAR,
-  _("Your nation is thrust into civil war, "
-" %s is declared the leader of the rebel states."),
-  player_name(cplayer));
+_("Your nation is thrust into civil war."));
 
+  notify_player(pplayer, NULL, E_FIRST_CONTACT,
+/* TRANS:  ... the Poles. */
+_("%s is the rebellious leader of the %s."),
+player_name(cplayer),
+nation_plural_for_player(cplayer));
+
   i = city_list_size(pplayer->cities)/2;   /* number to flip */
   j = city_list_size(pplayer->cities); /* number left to process */
   city_list_iterate(pplayer->cities, pcity) {
@@ -1703,35 +1708,35 @@
 resolved stack conflicts for each city we would teleport the first
 of the units we met since the other would have another owner */
transfer_city(cplayer, pcity, -1, FALSE, FALSE, FALSE);
-   freelog(LOG_VERBOSE, "%s declares allegiance to %s",
+   freelog(LOG_VERBOSE, "%s declares allegiance to the %s.",
city_name(pcity),
-   player_name(cplayer));
+   natio

[Freeciv-Dev] (PR#40032) server/plrhand.c civil war message plural

2008-01-27 Thread William Allen Simpson

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

Committed as part of trunk revision 14337.
Committed as part of S2_2 revision 14338.


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40032) server/plrhand.c civil war message plural

2008-01-25 Thread William Allen Simpson

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

Christian Knoke wrote:
> Egor Vyscrebentsov wrote on Jan 25, 05:37 (-0800):
>> On Fri, 25 Jan 2008 William Allen Simpson wrote:
> 
 ru_RU specific:
 Gender problem can be avoided by usage nation_plural at the first place.
>>> After all the recent work to add adjectives, you want to eliminate them?
>> Just take into account that you can't get right translation with adjs
>> for several language using gettext...
> 
> I can confirm that this is also a prob in german with the latest changes.
> I'm not sure how to adress it.
> 
I've started a discussion over on -i18n, and hopefully we'll get more
feedback.  There are currently:

   119 occurrences of nation_adjective_* in 45 files.
91 occurrences of nation_plural_* in 21 files.

So, it would be a *lot* of work to make the changes from adjective to
plural, and I'm not sure that it would even be possible

City names aren't translated, so I'm at a loss as to how we'd standardize.
In this report, let's concentrate on this set of messages, and see what we
can learn to extrapolate to all messages.

This is the best time (preparing a new beta) to address the whole issue.
Let's discuss with the rest of the -i18n community.



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40032) server/plrhand.c civil war message plural

2008-01-25 Thread Christian Knoke
Egor Vyscrebentsov wrote on Jan 25, 05:37 (-0800):
> On Fri, 25 Jan 2008 William Allen Simpson wrote:

> > > ru_RU specific:
> > > Gender problem can be avoided by usage nation_plural at the first place.
> >
> > After all the recent work to add adjectives, you want to eliminate them?
> 
> Just take into account that you can't get right translation with adjs
> for several language using gettext...

I can confirm that this is also a prob in german with the latest changes.
I'm not sure how to adress it.

Christian

-- 
Christian Knoke* * *http://cknoke.de
* * * * * * * * *  Ceterum censeo Microsoft esse dividendum.

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40032) server/plrhand.c civil war message plural

2008-01-25 Thread Egor Vyscrebentsov

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

On Fri, 25 Jan 2008 William Allen Simpson wrote:

> Egor Vyscrebentsov wrote:
> > 1. FR: nation_ajective_plural_for_player() function.
>
> That's very unlikely.  We'd end up with n**2 translations.

See below.
 
> > 2. "of the %s" will force us to enter cases problem...
> 
> > "to the %s" cause to enter cases problem...
> > 
> What is a "cases problem"?

Some more quoting has an answer^Wexample:
> > (cmp. "Польские" and "Польским".)

Every ajective has 4 (3 genders + 1 plural) * 6 (cases) = 24 forms in russian.
(Several of them may have intersection.)
F.e.
"Polish %s" - "Польский (male)/Польская (female)/Польское (neutral [or 
middle])/Польские (plural) %s"
"to the Polish %s" - "Польскому/Польской/Польскому/Польским %s"
"from the Polish %s" - "От Польского/Польской/Польского/Польских %s"
etc.

Every noun has 6 forms. (+ 6 for plural.)

See also http://lists.complete.org/[EMAIL PROTECTED]/2003/09/msg00015.html.gz
and follow-ups

> > ru_RU specific:
> > Gender problem can be avoided by usage nation_plural at the first place.
>
> After all the recent work to add adjectives, you want to eliminate them?

Just take into account that you can't get right translation with adjs
for several language using gettext...

> > Other way is to _always and everywhere_ use only one gender.
>
> English has no genders, so technically we *are* using only one gender.  Any
> genders are specific to your translation.

Yes, it was about .po file.

> > (BTW, for all the time in ru.po nation.name == nation.plural. I don't
> > know if i could change this painlessly - reason is cases.)
> > 
> If you've made all the adjectives == plural, maybe that's the problem.

Just take into account that you can't get right translation with adjs
for several language using gettext...

-- 
Thanks, evyscr



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40032) server/plrhand.c civil war message plural

2008-01-25 Thread William Allen Simpson

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

Egor Vyscrebentsov wrote:
> 1. FR: nation_ajective_plural_for_player() function.

That's very unlikely.  We'd end up with n**2 translations.


> 2. "of the %s" will force us to enter cases problem...

> "to the %s" cause to enter cases problem...
> 
What is a "cases problem"?


> ru_RU specific:
> Gender problem can be avoided by usage nation_plural at the first place.

After all the recent work to add adjectives, you want to eliminate them?

> Other way is to _always and everywhere_ use only one gender.

English has no genders, so technically we *are* using only one gender.  Any
genders are specific to your translation.


> (BTW, for all the time in ru.po nation.name == nation.plural. I don't
> know if i could change this painlessly - reason is cases.)
> 
If you've made all the adjectives == plural, maybe that's the problem.

Daniel, you did the adjective thing.  I only learned of it a few weeks ago,
because nobody had done any code support for it.  What's the rationale?



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40032) server/plrhand.c civil war message plural

2008-01-24 Thread Egor Vyscrebentsov

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

On Thu, 24 Jan 2008 William Allen Simpson wrote:

> Now, are these adjectives and plurals good for everybody?
>
> Or do we need a different word order?
>
> Or no adjectives at all?
>
> (Note that I kept the parameter order exactly the same, to avoid problems
> with slower translators.)
>
> ===
>
>notify_player(pplayer, NULL, E_CIVIL_WAR,
>  _("Your nation is thrust into civil war."));
> 
>notify_player(pplayer, NULL, E_FIRST_CONTACT,
>  /* TRANS:  ... the Polish rebels. */
>  _("%s is the leader of the %s rebels."),
>  player_name(cplayer),
>  nation_adjective_for_player(cplayer));

1. FR: nation_ajective_plural_for_player() function.
2. "of the %s" will force us to enter cases problem...
(cmp. "Польские" and "Польским".) [Well, first is "Польский" (non-pl.)]
However, this never stoped us before.

>   notify_player(pplayer, pcity->tile, E_CITY_LOST,
>/* TRANS:  ... the Poles. */
>_("%s declares allegiance to the %s."),
>city_name(pcity),
>nation_plural_for_player(cplayer));

"to the %s" cause to enter cases problem... (сmp. "Поляки" and "Полякам".)

>notify_player(NULL, NULL, E_CIVIL_WAR,
>   /* TRANS: The Danish ... Poles ... <7> cities. */
>   PL_("The %s nation partitions after civil war."
>   " Insurgent %s now hold %d city.",
>   "The %s nation partitions after civil war."
>   " Insurgent %s now hold %d cities.",
>   i),
>   nation_adjective_for_player(pplayer),
>   nation_plural_for_player(cplayer),
>   i);

ru_RU specific:
Gender problem can be avoided by usage nation_plural at the first place.
Other way is to _always and everywhere_ use only one gender.
(BTW, for all the time in ru.po nation.name == nation.plural. I don't
know if i could change this painlessly - reason is cases.)

All of things above can be considered as a specific case.

-- 
Thanks, evyscr



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40032) server/plrhand.c civil war message plural

2008-01-24 Thread William Allen Simpson

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

Christian Knoke wrote:
> Yes! This is essential information to be given.
> 
After looking at the notification a bit, it seems the former message should
be split (two events).  But, the latter has to stay together.  I shortened
it drastically.

Now, are these adjectives and plurals good for everybody?

Or do we need a different word order?

Or no adjectives at all?

(Note that I kept the parameter order exactly the same, to avoid problems
with slower translators.)

===

   notify_player(pplayer, NULL, E_CIVIL_WAR,
 _("Your nation is thrust into civil war."));

   notify_player(pplayer, NULL, E_FIRST_CONTACT,
 /* TRANS:  ... the Polish rebels. */
 _("%s is the leader of the %s rebels."),
 player_name(cplayer),
 nation_adjective_for_player(cplayer));


notify_player(pplayer, pcity->tile, E_CITY_LOST,
   /* TRANS:  ... the Poles. */
   _("%s declares allegiance to the %s."),
   city_name(pcity),
   nation_plural_for_player(cplayer));


   notify_player(NULL, NULL, E_CIVIL_WAR,
/* TRANS: The Danish ... Poles ... <7> cities. */
PL_("The %s nation partitions after civil war."
" Insurgent %s now hold %d city.",
"The %s nation partitions after civil war."
" Insurgent %s now hold %d cities.",
i),
nation_adjective_for_player(pplayer),
nation_plural_for_player(cplayer),
i);



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40032) server/plrhand.c civil war message plural

2008-01-24 Thread Christian Knoke
Egor Vyscrebentsov wrote on Jan 23, 23:47 (-0800):
> On Wed, 23 Jan 2008 William Allen Simpson wrote:

> > Aren't we supposed to use the leader name together with the nation name?
> 
> It should be done. Also, I think we want to use nation name as a basis
> for all diplomatic things, aren't we?
> 
> > We tell everybody else how many cities, but not the player losing them?
> 
> Oops. Sure, there is only logging, not notify... Wrong thing, to my mind.

Yes! This is essential information to be given.

Christian

-- 
Christian Knoke* * *http://cknoke.de
* * * * * * * * *  Ceterum censeo Microsoft esse dividendum.

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40032) server/plrhand.c civil war message plural

2008-01-24 Thread Egor Vyscrebentsov

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

On Wed, 23 Jan 2008 William Allen Simpson wrote:

[skip/]
> Why the line breaks?  How does the server know the best width?  Or the
> translators know for all clients in advance?

As I said early, freeciv is still NOT utf-8 application, so breaking
lines in f.e. server console is more worse than it looks in the code.
(For ru_RU.UTF-8 part of lines cover only half of screen width -
2 bytes/character. Easiest example - '/help' [show_help_intro].
wordwrap_string() looks to me like the root of problem in this case.)
All the data stored in UTF-8 inside, right? But we still use char,
strlen() etc.

> Aren't we supposed to use the leader name together with the nation name?

It should be done. Also, I think we want to use nation name as a basis
for all diplomatic things, aren't we?

> We tell everybody else how many cities, but not the player losing them?

Oops. Sure, there is only logging, not notify... Wrong thing, to my mind.

> I'd like to split this into at least two messages.

Sure.

PS. I'm also for splitting into several messages a keyboard/mouse orders
helptext from data/helptext.txt. It will a) make it much easier for
translator to see changes; b) be a step towards user-defined control.
But this is another story.

-- 
Thanks, evyscr



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40032) server/plrhand.c civil war message plural

2008-01-23 Thread William Allen Simpson

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

This whole "narrative" is a problem.  I fixed the possessive grammar last
release, but the messages themselves are questionable.

   notify_player(pplayer, NULL, E_CIVIL_WAR,
   _("Your nation is thrust into civil war, "
 " %s is declared the leader of the rebel states."),
   player_name(cplayer));

...

   notify_player(NULL, NULL, E_CIVIL_WAR,
_("Capture of the %s capital and destruction "
  "of the empire's administrative\n"
  "  structures have sparked a civil war.  "
  "Opportunists have flocked to the rebel cause,\n"
  "  and the upstart %s now holds power in %d "
  "rebel provinces."),
nation_adjective_for_player(pplayer),
player_name(cplayer),
city_list_size(cplayer->cities));

Why the line breaks?  How does the server know the best width?  Or the
translators know for all clients in advance?

Aren't we supposed to use the leader name together with the nation name?

We tell everybody else how many cities, but not the player losing them?

I'd like to split this into at least two messages.



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev