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

Missing localization for owner role name #836

Closed
wants to merge 1 commit into from

Conversation

rinodrummer
Copy link

Working on with my issue (#833), I've seen that OwnerRole was missing of the localization.

@crynobone
Copy link
Member

Initializing translation during construct will load translation way before middleware (where we normally set locale based on user session etc), this can cause unexpected results in some scenarios.

PR #798 already cover this requirement and only use translation when we want to use it on the views.

@rinodrummer
Copy link
Author

So , thanks to the definition in JeststreamServiceProvider, other roles have a translated name by default, like this:

Jetstream::role('admin', __('Administrator'), [
    'create',
    'read',
    'update',
    'delete',
])->description(__('Administrator users can perform any action.'));

For example, if execute this code with Italian language set as default:

{{ $role->name }} 

It prints "Amministratore" instead of "Administrator".

How can it be achieved with OwnerRole?

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

Successfully merging this pull request may close these issues.

3 participants