mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-28 01:53:25 +00:00
Merge pull request #12489 from mkllnk/available-locales
More realistic test env for translations
This commit is contained in:
4
.env
4
.env
@@ -10,10 +10,10 @@ TIMEZONE="Melbourne"
|
||||
DEFAULT_COUNTRY_CODE="AU"
|
||||
|
||||
# Locale for translation.
|
||||
LOCALE="en"
|
||||
LOCALE="en_AU"
|
||||
|
||||
# For multilingual - ENV doesn't have array so pass it as string with commas
|
||||
AVAILABLE_LOCALES="en,es"
|
||||
AVAILABLE_LOCALES="en_AU,es"
|
||||
|
||||
# Spree zone.
|
||||
CHECKOUT_ZONE="Australia"
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
#
|
||||
# cp .env.development .env.local
|
||||
|
||||
# Locale for translation. Using a locale other than `en` tests the
|
||||
# successful fallback to `en`. You will also see up-to-date text used
|
||||
# in production
|
||||
LOCALE="en_AU"
|
||||
|
||||
VERBOSE_QUERY_LOGS=true
|
||||
|
||||
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
# ENV vars for the test environment
|
||||
# Override locally with `.env.test.local`
|
||||
|
||||
# Locale for translation.
|
||||
LOCALE="en_TEST"
|
||||
|
||||
OFN_REDIS_JOBS_URL="redis://localhost:6379/2"
|
||||
|
||||
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
|
||||
12
config/locales/en_TEST.yml
Normal file
12
config/locales/en_TEST.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
# Test language file
|
||||
# ---------------------
|
||||
#
|
||||
# All production environments set their own locale. The source locale `en.yml`
|
||||
# is used as a fallback but no server is using it directly.
|
||||
#
|
||||
# Using this test locale reflects that setup more realistically and means that
|
||||
# we include fallback translations in our tests.
|
||||
#
|
||||
en:
|
||||
# Overridden here due to a bug in spree i18n (Issue #870, and issue #1800)
|
||||
language_name: "English" # Localised name of this language
|
||||
@@ -141,7 +141,7 @@ RSpec.configure do |config|
|
||||
|
||||
# Reset locale for all specs.
|
||||
config.around(:each) do |example|
|
||||
I18n.with_locale(:en) { example.run }
|
||||
I18n.with_locale(:en_AU) { example.run }
|
||||
end
|
||||
|
||||
# Reset all feature toggles to prevent leaking.
|
||||
|
||||
Reference in New Issue
Block a user