rootstrap / i18n_linter

Rails i18n Linter Gem
https://rootstrap.com
MIT License
44 stars 2 forks source link

Improve handling of interpolated strings #8

Closed f19ps closed 5 years ago

f19ps commented 5 years ago

There is a workaround that would be effective to handle interpolated strings in a better way with the Ripper library.

Ripper splits the interpolated strings making the parse more difficult.

For example, for the line: logger.info "ERP response was #{res_code}: #{res.message}", Ripper returns the following key-value pairs:

screen shot 2018-12-26 at 6 25 41 pm

Instead of take the strings with :on_tstring_content label, we could take the whole strings appending all the values between :on_tstring_beg and :on_tstring_end

f19ps commented 5 years ago

Fixed in https://github.com/rootstrap/i18n_linter/pull/9