Le lundi 12 novembre 2012 à 07:22 +0100, Michael Vehrs a écrit :
> On 11.11.2012 19:26, Thierry wrote:
> > Hello,
> >
> > I'm new to this list and hope to help.
> >
> > This patch correct the French translation for me (tested in English and
> > French).
> > 4 new messages have to be translated in other languages (not added).
> >
> > Please commit (current r10281.
> >
> > Regards.
> > --
> > Thierry
> >
>
>
> Thanks for your patch, which I have applied as commit #10282. Please
> note that the default message file is FreeColMessages.properties (with
> no country or language specification). It contains strings in US English.
> FreeColMessages_en_GB.properties is only used for strings in British
> English (to account for different spelling, for example). You might also
> use Messages.getName(FreeColObject), which returns the localized name of
> the object (adding ".name" to the object's ID).
>
>
> Regards
>
> Michael
>
Hello,
Thanks for your advises.
I need an object's ID to fixe the plural form, so I added a getName
method to the goodsType class.
Is it the right way ?
Please find the cleanup in attachment (vs.r10286).
Regards.
Index: src/net/sf/freecol/common/model/GoodsType.java
===================================================================
--- src/net/sf/freecol/common/model/GoodsType.java (révision 10286)
+++ src/net/sf/freecol/common/model/GoodsType.java (copie de travail)
@@ -129,6 +129,10 @@
return getId() + ".workingAs";
}
+ public final String getName() {
+ return getId() + ".name";
+ }
+
/**
* Get the <code>ImmigrationType</code> value.
*
Index: src/net/sf/freecol/client/gui/panel/ColonyPanel.java
===================================================================
--- src/net/sf/freecol/client/gui/panel/ColonyPanel.java (révision 10286)
+++ src/net/sf/freecol/client/gui/panel/ColonyPanel.java (copie de travail)
@@ -688,7 +688,7 @@
int producing = workingOnLand.getProductionOf(unit, goodsType);
unitIcon = imageLibrary.getUnitImageIcon(unit, 0.5);
String nominative = Messages.message(StringTemplate.template(
- unit.getWorkType() + ".name").addAmount("%amount%", producing));
+ goodsType.getName()).addAmount("%amount%", producing));
String menuTitle = new String(Messages.message(unit.getLabel()) + " " +
Messages.message("producing.name") + " " + producing + " " + nominative);
subMenu = new JMenuItem(menuTitle, unitIcon);
@@ -707,7 +707,7 @@
int producing = workingInBuilding.getProductionOf(unit, workingInBuilding.getGoodsOutputType());
unitIcon = imageLibrary.getUnitImageIcon(unit, 0.5);
String nominative = Messages.message(StringTemplate.template(
- goodsType.getId() + ".name").addAmount("%amount%", producing));
+ goodsType.getName()).addAmount("%amount%", producing));
String menuTitle = new String(Messages.message(unit.getLabel()) + " " +
Messages.message("producing.name") + " " + producing + " " + nominative);
subMenu = new JMenuItem(menuTitle, unitIcon);
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Freecol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freecol-developers