I believe that due to a recent change in \Illuminate\Translation\Translator, empty translation keys now also result in the translation key being show, instead of just the empty string.
This commit added an empty check: https://github.com/laravel/framework/commit/02e983e7bf56a7febe9370d4e54d5f2cbf911751
empty return true when a string is empty, but an empty translation is a valid one. I believe isset should be used.
Here's a simple test case taken from https://github.com/spatie/laravel-translation-loader/blob/master/tests/DummyManagerTest.php
/** @test */
public function it_can_translate_using_dummy_manager_using_empty_translation_in_db()
{
$this->createLanguageLine('file', 'key', ['en' => '']);
$this->assertSame('', trans('file.key'));
}
I may need to note this as a breaking change.
This seems to be expected behavior given current state of code just needs to be documented.
@taylorotwell This also affects Laravel 6 and 7 causing a breaking change there.
We've reverted this and will patch Laravel 6, 7 & 8 soon. Thanks for reporting @brendt.
Awesome, thanks
Most helpful comment
We've reverted this and will patch Laravel 6, 7 & 8 soon. Thanks for reporting @brendt.
https://github.com/laravel/framework/pull/34228