xiCO2k / laravel-vue-i18n

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

Object Translation #171

Closed RicardoRibeirorr closed 4 months ago

RicardoRibeirorr commented 4 months ago

Hi, I'm using object based translation like " $t('auth.failed') ", but its not working!

I've tested with single " $t("test") " and it works fine.

Template: image

Translation "pt.json": image

Result browser: image

Devtools json: image

valpuia604 commented 4 months ago

What happen if you put like "auth.failed": "Failed message"

xiCO2k commented 4 months ago

Hey @RicardoRibeirorr you can not use the object syntax on .json files, only with .php files.

Main reason is that is the way Laravel handles json language files in the backend.