Defect #42911
closedEnglish is the only available language when installing Redmine 5.1.8
0%
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
Updated by Marius BĂLTEANU 1 day ago
- Assignee set to Marius BĂLTEANU
Thanks for catching and reporting this issue, I'll take a look.
Updated by Marius BĂLTEANU 1 day ago
- File clipboard-202506232251-4iznn.png clipboard-202506232251-4iznn.png added
- File clipboard-202506232252-qkht7.png clipboard-202506232252-qkht7.png added
- File clipboard-202506232254-c2qjl.png clipboard-202506232254-c2qjl.png added
- Status changed from New to Needs feedback
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?
Updated by Vincent Robert about 16 hours ago
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.
Updated by Vincent Robert about 11 hours ago
- 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.