xiCO2k/laravel-vue-i18n

Multiple occurrence of variable issue

xiki808 opened this issue · 4 comments

Hi, this issue is showing up again: #91

I'm with version 2.5.1

can you provide an example, we have a test for that and it's still passing.

In my laravel project /lang/cv.php I have:

'test_var' => 'This is a var :site_name and this is the same var :site_name',

And in my component:

<span>
{{
    trans('cv.test_var', {
      site_name: 'mysite.com',
    })
  }}
</span>

What's printed: This is a var mysite.com and this is the same var :site_name

I'm using Inertia to load and render pages.

got it, will check that out.

I was unable to reproduce it, and there is a test to reproduce it.

Check this:
https://github.com/xiCO2k/laravel-vue-i18n/blob/main/test/translate.test.ts#L84-L90

Also you can try using the $t() helper instead.