Skip to content
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

Documentation Question: What do you have to look out for when using "Inertia"? #23

Closed
pmochine opened this issue Jun 28, 2021 · 2 comments

Comments

@pmochine
Copy link

Currently, I'm developing my first Inertia project. Everything that should work works correctly. But I'm still not sure if I'm missing something.

For example do I need: php artisan matice:generate for Inertia?

Currently, I'm just using @translations in my app.blade.php. When I'm switching the languages, I'm using the normal <a> tag, not the Inertia links.

But I noticed that @translations is creating all languages:

de: {auth: {…}, pagination: {…}, passwords: {…}, routes: {…}, validation: {…}}
en: {auth: {…}, pagination: {…}, passwords: {…}, routes: {…}, validation: {…}}
hu: {auth: {…}, pagination: {…}, passwords: {…}, routes: {…}, validation: {…}} 

In #10 you are saying: "In production, matice lazy loads the translations.".

I just tried to set APP_ENV=production but it's still the same. Maybe you mean the generated js file from php artisan matice:generate?

Thank you! And p.s. this is a really great package! Really well done!

@GENL
Copy link
Owner

GENL commented Jun 28, 2021

When using with inertia you should load translations using the blade directive @translations.
In production, the matice_translations.js file is auto-generated by the @translations directive (if the file does not already exist). Matice handles it for you, you don't have to call matice:generate yourself.

@GENL GENL closed this as completed Jul 1, 2021
@pmochine
Copy link
Author

pmochine commented Jul 2, 2021

@GENL thanks btw for the answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants