Open movermeyer opened 2 years ago
This can also happen as a result of Symbol
resolving via default
parameters:
# frozen_string_literal: true
require "i18n"
I18n.backend = I18n::Backend::Simple.new
I18n.backend.store_translations(:en, foo: "%{baz}")
puts(I18n.t("non-existent", baz: "%{qux}", default: [:foo]))
@movermeyer I reckon this'll have been resolved now with https://github.com/ruby-i18n/i18n/pull/699 being merged.
What I tried to do
What I expected to happen
i.e., the resolved
Symbol
's value is only interpolated once and returned.What actually happened
This is a result of
%{baz}
interpolating to%{qux}
, and then the code trying to interpolate%{qux}
.Note that removing the Symbol resolving works:
Note that interpolation occurs for each layer of Symbol resolving that is done:
e.g.,
Interpolates the string three times.
Versions of i18n, rails, and anything else you think is necessary