I want to change form labels in my Solidus ecommerce application.
My particular use case is handling UK addresses where the name "Zip Code" should be changed to "Post Code" - but there could be other localization changes as well.
How can I do this?
I want to change form labels in my Solidus ecommerce application.
My particular use case is handling UK addresses where the name "Zip Code" should be changed to "Post Code" - but there could be other localization changes as well.
How can I do this?
Solidus, which was forked from Spree, provides a number of ways to customize the application. In this case you want to translate a string depending on the locale.
Solidus provides a internationalization gem solidus_i18n for this issue.
Installation Instructions are currently (but check with gem readme):
gem 'solidus_i18n', github: 'solidusio-contrib/solidus_i18n', branch: 'master'
bundle install
bin/rails g solidus_i18n:install
You can also set the default locale within config/initializers/spree.rb
Spree::Frontend::Config.configure do |config|
...
config.locale = 'en-GB'
end
Spree::Backend::Config.configure do |config|
...
config.locale = 'en-GB'
end
Spree Documentation on Internationalization - very similar documenation