Open b627 opened 5 years ago
As far as I know what you're trying to do currently isn't supported by the lib. I would just append your dynamic value on after the translation.
this.i18n({ value: 'Showing dynamic value:', id: 'GLOBAL.ERROR.DEFAULT' }) + " " + variable1
I think I found a work arround to use interpolations @b627 in your case, try this this.i18n({ value: '[{{val1}}]', id: 'GLOBAL.ERROR.DEFAULT' }, {val1: variable1})
If you had more than one interpolation, you will have something like this this.i18n({ value: '[{{val1}},{{val2}}]', id: 'GLOBAL.ERROR.DEFAULT' }, {val1: variable1, val2: variable2})
Good Luck cheers Albert Platard
Hi,
I want to translate some text but i don't want to use the '{{}}' notation at the name, I mean do something like this:
this.i18n('GLOBAL.ERROR.DEFAULT', {val1: variable1})
Where variable1 is a string. Here I have my messages.xlf file:
So I want to use interpolations without define them in the source tag, but when I do that I'm receiving this error:
Any ideas how can I handle this?
Regards, Benjamín