-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vite #185
Comments
@EmilMoe Having the same issue. Have you found something out? |
I got it to work, however that project has since been archived. I can see I used these packages, that might help you: In the current project I'm working on we took a different approach, to avoid these dependencies, by injecting necessary translations as a property (call it i18n or translations). Route::get('/page', function() {
return Inertia::render('Page', [
'i18n' => [
'title' => __('page.title'),
],
]);
}); Possibly there are optimisation to that approach. |
Export to json and import that. Then pass it in as options. This is how I do it in react import messages from '@/i18n' //json file
import Lang from 'lang.js'
const lang = new Lang({messages, fallback: 'en'}) //this now has the translations loaded |
I do like this
After i can import my json translations correctly |
I am struggling to use this after I switched to Vite. Maybe someone solved it?
The text was updated successfully, but these errors were encountered: