1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-31 19:47:14 +00:00

Restrict available locales to those defined by Redmine itself (#38529).

Patch by  Holger Just.


git-svn-id: https://svn.redmine.org/redmine/trunk@22237 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2023-05-10 00:27:32 +00:00
parent bf239fae8a
commit 3a75a7ecc5

View File

@ -161,7 +161,10 @@ module Redmine
module Implementation
# Get available locales from the translations filenames
def available_locales
@available_locales ||= ::I18n.load_path.map {|path| File.basename(path, '.*')}.uniq.sort.map(&:to_sym)
@available_locales ||= begin
redmine_locales = Dir[Rails.root / 'config' / 'locales' / '*.yml'].map { |f| File.basename(f, '.yml').to_sym }
super & redmine_locales
end
end
end