How can I use Laravel Localization use in Reactjs #1495
Unanswered
sm-jahangir
asked this question in
Help
Replies: 2 comments
-
Check this solution, |
Beta Was this translation helpful? Give feedback.
0 replies
-
If you're struggling with localization in a Laravel + Inertia.js (Vue.js) setup, I've got a solution that might simplify your process. Check this repo: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using Laravel website.
I am using Laravel's default localization.
Now I want to use laravel inertia reactjs but the translate() function is not working there, so how to access the file inside my laravel /resources /lang in reactjs and what is the best practice to use localization in react frontend ?
And I've created a helper function called translate() that looks like this
@translate(You are logged in!)
The advantage of this function is that when we visit a page, this function is called, then if there is any new text that is not in the lang/json file, it fetches it into the json file.
If it can't be used, how can I use Laravel's default {{__('You are log in ')}}?
Now I want to use laravel inertia reactjs but the translate() function is not working there, so how to access the file inside my laravel /resources /lang in reactjs and what is the best practice to use localization in react frontend ?
Beta Was this translation helpful? Give feedback.
All reactions