ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn McAllister <>
Subject Re: [DISC] misc
Date Tue, 10 Apr 2001 13:16:35 GMT
Stefan Bodewig wrote:

> I think Ant will need to use the resource stuff under the covers
> anyway - and I agree that hardcoding the messages in build.xml listing
> all languages would be silly (what have I been thinking, tss).
> Using an XML messages.xml files or something might be using the same
> syntactical structure as build files do, but user are probably
> familiar with property files anyway.  I have no real preference here.

A property file is probably the simplest and most well know way to do
this.  The only reason I can think to introduce an XML syntax is if we
want to have multple strings per identifier in the same file.

<message id="build.failed.">
  <!-- Default en_US message -->
  <lang id="en">
Damn it, the build failed again.  Fix it now!

  <!-- Canadian message -->
  <lang id="en" country="CA">
Damn it, the build failed again.  Fix it now, eh!

  <!-- German message -->
  <lang id="de" country="DE" variant="EURO">
Verdammen Sie es, der Bau, der wieder verlassen wird. Regeln Sie ihn

(Translation curtesy of , so don't
blame me. :-] )

There are pros and cons to this approach.  The pro is obviously that
everything is in one place and easy to locate.  When translating, you
always have the baseline english sentance available for comparison.  The
con is that everything is in one place.  :) Translation centers often
work on a per file/per language basis.  If you have one file with
everything in it, you would end up sending it to multiple translation
centers, and having to incorporate the changes from 10+ files back into
one.  There's a headache waiting to happen.

> Maybe Ant should communicate the locale settings in built in
> properties to make live easier?  Something like ant.lang,,
> ant.variant and ant.locale, which would be "de", "DE", "EURO" and
> "de_DE_EURO" in my case.
> That way, you could do something like this
> <property file="messages.${ant.lang}.properties" />
> <property file="" />
> in your build file and provide yourself.  Ant
> would automatically fall back to "en" if there is no localized message
> resource.

+1.  Good idea.

View raw message