Closed fatkodima closed 1 year ago
Not directly related: But isn't it too costly to allocate a new regexp via Regexp.union(config.interpolation_patterns)
each time interpolation is done?
Could we store that interpolation regex object so that it’s not recalculated every call? Possibly on the config object itself?
That is done on the other PR you just commented.
Attempted to resolve the conflicts here after the other PR was merged in to master. Hope I did it right 🤞
Resolved conflicts.
Thank you!
FYI, if you're using gettext_i18n_rails
, you'll need to update to 1.10.1+ which plays nicer with this change in i18n 1.13.0.
See also https://github.com/grosser/gettext_i18n_rails/pull/196
See for the details - https://github.com/rails/rails/issues/47421
Even when there are no interpolations,
gsub
turnsSafeBuffer
into aString
- https://github.com/rails/rails/blob/6af9cba73db6296ab9aec7dbeae1e193ea69f09f/activesupport/lib/active_support/core_ext/string/output_safety.rb#L169 So we need to preserve the original "string" object.