Module | Amazon::Locale |
In: |
lib/amazon/locale.rb
|
CA | = | %w[ ca ] | ISO 3166 codes of countries likely to want to shop in the CA locale. | |
DE | = | %w[ at ch de ] | ISO 3166 codes of countries likely to want to shop in the DE locale. | |
FR | = | %w[ fr ] | ISO 3166 codes of countries likely to want to shop in the FR locale. | |
JP | = | %w[ jp ] | ISO 3166 codes of countries likely to want to shop in the JP locale. | |
UK | = | %w[ ad al ba be cy cz dk ee es fi fo gi gr gl ie is it li lt lu lv mk mt nl no pl pt ro se si sk sm uk ] | ISO 3166 codes of countries likely to want to shop in the UK locale. | |
US | = | %w[ mx us ] | ISO 3166 codes of countries likely to want to shop in the US locale. Any countries not explicitly listed above default to the US locale. |
This will attempt to return a reasonable locale (ca, de, fr, jp, uk or us) to use for the IP address addr.
For example:
get_locale_by_addr('217.110.207.55') => "de"