More realistic test env for translations

Most production servers don't use the source locale `en`. Even if the
default language is English, they use a local variant like `en_AU` or
`en_GB` to customise some of the translations.

However the environment is configured, the app should always fallback to
`en` if no other translation is available.
This commit is contained in:
Maikel Linke
2024-05-03 15:02:46 +10:00
parent e30dc1b05c
commit f14945c155
2 changed files with 3 additions and 3 deletions

4
.env
View File

@@ -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"

View File

@@ -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.