Configuring Spree Commerce to use the British Pound currency

I’ve been playing around with Spree for a couple of weeks and ran into a slightly confusing issue wrt. using a non-US Dollar currency, in my case British Pounds.

At the time of this writing, using Rails 3.1.x and Spree 0.70, the following steps will enable a ‘£’ (a pound sterling) sign to be displayed.

Add the I18n gem to your Gemfile and run bundle install:

gem 'rails-i18n'

Open a shell and cd into the config/locales folder of your Spree/Rails project. Download the British locale file:

wget https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/en-GB.yml

You’ll also need copy the contents of Spree’s British I18n file into the bottom of of your config/locales/en-GB.yml file.

Edit your config/application.rb and set your default locale to ‘British’:

config.i18n.default_locale = :"en-GB"

Create a new file in config/locales/en-GB_numbers.yml with the following contents:

---
en-GB:
number:
currency:
format:
format: "%u%n"
unit: "£"
precision: 2
separator: '.'
delimiter: ','

Spree uses the above file to set the currency settings. Be aware that Spree is currently a single currency application.