From 115e534a14cf8473c03d09c185f470b011bba399 Mon Sep 17 00:00:00 2001 From: alexandrutabolcea Date: Fri, 26 Oct 2018 20:25:54 +0300 Subject: [PATCH 1/2] Update Writer.php Consider replacing empty with !isset || strlen == 0 there is a bug when translation value is "0" if (empty($translation[$locale])) { continue; } if (!isset($translation[$locale]) || strlen($translation[$locale]) == 0) { continue; } --- src/Translation/Writer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Translation/Writer.php b/src/Translation/Writer.php index c618e04..5028cb4 100644 --- a/src/Translation/Writer.php +++ b/src/Translation/Writer.php @@ -97,7 +97,7 @@ protected function buildTranslationsForFile($fileTranslations) // For instance, we have `app.title` that is the same for each locale, // We dont want to translate it to every locale, and prefer letting // Laravel default back to the default locale. - if (empty($translation[$locale])) { + if (!isset($translation[$locale]) || strlen($translation[$locale]) == 0) { continue; } From 3bd23b6bf5ae61a9bccc267cff5c4ec1619deb60 Mon Sep 17 00:00:00 2001 From: Nassif Bourguig Date: Wed, 16 Jan 2019 09:12:07 +0100 Subject: [PATCH 2/2] Removing strlen(0). Sometime we need to keep an empty translation. --- src/Translation/Writer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Translation/Writer.php b/src/Translation/Writer.php index 5028cb4..a230cfa 100644 --- a/src/Translation/Writer.php +++ b/src/Translation/Writer.php @@ -97,7 +97,7 @@ protected function buildTranslationsForFile($fileTranslations) // For instance, we have `app.title` that is the same for each locale, // We dont want to translate it to every locale, and prefer letting // Laravel default back to the default locale. - if (!isset($translation[$locale]) || strlen($translation[$locale]) == 0) { + if (!isset($translation[$locale])) { continue; }