hyperrjas
hyperrjas

Reputation: 10744

country_code list for geocoder gem

I'm using geocoder to detect country user.

On my app I need detect country user. I make something like:

c = request.location.country_code
  case c
    when 'US'
     I18n.locale = :en
    when 'ES'
     I18n.locale = :es
    else
     locale ||= I18n.default_locale
   end

My question is where can I find a country_code list for my other languages?

Upvotes: 3

Views: 1753

Answers (2)

Jason Brodie
Jason Brodie

Reputation: 330

The table listed above is no longer available.

Please see this one for reference.

http://labs.apnic.net/dists/regiontablecc.html

Upvotes: 0

hyperrjas
hyperrjas

Reputation: 10744

Check the documentation for the provider you're using. For example, Google returns ISO 3166-1 codes.

http://www.iso.org/iso/iso-3166-1_decoding_table.html

Regards!

Upvotes: 1

Related Questions