Re: Access to LANG var from Java programs?
--- "E.L. Willighagen" <egonw@sci.kun.nl> a écrit :
>
> Hi all,
Hi
>
> working on internationalizing some OS Java tools, I was wondering how
> to
> access bash export variables, one specific being LANG...
If I recall correctly, jakarta-ant executes 'set' and then parses the
output to populate the variables when the tag <property
environment="foo"/> is used...
See [http://jakarta.apache.org/ant/manual/CoreTasks/property.html] for
the property tag documentation.
>
> The method System.getProperty() seems only to handle things like
> "-Dlang=en_EN" as a command line option, and yes, the wrapper could
> as such
> transfer the $LANG value to the Java program.
Yes, it's a solution, but...
>
> But, is there no more direct way of accessing the $LANG var from
> within the
> Java program itself?
There is a whole set of objects designed to work with i18n in Java. I
don't think this is the place to enumerate them all and direct you to
the i18n trail of Sun's Java Tutorial
[http://java.sun.com/docs/books/tutorial/i18n/index.html]. These
objects permit not only to use different messages but also treat the
differences in formating dates, currencies...
>
> kind regards,
>
> Egon
>
Happy coding,
Francois.
=====
Francois BOTTIN
--
"How kind," the PFY sighs. "But where will I go?"
"Somewhere where they know nothing about computing...
where they wouldn't know a RAM chip from a potato chip!"
"But I don't want to visit Microsoft!" he whines.
The BOFH 1998 - Simon Travaglia (bofh.ntk.net)
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com
Reply to: