Skip to content

Commit

Permalink
Merge branch 'release/0.40.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
gbp committed Feb 9, 2022
2 parents 372d4cb + 306beb1 commit f929271
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/initializers/alaveteli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
load "util.rb"

# Application version
ALAVETELI_VERSION = '0.40.0.1'
ALAVETELI_VERSION = '0.40.1.0'

# Add new inflection rules using the following format
# (all these examples are active by default):
Expand Down
7 changes: 7 additions & 0 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 0.40.1.0

## Highlighted Features

* Fixes issue loading translated fields when using locales with underscores
(e.g. `en_RW` or `nl_BE`) (Graeme Porteous)

# 0.40.0.1

## Highlighted Features
Expand Down
24 changes: 24 additions & 0 deletions lib/alaveteli_localization/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,30 @@ class Railtie < Rails::Railtie
AlaveteliConfiguration.include_default_locale_in_urls
)

if Rails.version < '7.0.0' && Rails.env.development?
##
# Ideally the following would only be called in the `after_initialize`
# hook but this leads to an error when booting Rails 6.1 in development
# mode. (As config.cache_classes = false)
#
# This due Alaveteli not yet using the new Zeitwork autoloading feature
# and Rails attempts to render a deprecation warning which happens to
# includes an I18n translation so requires the default locale to be
# setup.
#
# Once we support Zeitwork (which is needed for Rails 7) then this can
# be removed.
#
# See: https://github.com/mysociety/alaveteli/issues/5382
#
AlaveteliLocalization.set_locales(
AlaveteliConfiguration.available_locales,
AlaveteliConfiguration.default_locale
)
end
end

config.after_initialize do
AlaveteliLocalization.set_locales(
AlaveteliConfiguration.available_locales,
AlaveteliConfiguration.default_locale
Expand Down

0 comments on commit f929271

Please sign in to comment.