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

How would i translate the message. #423

Closed
Aujicini opened this issue Jun 5, 2020 · 2 comments
Closed

How would i translate the message. #423

Aujicini opened this issue Jun 5, 2020 · 2 comments

Comments

@Aujicini
Copy link
Contributor

Aujicini commented Jun 5, 2020

When i try to translate the error message i get errors. How would i accomplish this.

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Laratrust Middleware
    |--------------------------------------------------------------------------
    |
    | This configuration helps to customize the Laratrust middleware behavior.
    |
    */

    'middleware' => [

        'register' => true,
        'handling' => 'abort',
        'handlers' => [
            'abort' => [
                'code' => 403,
                'message' => '', // Translation functions do not work in the configuration files.
            ],
            'redirect' => [
                'url' => '/home',
                'message' => [
                    'key' => 'error',
                    'content' => '',
                ]
            ]
        ]

    ],

];

?>
@Aujicini
Copy link
Contributor Author

Aujicini commented Jun 5, 2020

I think you need to make a publishable language file for this package. In Laravel translation of texts should not be done in the configuration files.

@zohaibhassan156
Copy link

It will be fixed by #650

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

No branches or pull requests

3 participants