NovuN
Novu2y ago
Dima_hat

Using nested translation variables

We want to create some complex notification massages that require to have nested translated messages/variables.

We want to have two translations of same message:
"{{firstName}} has changed the status to {{newStatus}}." (English)
"{{firstName}} hat den Status auf {{newStatus}} geändert." (German)

And here we have a problem of properly setting text for "newStatus".
I haven't found a way to store possible statuses as different texts in same i18n file and to reference them in any way
Setting such in-app text
{{i18n "conversations.inboxChange" firstName=actor.firstName newStatus={{i18n "conversations.status" context=statusContext}} }}

Results in error "Failed to extract variables"
Without putting newStatus variable - everything works as expected.

Is it possible to somehow use i18n messages in another message? Or what would be your advice regarding such messages?
Was this page helpful?