-
Notifications
You must be signed in to change notification settings - Fork 418
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
Change language in backend #404
Comments
Can you please let me know a little more details about the issue, like which steps did you followed, how can i regenerate the issue? |
like the picture if you change the language from one to two others for example from English to Arabic or English to Vietnamese, the words in the dashboard does not translate and are still in the English language, I don't know if I have explain the issue as well |
thank you for clarification and pointing out the issue. In Laravel there are two different ways to use localization, first approach is Short Keys and another is using json files. The l10n it working elsewhere expect the menu. You are right that the menu items are not changing. I was using json files for these but if you use short keys then these works. Somehow I overlooked this issue. I will try to fix this soon, of you may submit a pull request if you already fixed it. I am using "lavary/laravel-menu" for the menu and I just found out that this package has not been updated for Laravel 10. So I will replace this package soon. So if you want till that time, it will be fixed there. |
thank you for your response @nasirkhan, for now, the only way that I have found to solve this, is to create a table with one line that contains the updated language, and set the new value of language in the middleware, it's like a session storage based on database, I will search more about the issue and push just when I found an appropriate solution. |
As i mentioned in the earlier reply, you can use the translations in the middleware if you use the short keys approach. you may find more details at https://laravel.com/docs/10.x/localization#using-short-keys |
Yes i have see that but both of translation method does not work, i tried the translation with both method before. |
Hello Nasir! Yes this problem in the backend exists in the latest version as of today. The chosen language does not change on the fly in the backend. In the frontend, it is not going to change either because the lang parameter is not saved in contents, i.e. in the database. So currently there is only a cosmetic dropdown to cause an effect of change, however not the language. This issue relates also to one issue I have recently raised #506 . Thanks for noting it as an enhancement. |
@DeRaja , If you know how the content language change feature should work and think it is important to have it in the Starter, then please create a separate issue and describe the feature there. I am always for PRs, please submit pull requests if you already developed this feature for your own projects. |
if you move the session and setLocal middleware from middlewareGroups to middleware that will fix the issue |
Change language in backend does not work such i have verify the code and the execution process but still not understand the issue
The text was updated successfully, but these errors were encountered: