How to use translations
Hi there, I have a question regarding translation support in novu. I uploaded a translation file with just the content '{"test_key": "Test Translation"}'. How can I actually use the translations in the template editor of an in-app notification for example? And how can we include specific novu variables such as the digest step total count, can this be included in the translation value?
21 Replies
Hi @L.Wuethrich
We are still working on the translation feature
it will be available with next release
Hi @L.Wuethrich, if you have a translation group named
In the editor you could use it like that:
test
with a file with content {"test_key": "Test Translation"}
In the editor you could use it like that:
{{i18n "test.test_key"}}
To include variables inside a translation result you can first define a variable as part of the translation string. For example {"test_key": "Test Translation {{yourVar}}"}
and then when you use it in the editor you would do: {{i18n "test.test_key" yourVar=step.total_count}}
Where in the yourVar=<HERE>. HERE could also be a variable that you pass its value through the payloadThanks Gali 🫡
@Gali Baum Thanks for your help, what if there are multiple values can i just add them with spaces one after the other?
I am not sure what I am doing wrong but using the given example it only includes 'test_key' in the output message
and not the translated value
does your subscriber 'locale' field has the same locale as the one you defined for the file in the translation settings?
I thought that would not matter as I had to provide a default within the ui as a fallback
Thats a good point.
Could you please try with the same locale for the subscriber?
and I'll look into that
Just ti make sure that is really the problem 🙂
Yes let me check
@L.Wuethrich, you just advanced to level 1!
@Gali Baum it does not seem to work for me even after changing my locale
Can you send me a screenshot of your editor>
?
my group is named translations
I know I have the group twice but both have the same file as input and I can't remove the second one
and the second one got a different id
and what is your output in the notification?
translation: test_key
?
I have a custom component but only the translation key seems to be in the output
@Gali Baum Please write back if you find out what's the problem
Sure thing @L.Wuethrich , I’ll look into it first thing tomorrow morning 👍 I’ll keep you updated
@L.Wuethrich I was not able to reproduce this, for me it happens as expected
could you please send me a dm with your organizationId?
@L.Wuethrich Could you please try sending an email through the test workflow feature?