Search the web
Sign In
New User? Sign Up
i18n-prog · Discussion of Internationalization programming issues (i18n)
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Olsen Database DST issues   Message List  
Reply | Forward Message #2045 of 2074 |
Re: Re[2]: [i18n-prog] Java question: How to construct a ResourceBundle from a file

I think there's a Properties.load( ) method that takes a locale argument.

Phil Ritchie
VistaTEC
700 South Circular Road
Kilmainham
Dublin 8
Ireland
http://www.vistatec.ie


  From: Martin Wunderlich [martin_wu@...]
  Sent: 05/10/2008 20:45 CET
  To: Phil Ritchie <i18n-prog@yahoogroups.com>
  Subject: Re[2]: [i18n-prog] Java question: How to construct a ResourceBundle from a file


Hi Phil,

Thanks a lot for the reply!

> Martin
>  
> So, if I understand, you'd like to be able to open and read a bunch
> of properties files and determine their locale at runtime just
> before writing out the TMX with associated lang attributes?

That's right.

>  
> Can you determine the locale from the properties' file name
> (Volumes/users/me/myBundle_fr_FR.properties)? Then use either the
> PropertyResourceBundle or Properties classes?

I could get at the locale ID that way, but there is no way to set the
locale on a PropertyResourceBundle. At least no obvious way, like a
.setLocale(string locID) method.

>  
> If you're just using these classes to get over the encoding in the
> properties files it might be easier to use native2ascii to convert
> them all first to Unicode and then use some of the suggestions below:
>  
> 1. Regular Expressions
> 2. Alchemy Catalyst
> 3. Rainbow

That sounds like an option, even though I'd rather have a dedicated
tool.
I also checked the source code of OmegaT,
which has a filter for .properties. They are just parsing the
.properties file as a text file and doing the conversion on a
character level. I was hoping there'd be an easier way.

The Maxprograms tool ProptertiesViewer somehow does it. I wonder how.

>  
> I don't know for sure if 2 or 3 can help but I think they can. I
> can also recommend a good LSP who's engineering team might be able to help.

:-))

Cheers,

Martin

>  
> Phil Ritchie.

> --- On Sun, 5/10/08, Martin Wunderlich <martin_wu@gmx.net> wrote:

> From: Martin Wunderlich <martin_wu@gmx.net>
> Subject: [i18n-prog] Java question: How to construct a ResourceBundle from a file
> To: "Ian Davies" <i18n-prog@yahoogroups.com>
> Date: Sunday, 5 October, 2008, 6:58 PM

> Hi all,

> I hope someone on this list might know the answer to the following
> question:
> I am creating a program to process ResourceBundles and do stuff to
> the keys and values (to be more precise, I want to construct a TMX
> file from a bunch of existing translations in .properties files).

> I have come across the problem that there is no constructor for the
> ResourceBundle class that would take a file
> name as input. The only way I can create ResourceBundles, it seems,
> is by referring to the .properties file with a fully qualified
> class name (e.g. com.example. MyBundle) as the base name.

> Any ideas how I can get a working ResourceBundle object by passing in
> the file name (e.g. "/Volumes/users/ me/myBundle. properties" )?? I can
> create a PropertyResourceBun dle object from a FileInputStream
> alright, but when I call .getLocale() on that PropertyResourceBun dle,
> I only get null.

> Any help would be very much appreciated.

> Cheers,

> Martin

>

>

--
----------------------------------------------------------
Martin Wunderlich, M.A.
Translation/Localisation EN <-> DE

www.martinwunderlich.com
----------------------------------------------------------
Free / open-source software for translation/localisation:
www.martinwunderlich.com/foss-links.html
----------------------------------------------------------
Random aphorism:
"Aquela reinspiração, sem a qual traduzir é apenas parafrasear noutra língua."
"That new inspiration - without which to translate merely means to paraphrase into another language."
- Fernando Pessoa
----------------------------------------------------------

 

*********************************************************************

This email and any files transmitted with it are confidential and

intended solely for the use of the individual or entity to whom they

are addressed. If you have received this email in error please notify

the sender immediately by e-mail.

 

www.vistatec.ie

**********************************************************************

 



Mon Oct 6, 2008 5:05 am

pritchieuk
Offline Offline
Send Email Send Email

Forward
Message #2045 of 2074 |
Expand Messages Author Sort by Date

I have some issues with implementing DST rules from the Olsen DB via the data fetched from the JRE 6.0 Olsen says that DST change in Central Europe is at 1am,...
Ian Davies
ianbingofish
Online Now Send Email
Sep 10, 2008
5:34 pm

Hi all, I hope someone on this list might know the answer to the following question: I am creating a program to process ResourceBundles and do stuff to the...
Martin Wunderlich
wundiman
Offline Send Email
Oct 5, 2008
5:58 pm

Martin   So, if I understand, you'd like to be able to open and read a bunch of properties files and determine their locale at runtime just before writing out...
Phil Ritchie
endigitalmind
Offline Send Email
Oct 5, 2008
6:43 pm

Hi Phil, Thanks a lot for the reply! ... That's right. ... I could get at the locale ID that way, but there is no way to set the locale on a...
Martin Wunderlich
wundiman
Offline Send Email
Oct 5, 2008
7:45 pm

I think there's a Properties.load( ) method that takes a locale argument. Phil Ritchie VistaTEC 700 South Circular Road Kilmainham Dublin 8 Ireland ...
Phil Ritchie
pritchieuk
Offline Send Email
Oct 6, 2008
5:06 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help