
Last walk of the day for Charlee (Taken with Instagram)
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.
Fresh Tarmac http://t.co/XhL0ENQ6
This is sooo funny. #dogowners JESUS CHRIST IN RICHMOND PARK: http://t.co/QfxoEjLa
RT @bobthomson70: Thanks to all at @techmeetup Glasgow who have raised £71 for #movember ! Thanks!
Where is the bus?
RT @SallyBercow: Prince Philip calls wind farms “useless” and “completely reliant on subsidies”. Oh the irony :)
Reflections @ Mugdock Castle http://t.co/pN7d0gEU
I think I need some some #sed and #awk fu… Need to refactor some ye olde #Rails code