From 34baee8a3992d5f7c5ae65173e1e09f88a42640a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C4=82LTEANU?= Date: Mon, 2 Jun 2025 22:28:12 +0300 Subject: [PATCH] Extract @available_locales@ from Implementation module. --- Gemfile | 1 + lib/redmine/i18n.rb | 12 +++++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 2b40e9e5e..3a4a61dd7 100644 --- a/Gemfile +++ b/Gemfile @@ -19,6 +19,7 @@ gem 'rack', '>= 3.1.3' gem "stimulus-rails", "~> 1.3" gem "importmap-rails", "~> 2.0" gem 'commonmarker', '~> 2.3.0' +gem "doorkeeper-i18n", "~> 5.2" # Ruby Standard Gems gem 'csv', '~> 3.3.2' diff --git a/lib/redmine/i18n.rb b/lib/redmine/i18n.rb index a79b4fc68..c2beafefb 100644 --- a/lib/redmine/i18n.rb +++ b/lib/redmine/i18n.rb @@ -177,13 +177,11 @@ module Redmine # 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 -- 2.39.5 (Apple Git-154)