ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: how to deal with localised properties?
Date Thu, 27 Nov 2008 12:52:38 GMT

>>If i want to load different properties file depending on the 
>>locale how is this handled? Basically, does ant support the 
>notion of a
>>resource bundle?
>AFAIK there is no direct support for that.
>If you can get the current locale into a property you could load the
>file with
>   <property file="messages_${locale}.properties"/>
>Because I havent worked with I18N I cannot say anything to loading
>Locales ... 
>(maybe can see something in the docs ...)

System property 
  "user.region" : The two-letter country code of the default locale
  "user.language" : The two-letter language code of the default locale

System properties are available as Ant properties, so 
  <property file="messages_${user.region}_${user.language}.properties"/>

  <property file="messages_${user.region}.properties"/> 
  <property file=""/> 
should work.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message