i18n questions

Questions about i18n:

  1. What’s the correct way to mark strings for translation? I have a bunch
    of new strings in Zoomer, and I’d like to do it properly.

  2. Is there a reason that the English properties file is called
    VASSAL.properties instead of VASSAL_en.properties?

*********** REPLY SEPARATOR ***********

On 8/01/2008 at 2:44 AM uckelman wrote:

Your source should contain:

Resources.getString(“Zoomer.scaling_map”)

matched by

Zoomer.scaling_map=Scaling Map …

in VASSAL.properties, so

JLabel l = new JLabel(“Scaling Map …”);

becomes

JLabel l = new JLabel(Resources.getString(“Zoomer.scaling_map”));

Because a project has to have one source language and a number of target languages. The source language has to be recorded in VASSAL.properties and the different target languages in VASSAL_xx.properties.


Brent Easton
Analyst/Programmer
University of Western Sydney
Email: b.easton@uws.edu.au


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Brent Easton”:

Heh, you picked the one key that I deleted as an example. :slight_smile:

That was helpful. Thanks.

Another question: Is there a way to handle common words in in one place?
E.g., rather than make entries like

Zoomer.ZoomDialog.ok=Ok
Zoomer.ZoomDialog.cancel=Cancel

should we have a some generic entries like

Button.Ok=Ok
Button.Cancel=Cancel

to reduce maintenance and translation work?

Related question: Are there any languages where what is a ‘Cancel’ button
in two different dialogs in English shold be an ‘X’ button in one dialog
in that language, but a ‘Y’ button in the other dialog?


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Hi Joel,

Yes, have a look in VASSAL.properties at the General Strings:

General Strings

General.VASSAL=VASSAL
General.add=Add
General.save=Save
General.cancel=Cancel
General.create=Create

etc.

In Resources.java I have also created constants for these:

public static final String VASSAL = “General.VASSAL”; //$NON-NLS-1$
public static final String ADD = “General.add”; //$NON-NLS-1$
public static final String REMOVE = “General.remove”; //$NON-NLS-1$
public static final String INSERT = “General.insert”; //$NON-NLS-1$
public static final String YES = “General.yes”; //$NON-NLS-1$
public static final String NO = “General.no”; //$NON-NLS-1$
public static final String CANCEL = “General.cancel”; //$NON-NLS-1$

So all you need to do is

Jlabel(“Yes”);

becomes

JLabel(Resources.YES);

I don’t think so. We only support a one-to-one translation. It is up to the translator to choose a suitable generic translation for ‘Cancel’ that will suit all possible dialogs.

Regards,
Brent.


Brent Easton
Analyst/Programmer
University of Western Sydney
Email: b.easton@uws.edu.au


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Actually, that should be

JLabel(Resources.getString(Resources.YES));

Brent.


Brent Easton
Analyst/Programmer
University of Western Sydney
Email: b.easton@uws.edu.au


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Brent Easton”:

I had not seen those. Thanks.

Maybe I’m not being clear: I wasn’t asking about one-to-many translation,
I was asking whether we might ever need two keys which have the value
‘Cancel’ (say) in English, but have two distinct values in some other
language. Like, maybe in Elbonian “unfrob” is appropriate for cancelling
dialogs with fewer than 20 words in them, while in dialogs containing more
words “unfrob” would mean “cheese”, and so a different cancel word is
used in those cases.

Perhaps a different example is in order. If you had a dialog with
three buttons, “One”, “Two”, “Three”, my (extremely limited) knowledge
of Japanese tells me that the correct translations would depend on
what you’re counting, since Japanese has different counting words
for different objects. So for cases like that, having General.One,
General.Two, and General.Three would pose a problem.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)