vue-i18n-manager icon indicating copy to clipboard operation
vue-i18n-manager copied to clipboard

Translation is empty when variable does not exist

Open petervdn opened this issue 7 years ago • 2 comments

{{ $t('somekey', { name: userName }) }}

When the translation does not include a {name} occurrence, the result for the translation is completely empty.

petervdn avatar Oct 15 '18 14:10 petervdn

Hi Peter, could you create a reproduction of this with a simple vue-cli application so that I can have a look?

Thanks

MatteoGabriele avatar Oct 15 '18 15:10 MatteoGabriele

Just add a non-existing variable to a call to $t:

This works fine: console.log(this.$t('some_key'));

This is undefined: console.log(this.$t('some_key', { name: 'Bob' }));

petervdn avatar Oct 15 '18 15:10 petervdn