Project

General

Profile

Defect #36396 » 36396-apply_custom_pluralization_rules.patch

Felix Schäfer, 2022-01-07 12:06

View differences:

lib/redmine/i18n.rb
159 159
    # * available_locales are determined by looking at translation file names
160 160
    class Backend < ::I18n::Backend::Simple
161 161
      module Implementation
162
        include ::I18n::Backend::Pluralization
163

  
164 162
        # Get available locales from the translations filenames
165 163
        def available_locales
166 164
          @available_locales ||= ::I18n.load_path.map {|path| File.basename(path, '.*')}.uniq.sort.map(&:to_sym)
167 165
        end
168 166
      end
169 167

  
168
      # Adds custom pluralization rules
169
      include ::I18n::Backend::Pluralization
170 170
      # Adds fallback to default locale for untranslated strings
171 171
      include ::I18n::Backend::Fallbacks
172 172
    end
    (1-1/1)