Project

General

Profile

Actions

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.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

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

my-account.png (55.7 KB) my-account.png Vincent Robert, 2025-06-23 12:15
clipboard-202506232251-4iznn.png (250 KB) clipboard-202506232251-4iznn.png Marius BĂLTEANU, 2025-06-23 21:51
clipboard-202506232252-qkht7.png (492 KB) clipboard-202506232252-qkht7.png Marius BĂLTEANU, 2025-06-23 21:52
clipboard-202506232254-c2qjl.png (507 KB) clipboard-202506232254-c2qjl.png Marius BĂLTEANU, 2025-06-23 21:54
Actions #1

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.

Actions #2

Updated by Marius BĂLTEANU 1 day ago

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?

Actions #3

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.

Actions #4

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.

Actions

Also available in: Atom PDF