MailingList


Parse error for locale

View: New views
5 Messages — Rating Filter:   Alert me  

Parse error for locale

by byrnejb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am installing globalize in a new rails project and when I start the
webrick server I get this error:

vendor/plugins/globalize/lib/globalize/localization/rfc_3066.rb:6:in
`parse': bad format for en_US, not rfc-3066 compliant (ArgumentError)

config/environment.rb

  # Support for globalize plugin see:
  # http://www.globalize-rails.org/globalize/

  include Globalize
  Locale.set_base_language 'en_US'
  Locale.set 'en_US'

  #  Set these for globalize unicode support
  $KCODE = 'u'
  require 'jcode'

app/controllers/application.rb

  # support for unicode in globalize plugin
  after_fileter :set_charset
  def set_charset
    unless  @headers["Content-Type"] =~ /charset/i
      @headers["Centent-Type"] ||= ""
      @headers["Content-Type"]+= "; charset=utf-8"
    end
  end



Anyone have any idea of what I have missed?


--
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB@...
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3


Re: Parse error for locale

by ginger72 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi James, you may want to try en-US, and so forth, with a DASH (-) rather than underscore.

Best,
Jürgen

On Oct 29, 2007, at 9:56 AM, James B. Byrne wrote:

en_US



Re: Parse error for locale

by byrnejb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Mon, October 29, 2007 12:58, Jürgen Feßlmeier wrote:
> Hi James, you may want to try en-US, and so forth, with a DASH (-)
> rather than underscore.
>
> Best,
> Jürgen
>

That was it.

I am so thick at times.  I would have looked at that underscore forever
and never realized what I had done.

Thanks,

--
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB@...
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3


Re: Parse error for locale

by Chuck-46 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At 9:58 AM -0700 10/29/07, Jürgen Feßlmeier wrote:
>Hi James, you may want to try en-US, and so
>forth, with a DASH (-) rather than underscore.
>
>Best,
>Jürgen

I'm new to Globalize and I'm not sure if this
question has already been addressed.

I noticed that the ICU uses the underscore such as en_US:
http://www.icu-project.org/userguide/locale.html

and Mac OS X has adopted the ICU convention:
<http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFLocales/Articles/CFLocaleConcepts.html>

Does Globalize use many concepts and conventions from ICU?
Is the dash based on a different convention?
Should Globalize support the underscore?

Thanks,
Chuck

Re: Parse error for locale

by ginger72 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Chuck, you are right, the documentation does show locale information  
with underscore various times, unfortunately. It's be nice to support  
both conventions, underscore and dasherized.

Best,
Jürgen

On Oct 29, 2007, at 1:45 PM, Chuck wrote:

> At 9:58 AM -0700 10/29/07, Jürgen Feßlmeier wrote:
>> Hi James, you may want to try en-US, and so forth, with a DASH (-)  
>> rather than underscore.
>>
>> Best,
>> Jürgen
>
> I'm new to Globalize and I'm not sure if this question has already  
> been addressed.
>
> I noticed that the ICU uses the underscore such as en_US:
> http://www.icu-project.org/userguide/locale.html
>
> and Mac OS X has adopted the ICU convention:
> <http://developer.apple.com/documentation/CoreFoundation/Conceptual/ 
> CFLocales/Articles/CFLocaleConcepts.html>
>
> Does Globalize use many concepts and conventions from ICU?
> Is the dash based on a different convention?
> Should Globalize support the underscore?
>
> Thanks,
> Chuck