Closed trajano closed 2 years ago
Does this work with regular Rails? I tried and couldn't make it work.
I18n.t("hello")
=> "Hello, {{user.name}}!"
irb(main):005:0> I18n.t("hello", user: {name: "John"})
=> "Hello, {{user.name}}!"
I think we should keep it close to Rails' original syntax.
As an alternative, you may create a function that sets the paths for things like this? I18n.t("welcome", flat(userProfile))
, then this flat
function would generate a flat object out of the input. There are some packages that do that for you, like https://www.npmjs.com/package/flat.
I'd like to be able to pass in a place holder as an object. For example I would want to pass with the original user profile object without having to modify it for the localization.
and have it in the message as
At present it can't find it