Getting locale information?

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.com/book/

My blogs:

http://www.rubyinpractice.com/

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

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 :slight_smile:

–Jeremy

On 1/3/07, Mat S. [email protected] wrote:

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.com/book/

My blogs:

http://www.rubyinpractice.com/

Hi,

On Wed, 3 Jan 2007 14:39:02 +0900
“Jeremy McAnally” [email protected] 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/gettextapi/