[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Getting locale information?

Jeremy McAnally

1/3/2007 5:39:00 AM

I'm working on a library, and it would be very nice to automatically
be able to switch out the data based on the user's locale. Is there a
way to automatically find that? Or is that something they will need
to setup?

Thanks,
Jeremy

--
My free Ruby e-book:
http://www.humblelittlerubybook...

My blogs:
http://www.mrneigh...
http://www.rubyinpra...

3 Answers

Mat Schaffer

1/3/2007 7:02:00 PM

0


On Jan 3, 2007, at 12:39 AM, Jeremy McAnally wrote:

> I'm working on a library, and it would be very nice to automatically
> be able to switch out the data based on the user's locale. Is there a
> way to automatically find that? Or is that something they will need
> to setup?
>
> Thanks,
> Jeremy

If you're working in rails, it sounds like the globalize plugin might
be what you're looking for. It may have roots in libraries that you
could utilities in outside of rails as well, but I can't say for sure.
-Mat

Jeremy McAnally

1/3/2007 8:20:00 PM

0

I didn't think of that...I'm not working in Rails, but I'll grab
globalize and pick through it and see what I can find.

Thanks :)

--Jeremy

On 1/3/07, Mat Schaffer <schapht@gmail.com> wrote:
>
> On Jan 3, 2007, at 12:39 AM, Jeremy McAnally wrote:
>
> > I'm working on a library, and it would be very nice to automatically
> > be able to switch out the data based on the user's locale. Is there a
> > way to automatically find that? Or is that something they will need
> > to setup?
> >
> > Thanks,
> > Jeremy
>
> If you're working in rails, it sounds like the globalize plugin might
> be what you're looking for. It may have roots in libraries that you
> could utilities in outside of rails as well, but I can't say for sure.
> -Mat
>
>


--
My free Ruby e-book:
http://www.humblelittlerubybook...

My blogs:
http://www.mrneigh...
http://www.rubyinpra...

Masao Mutoh

1/4/2007 12:28:00 AM

0

Hi,

On Wed, 3 Jan 2007 14:39:02 +0900
"Jeremy McAnally" <jeremymcanally@gmail.com> wrote:

> I'm working on a library, and it would be very nice to automatically
> be able to switch out the data based on the user's locale. Is there a
> way to automatically find that? Or is that something they will need
> to setup?

Ruby-GetText-Package supports the system locale.

Try GetText.locale or Locale.get.
http://www.yotabanana.com/g...