trafficker
trafficker

Reputation: 601

How do I correctly translate the activation email in Laravel 5.8?

How do I translate the activation email after registration (build Auth in Laravel)?

I've made this translation in pl/pl.json:

"If you’re having trouble clicking the": "Jeśli masz problem z kliknięciem", "button, copy and paste the URL below": " to skopiuj i wklej poniższy adres URL ", "into your web browser": " do przeglądarki internetowej"

but in mail I have this:

If you’re having trouble clicking the "Zweryfikuj adres email" button, copy and paste the URL below into your web browser: http://domain.test/email/verify/8?expires=1558113166&signature=2deea0aa937119efbf99ebbfc73bbf985f373491b47b0dcdfc76ee3b6dad6aeb

This is a mix of Polish and English. So I believe my translation is not working.

Upvotes: 1

Views: 3507

Answers (2)

Kadir Bay
Kadir Bay

Reputation: 1

I just created a new laravel 11 project. The translation of the other lines is correct but only this line remains in English. I finally discovered why it doesn't work, it's because of the character, just like in your code. ' should be used instead.

Use this:

"If you're having trouble clicking...

Instead of this:

"If you’re having trouble clicking...

Upvotes: 0

Rafał G.
Rafał G.

Reputation: 1682

Judging by the contents of this file:

https://github.com/laravel/framework/blob/5.8/src/Illuminate/Notifications/resources/views/email.blade.php

I think you need a different translation:

{ "If you’re having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser: [:actionURL](:actionURL)": "Jeśli masz problem z kliknięciem \":actionText\" to skopiuj i wklej poniższy adres URL do przeglądarki internetowej: [:actionURL](:actionURL)" }

As for adding a logo, you can run

php artisan vendor:publish --tag=laravel-notifications

and the email.blade.php file should be added to resources/views/vendor/notifications.

Upvotes: 5

Related Questions