Fix limit available locales to those defined by Redmine itself (#42815).

git-svn-id: https://svn.redmine.org/redmine/trunk@23829 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu
2025-06-11 19:48:18 +00:00
parent 5a198c9057
commit 300d342488

View File

@@ -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