Re: [Freeciv-Dev] (PR#39385) RFE: Buy column on Cities report

2007-06-12 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39385 

Per I. Mathisen wrote:
 The question is, does it change translations? If so, I'd say no. It is 
 frozen for new features and translation string changes now. We need to get 
 it out soon... :/
 
Soon, as in 15 months ago?  There are still many bug reports, some crashing.
We need to fix them and put out another beta.

The short answer is NO, a single menu item can be replaced by an existing
string (such as Production) for S2_1.  Thus, it meets the requirement
frozen for new ... translation string changes now.

I'll assume that I've met the requirement, and check it in without further
complaint.  It would help for those of you using trunk to actually test the
revised city report (F1).  I think you'll like it, and consider it a worthy
addition to S2_1!

The long answer is YES, I fixed many (about 135) translation strings.
These should not be frozen!

===

For example, in the first (cs.po) and many others:

  #: client/gui-sdl/citydlg.c:2603
  #, fuzzy, c-format
  msgid ?food:Surplus: %d
-msgstr ?Food surplus:J+
+msgstr ?food:Přebytek: %d

As you can plainly see, 18/27 files had dropped the %d, in various ways,
probably the most common problem.  This does not work properly (an active
translator would have noticed)!  How did this get missed?

My guess is that some kind of mechanical process confused the two colon,

  msgid ?food:Surplus: %d

with the single colon (and different capitalization) earlier in the file,

-msgid ?Food surplus:F+
-msgstr ?Food surplus:J+ 

As you can see, I added [short], among other changes to the format.  That
should help ensure translation consistency in the future:

+msgid ?Food surplus [short]:+F
+msgstr ?Food surplus [short]:+J

===

Another example (pt_BR.po),

  #: client/cityrepdata.c:441
  #, fuzzy
  msgid Workers: Happy
-msgstr Operários
+msgstr Operários: Feliz

#: client/cityrepdata.c:443
  #, fuzzy
  msgid Workers: Content
-msgstr Operários
+msgstr Operários: Contente

  #: client/cityrepdata.c:445
  #, fuzzy
  msgid Workers: Unhappy
-msgstr Operários
+msgstr Operários: Descontente

As you can plainly see, 3 menu items are all translated Workers without
the descriptor.  All you see is:

Operários
Operários
Operários

Not useful!  I was able to guess the descriptor from other strings.
(There's a lot of redundancy in the files.)

===

In fact, I did a lot of that kind of thing.  I started out working on my
own changes, and noticed a lot of problems in lines nearby.  I spent far
more time fixing other folk's errors than adding this Buy column.



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


Re: [Freeciv-Dev] (PR#39385) RFE: Buy column on Cities report

2007-06-12 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39385 

Committed S2_1 revision 12989.
Committed trunk revision 12990.

At this point, both should function exactly the same.  Except Russian.

I was surprised to discover that there were quite a few conflicts with S2_1,
because folks have been updating .po files there without fixing trunk, and
vice versa.

Therefore, I harmonized them both.  The trunk changes are attached.

Unfortunately, ru.po isn't even using the same character set.  Somebody who
can read the language will have to handle them.  (Sorry, my russian is
limited to phonetic singing after much rehearsal.)

Please note: I only harmonized the parts of .po files near city report.
There are a lot of other differences that translators should handle.
Presumably the persons that committed updates to only one branch!

Index: po/cs.po
===
--- po/cs.po(revision 12989)
+++ po/cs.po(working copy)
@@ -7726,8 +7726,8 @@
 msgstr Oslavuje/Klid/Nepokoj
 
 #: client/cityrepdata.c:435
-msgid Concise +=Rapture, -=Disorder
-msgstr Stručně +=Oslavuje, -=Nepokoj
+msgid Concise + Rapture, - Disorder
+msgstr Stručně + Oslavuje, - Nepokoj
 
 #: client/cityrepdata.c:437 client/gui-mui/citydlg.c:1365
 #: client/gui-xaw/citydlg.c:2408 data/default/units.ruleset:309
Index: po/pt_BR.po
===
--- po/pt_BR.po (revision 12989)
+++ po/pt_BR.po (working copy)
@@ -7205,7 +7205,7 @@
 
 #: client/cityrepdata.c:73
 msgid ?city_state:Rapture
-msgstr Celebração
+msgstr Celebração
 
 #: client/cityrepdata.c:74
 msgid ?city_state:Disorder
@@ -7217,10 +7217,9 @@
 
 #: client/cityrepdata.c:361
 msgid (worklist)
-msgstr 
+msgstr (lista de tarefas)
 
 #: client/cityrepdata.c:429
-#, fuzzy
 msgid ?city:Name
 msgstr Nome
 
@@ -7243,99 +7242,88 @@
 
 #: client/cityrepdata.c:433
 msgid Rapture/Peace/Disorder
-msgstr Celebração/Paz/Desordem
+msgstr Celebração/Paz/Desordem
 
 #: client/cityrepdata.c:435
-msgid Concise +=Rapture, -=Disorder
-msgstr Conciso +=Celebração, -=Desordem
+msgid Concise + Rapture, - Disorder
+msgstr Conciso + Celebração, - Desordem
 
 #: client/cityrepdata.c:437 client/gui-mui/citydlg.c:1365
 #: client/gui-xaw/citydlg.c:2408 data/default/units.ruleset:309
 msgid Workers
-msgstr Operários
+msgstr Operários
 
 #: client/cityrepdata.c:438
 msgid ?happy/content/unhappy/angry:H/C/U/A
-msgstr F/C/D/A
+msgstr F/C/D/Z
 
 #: client/cityrepdata.c:439
-#, fuzzy
 msgid Workers: Happy, Content, Unhappy, Angry
-msgstr Operários: Feliz, Contente, Descontente
+msgstr Operários: Feliz, Contente, Descontente, Zangado
 
 #: client/cityrepdata.c:441
 msgid ?Happy workers:H
 msgstr F
 
 #: client/cityrepdata.c:441
-#, fuzzy
 msgid Workers: Happy
-msgstr Operários: Feliz
+msgstr Operários: Feliz
 
 #: client/cityrepdata.c:443
 msgid ?Content workers:C
-msgstr 
+msgstr C
 
 #: client/cityrepdata.c:443
-#, fuzzy
 msgid Workers: Content
-msgstr Operários: Contente
+msgstr Operários: Contente
 
 #: client/cityrepdata.c:445
 msgid ?Unhappy workers:U
 msgstr D
 
 #: client/cityrepdata.c:445
-#, fuzzy
 msgid Workers: Unhappy
-msgstr Operários: Descontente
+msgstr Operários: Descontente
 
 #: client/cityrepdata.c:447
 msgid ?Angry workers:A
-msgstr 
+msgstr Z
 
 #: client/cityrepdata.c:447
-#, fuzzy
 msgid Workers: Angry
-msgstr Operários
+msgstr Operários: Zangado
 
 #: client/cityrepdata.c:449
 msgid Special
 msgstr Especial
 
 #: client/cityrepdata.c:450
-#, fuzzy
 msgid ?entertainers/scientists/taxmen:E/S/T
-msgstr ?Artistas, Cientistas, Fiscais:A/C/F
+msgstr A/C/F
 
 #: client/cityrepdata.c:451
 msgid Entertainers, Scientists, Taxmen
 msgstr Artistas, Cientistas, Fiscais
 
 #: client/cityrepdata.c:453 client/cityrepdata.c:455
-#, fuzzy
 msgid Best
-msgstr Servidor
+msgstr Melhor
 
 #: client/cityrepdata.c:453
-#, fuzzy
 msgid attack
-msgstr Ataque:
+msgstr ataque
 
 #: client/cityrepdata.c:454
-#, fuzzy
 msgid Best attacking units
-msgstr Atacar automaticamente contra unidades terrestres
+msgstr Unidades com melhor ataque
 
 #: client/cityrepdata.c:455
-#, fuzzy
 msgid defense
-msgstr Defesa:
+msgstr defesa
 
 #: client/cityrepdata.c:456
-#, fuzzy
 msgid Best defending units
-msgstr Dissolve unidade
+msgstr Unidades com melhor defesa
 
 #: client/cityrepdata.c:457 client/cityrepdata.c:459
 #: client/gui-gtk-2.0/cityrep.c:1208 client/gui-gtk-2.0/cityrep.c:1229
@@ -7349,28 +7337,24 @@
 #: client/gui-xaw/menu.c:219 client/gui-xaw/menu.c:246
 #: client/gui-xaw/repodlgs.c:890 client/gui-xaw/repodlgs.c:1085
 #: data/Freeciv.in:1895 data/helpdata.txt:866
-#, fuzzy
 msgid Units
-msgstr ?_Lista de:Unidades
+msgstr Unidades
 
 #: client/cityrepdata.c:457
-#, fuzzy
 msgid ?Supported (units):Owned
-msgstr suportadas
+msgstr Sup
 
 #: client/cityrepdata.c:458
 msgid Number of units supported
-msgstr Unidades suportadas
+msgstr Número de unidades suportadas
 
 #: client/cityrepdata.c:459
-#, fuzzy
 msgid 

Re: [Freeciv-Dev] (PR#39385) RFE: Buy column on Cities report

2007-06-11 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39385 

And now the debate:

   Could this be pulled up into 2.1 at this late date?

It was a more of a bug fix than a mere enhancement, and on that basis
alone, I'm in favor.

It is missing one new (rarely seen) menu translation.  How do I know it
would rarely be seen?  Items in the same menu in many translations were
missing or incomplete.  Repeated cases.  I fixed a bunch!  And there are
many that I could not fix

I'll count the original requester and the preliminary patcher -- with me,
that's 3.



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


Re: [Freeciv-Dev] (PR#39385) RFE: Buy column on Cities report

2007-06-08 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39385 

Ulrik Sverdrup wrote:
 I did this with the field width wrong as well, but I think we should
 reserve a width up to 5 for build costs. I can imagine wonders costing
 more than 1 if you buy them from scratch in the derfault ruleset.
 With mods or altered rulesets, it might be even more possible, so we
 should allow up to 5 digits.
 
OK.  Done.


 + { TRUE, 4, 1, NULL, N_(?gold:Buy), N_(Gold to purchase building),
 + NULL, FUNC_TAG(buy_cost) },
 
 In this change, shouldn't it be FALSE in the first field (for
 numerical values), And a better long text would be Cost to rush
 production (I think that is consistent with other wording around in
 freeciv, and building might associate to improvement which is wrong.
 
The first field is whether to show by default.  We want it to show --
it is the same Buy formerly shown in Currently Building.

After playing around a bit, I've combined the Turns and Buy into a
single column.  Two columns just takes too much screen real estate.
The sort always seems to have the buy cost roughly correspond to the
remaining turns.  How about:

?action:Building
Turns/Buy

Turns or gold to complete production

===

While playing around, I've implemented my wish list of changes.

It's always bugged me that the specialists occur at the far right, after
the buildings.  That turned out to be an artifact of the initialization.

And that the name of the city scrolls off to the left as I'm looking at
buildings.  So, I moved the city name into the middle.

All the happiness and growth (and units) are now to the left.

All the science, production, and trade are now to the right.

Comments?

Index: client/cityrepdata.c
===
--- client/cityrepdata.c(revision 12977)
+++ client/cityrepdata.c(working copy)
@@ -60,8 +60,8 @@
   const void *data)
 {
   static char buf[4];
-  my_snprintf(buf, sizeof(buf), %s, (city_celebrating(pcity) ? * :
-  (city_unhappy(pcity) ? X :  )));
+  my_snprintf(buf, sizeof(buf), %s, (city_celebrating(pcity) ? + :
+  (city_unhappy(pcity) ? - :  )));
   return buf;
 }
 
@@ -272,9 +272,8 @@
   static char buf[32];
   int goldie = pcity-surplus[O_GOLD];
 
-  my_snprintf(buf, sizeof(buf), %s%d/%d/%d,
- (goldie  0) ? - : (goldie  0) ? + : ,
- (goldie  0) ? (-goldie) : goldie,
+  my_snprintf(buf, sizeof(buf), %3d/%d/%d,
+ goldie,
  pcity-prod[O_LUXURY],
  pcity-prod[O_SCIENCE]);
   return buf;
@@ -311,28 +310,24 @@
   return buf;
 }
 
-static const char *cr_entry_food(const struct city *pcity,
-const void *data)
-{
-  static char buf[32];
-  my_snprintf(buf, sizeof(buf), %d/%d,
- pcity-food_stock,
- city_granary_size(pcity-size) );
-  return buf;
-}
-
 static const char *cr_entry_growturns(const struct city *pcity,
  const void *data)
 {
-  static char buf[8];
   int turns = city_turns_to_grow(pcity);
+  char buffer[8];
+  static char buf[32];
+
   if (turns == FC_INFINITY) {
 /* 'never' wouldn't be easily translatable here. */
-my_snprintf(buf, sizeof(buf), -);
+my_snprintf(buffer, sizeof(buffer), ---);
   } else {
 /* Shrinking cities get a negative value. */
-my_snprintf(buf, sizeof(buf), %4d, turns);
+my_snprintf(buffer, sizeof(buffer), %4d, turns);
   }
+  my_snprintf(buf, sizeof(buf), %s (%d/%d),
+ buffer,
+ pcity-food_stock,
+ city_granary_size(pcity-size) );
   return buf;
 }
 
@@ -362,21 +357,13 @@

   if (!pcity-production.is_unit
impr_flag(pcity-production.value, IF_GOLD)) {
-my_snprintf(buf, sizeof(buf), %s (%d/X/X/X)%s,
+my_snprintf(buf, sizeof(buf), %s (%d/X)%s,
get_impr_name_ex(pcity, pcity-production.value),
MAX(0, pcity-surplus[O_SHIELD]), from_worklist);
   } else {
-int turns = city_turns_to_build(pcity, pcity-production, TRUE);
-char time[32];
 const char *name;
 int cost;
 
-if (turns  999) {
-  my_snprintf(time, sizeof(time), %d, turns);
-} else {
-  my_snprintf(time, sizeof(time), -);
-}
-
 if(pcity-production.is_unit) {
   name = get_unit_type(pcity-production.value)-name;
   cost = unit_build_shield_cost(get_unit_type(pcity-production.value));
@@ -385,19 +372,42 @@
   cost = impr_build_shield_cost(pcity-production.value);
 }
 
-my_snprintf(buf, sizeof(buf), %s (%d/%d/%s/%d)%s, name,
-   pcity-shield_stock, cost, time, city_buy_cost(pcity),
+my_snprintf(buf, sizeof(buf), %s (%d/%d)%s, name,
+   pcity-shield_stock, cost,
from_worklist);
   }
 
   return buf;
 }
 
+static const char *cr_entry_build_cost(const struct city *pcity,
+