Search code examples
laravellaravel-breezelaravel-localization

Laravel breeze translation issue: forgot-password.blade.php custom translations not working


I have custom translation files

  • lang/en/passwords.php
  • lang/de/passwords.php

with

return [
    'reset' => 'Your password has been reset.',
    'sent' => 'We have emailed your password reset link.',
    'throttled' => 'Please wait before retrying.',
    'token' => 'This password reset token is invalid.',
    'user' => "If a user with that email address exists, you will receive a password reset email.",
];

and equivalent in de.

My forgot-password.blade.php uses

if ($status != Password::RESET_LINK_SENT) {
        $this->addError('email', __($status));

        return;
}

On passwords.user for example it always returns the error string defined in vendor/laravel/framework/src/Illuminate/Translation/lang/en/passwords.php instead of my custom one.

However if I rename passwords.user to passwords.User and do the same in my custom translation file, the custom translation is returned.

Please advice what I am doing wrong...cleared cache etc, changed session locale, nothing worked except renaming translation keys which is in my opinion a dirty workaround.

Thanks


Solution

  • I am sorry...i finally sorted out the problem...

    I am using Filament with the Plugin https://filamentphp.com/plugins/filament-spatie-translatable

    This overrides all the lang files except the en.json / de.json even for non filament pages.