Add available_locales config feature

This commit is contained in:
Julius Pabrinkis
2017-06-08 22:35:00 +01:00
committed by Maikel Linke
parent 9429695e15
commit 5166a3d958
2 changed files with 3 additions and 0 deletions

View File

@@ -71,6 +71,7 @@ module Openfoodnetwork
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
config.i18n.default_locale = ENV["LOCALE"]
config.i18n.available_locales = ENV["AVAILABLE_LOCALES"].andand.split(',').andand.map(&:strip) || [config.i18n.default_locale]
I18n.locale = config.i18n.locale = config.i18n.default_locale
# Setting this to true causes a performance regression in Rails 3.2.17

View File

@@ -9,6 +9,8 @@ TIMEZONE: Melbourne
DEFAULT_COUNTRY_CODE: AU
# Locale for translation.
LOCALE: en
# For multilingual - ENV doesn't have array so pass it as string with commas
AVAILABLE_LOCALES: en,es,en-GB
# Spree zone.
CHECKOUT_ZONE: Australia
# Find currency codes at http://en.wikipedia.org/wiki/ISO_4217.