Defect #42815 » 0001-Extract-available_locales-from-Implementation-module.patch
| Gemfile | ||
|---|---|---|
|
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'
|
||
| lib/redmine/i18n.rb | ||
|---|---|---|
|
# 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
|
||