Defect #42911
closed
English is the only available language when installing Redmine 5.1.8
Added by Vincent Robert 1 day ago.
Updated about 11 hours ago.
Description
Using the current 5.1.8 branch, with a fresh empty install, the only language available is English.

And updating from 5.1.7 to 5.1.8, I got an error message when visiting the settings#display tab:
Showing /redmine-5.1-stable/app/views/settings/_display.html.erb where line #14 raised:
"fr" is not a valid locale
Extracted source (around line #219):
def date_format_setting_options(locale)
Setting::DATE_FORMATS.map do |f|
today = ::I18n.l(User.current.today, :locale => locale, :format => f)
format = f.delete('%').gsub(/[dmY]/) do
{'d' => 'dd', 'm' => 'mm', 'Y' => 'yyyy'}[$&]
end
It must be related to the latest changes which modified how available languages are loaded.
Files
- Assignee set to Marius BĂLTEANU
Thanks for catching and reporting this issue, I'll take a look.
Peter Steffek, I cannot reproduce it on the 5.1-stable branch with a fresh install.
My environment:

My account:

Administration -> Settings:

Can you add more details about your setup?
You're right. The issue only appears when we add a plugin (any plugin) which uses a Deface override, and when this change is applied in the lib/redmine/i18n.rb
core file:
# Custom backend based on I18n::Backend::Simple with the following changes:
# * available_locales are determined by looking at translation file names
class Backend < ::I18n::Backend::Simple
- module Implementation
- # Get available locales from the translations filenames
- def available_locales
- @available_locales ||= begin
- redmine_locales = Dir[Rails.root / 'config' / 'locales' / '*.yml'].map { |f| File.basename(f, '.yml').to_sym }
- super & redmine_locales
- end
+ # Get available locales from the translations filenames
+ def available_locales
+ @available_locales ||= begin
+ redmine_locales = Dir[Rails.root / 'config' / 'locales' / '*.yml'].map { |f| File.basename(f, '.yml').to_sym }
+ super & redmine_locales
end
end
I’m delving deeper into the issue.
- Status changed from Needs feedback to Closed
The issue comes indeed from our plugins and the loading of Deface overrides.
The recent fix related to language loading highlighted this problem, which previously went unnoticed.
Thanks for the help.
Also available in: Atom
PDF