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

Translation manager doesn't stores new sentences to database #139

Open
protectedfor opened this issue Oct 25, 2018 · 3 comments
Open

Translation manager doesn't stores new sentences to database #139

protectedfor opened this issue Oct 25, 2018 · 3 comments

Comments

@protectedfor
Copy link

In my view I've added a new translation line, for example {{ trans('header.home') }}. Refreshed the page, but in translation manager this group and key doesn't creates. What I'm doing wrong? It was working perfectly before....

P.S.: Illuminate\Translation\TranslationServiceProvider::class is commented out.

Thanks.

@vsch
Copy link
Owner

vsch commented Oct 26, 2018

@protectedfor, I will investigate it and see if it is a bug that was introduced in some late fixes.

@protectedfor
Copy link
Author

I found what I've missed!
I've added this lines to AppServiceProvider

        \Gate::define('ltm-admin-translations', function ($user) {
            return true;
        });

        \Gate::define('ltm-edit-translations', function ($user) {
            return $user;
        });

        \Gate::define('ltm-bypass-lottery', function ($user) {
            return $user;
        });

        \Gate::define('ltm-list-editors', function ($user, $connection_name, &$user_list) {
            return true;
        });

@vsch
Copy link
Owner

vsch commented Oct 26, 2018

@protectedfor, I would only point out that the way you have defined these functions all users can admin translations, all users can edit translations.

For ltm-bypass-lottery you should return false or just pick out a few users. Since for the users where the result is not false, the lottery is not used to track used translations and used translations will be tracked for all users which may impact performance.

The ltm-list-editors is used by user locale management to get a list of available editors. In your case no users are added to the $user_list so no users will show up in user admin pane.

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