conedevelopment / i18n

Push your Laravel translations to the front-end and use them easily with JavaScript.
https://pineco.de/using-laravels-localization-js/
MIT License
129 stars 21 forks source link

Json file translations #38

Closed warhuhn closed 1 year ago

warhuhn commented 1 year ago

I've added support for loading .json Translation files from the Application's lang dir.

Because the Laravel documentation describes some special cases to avoid, e.g. if a .json Files' translation key collides with a translation namespace, i've tried to replicate that behavior as best as possible, with the Principle of Least Surprise.

If Laravel has weird behavior, we should replicate that weird behavior.

Unit tests are also updated to clear the view cache before each run, as the tests sometimes wouldn't recognize my changes.

warhuhn commented 1 year ago

This should fix #29.

iamgergo commented 1 year ago

Thanks a lot! Soon I will make a release!