xiCO2k / laravel-vue-i18n

Allows to connect your `Laravel` Framework translation files with `Vue`.
MIT License
620 stars 51 forks source link

Explain difference between trans, wTrans and $t? #166

Closed guilheb closed 9 months ago

guilheb commented 9 months ago

I have noticed that in <script setup>, sometimes trans() does not work as expected and we have to use wTrans(). Does anyone know why and when to use each?

Also, I see a $t() function in the documentation. What is this for?

xiCO2k commented 9 months ago

yes basically the trans method is not reactive, and the wTrans is reactive but you need to use with the .value syntax when you need.