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

[Bug] Missing translation for reset password email #5376

Closed
realtebo opened this issue Nov 21, 2023 · 4 comments
Closed

[Bug] Missing translation for reset password email #5376

realtebo opened this issue Nov 21, 2023 · 4 comments
Labels

Comments

@realtebo
Copy link
Contributor

realtebo commented Nov 21, 2023

Bug report

What I did

I tried to reset a password from an italian localized installation

I already have config/app.php setup for

'locale' => 'it',
'fallback_locale' => 'en',

And in config/backpack/crud.php I have

'locales' => [
 ...
'en' => 'English',
...
'it' => 'Italian',
...
]

What I expected to happen

I expected to see the reset password email fully localized into italian

What happened

A part of email is not translated

image

This is the default email.blade.php file for notifications

vendor/laravel/framework/src/Illuminate/Notifications/resources/views/email.blade.php

What I've already tried to fix it

Actually we exported the email.blade.php and forced italian text

Is it a bug in the latest version of Backpack?

After I run composer update backpack/crud the bug... is it still there?

Yes

Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

λ php artisan backpack:version
### PHP VERSION:
PHP 8.2.8 (cli) (built: Jul  4 2023 15:53:15) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.2.8, Copyright (c) Zend Technologies

### LARAVEL VERSION:
10.31.0.0

### BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.2.1
backpack/crud: 6.3.0
backpack/generators: v4.0.2
backpack/permissionmanager: 7.1.1
backpack/pro: 2.0.18
backpack/theme-tabler: 1.1.1

@pxpm
Copy link
Contributor

pxpm commented Nov 21, 2023

Hey @realtebo as you can see, that file is part of core Laravel. I am not 100% sure if https://github.com/Laravel-Lang/lang already provide a translation for it.

If not, you can manually add a translation for that string by creating a file in lang/it.json and add that string:

 "If you’re having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:": "Se tiver problemas em clicar no botão \":actionText\" , copie e cole o seguinte URL no seu browser:",

More info on https://laravel.com/docs/10.x/localization#defining-translation-strings

Basically, as you can see on the file that you mentioned it runs through @lang directive so you can translate it using Laravel methods.

I am closing this as I don't think there is any bug on our side here.
I may be wrong, so feel free to re-open, or continue the conversation and we can re-evalute.

Cheers 🙏

@pxpm pxpm closed this as completed Nov 21, 2023
@realtebo
Copy link
Contributor Author

I confirm, and understand all the line you follow.

But I am pretty sure it should be included in the lang file of backpack, if possibile, so when we start a project, localized, it is complete.

@realtebo
Copy link
Contributor Author

Also here
image

Having some pieces localized and some not is not ... optimal.

I suggest, at least, to add a clear documentation alert about how to complete localization.

@pxpm
Copy link
Contributor

pxpm commented Nov 21, 2023

I've edited the docs a little bit more to make it clear that some translations are not provided by backpack here: Laravel-Backpack/docs#523

We think the https://github.com/Laravel-Lang/lang package is an easy way to have all those strings translated in most of the languages. If something is missing you can submit a PR there, I am sure they will appreciate it 🙏

Let me know if I can help you with something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants