Skip to content

Commit

Permalink
simplify i18n helper logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Jul 30, 2024
1 parent acdf2a0 commit dd4f8eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/helpers/i18n_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def inheritable_translation_defaults(key, partial) # rubocop:disable Metrics/Met
while current < ActionController::Base
folder = current.controller_path
if folder.present?
folders = get_all_parent_folders(folder) +
get_all_parent_folders(folder.gsub('/', '.'), '.')
folders = get_all_parent_folders(folder)
folders += get_all_parent_folders(folder.gsub('/', '.'), '.')
folders = folders.uniq.sort_by(&:length).reverse
folders.each do |f|
append_controller_translation_keys(defaults, f, partial, key)
Expand Down

0 comments on commit dd4f8eb

Please sign in to comment.