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

Question: How best to support multilingual models #103

Closed
johnshepherd opened this issue May 21, 2015 · 2 comments
Closed

Question: How best to support multilingual models #103

johnshepherd opened this issue May 21, 2015 · 2 comments

Comments

@johnshepherd
Copy link

I'd like to use a package such as dimsav/laravel-translatable to support multilingual models and edit these through the Admin (v3). What would be the recommended way of doing this? I'm not looking for a completed solution, just an opinion on what the best way would be to tackle it?

Thanks!

@sleeping-owl
Copy link
Owner

I've used that package. And there is my solution:

  • Create middleware to set locale for admin (https://gist.github.com/sleeping-owl/7ccb20cb3fc1f2494911)
  • Add it as global middleware in Kernel.php
  • Create controller with action that changes session admin.locale value
  • Override header template and add language selection block (resources/views/vendor/admin/default/_partials/header.blade.php)

Administrator can select locale and show/edit only this locale.

@johnshepherd
Copy link
Author

Wonderful thank you, didn't think of that approach.

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