Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
palexvs committed Dec 11, 2024
1 parent f40a020 commit 33c1310
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/rubocop/cop/i18n/gettext/decorate_function_message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,16 @@ def interpolation_correct(node)
if interpolated_values_string.empty?
interpolated_values_string << '{ '
end
interpolated_values_string << "#{hash_key}: #{value.loc.expression.source}, "
interpolated_values_string << "#{hash_key}: #{value.source}, "

# Replace interpolation with format string
corrector.replace(child.loc.expression, "%{#{hash_key}}")
corrector.replace(child, "%{#{hash_key}}")
end
unless interpolated_values_string.empty?
interpolated_values_string << '}'
end
corrector.insert_before(node.source_range, '_(')
corrector.insert_after(node.source_range, ") % #{interpolated_values_string}")
corrector.insert_before(node, '_(')
corrector.insert_after(node, ") % #{interpolated_values_string}")
}
end
end
Expand Down

0 comments on commit 33c1310

Please sign in to comment.