diff --git a/src/Finder/MissingKeysFinder.php b/src/Finder/MissingKeysFinder.php index ea5bac5..3f2a1d6 100644 --- a/src/Finder/MissingKeysFinder.php +++ b/src/Finder/MissingKeysFinder.php @@ -56,7 +56,7 @@ protected function extractMissingTranslations(array $foundStrings, array $jsonTr foreach ($foundStrings as $string) { $string = stripslashes($string); if (! array_key_exists($string, $jsonTranslations)) { - $missingTranslations[$string] = $string; + $missingTranslations[$string] = null; } } diff --git a/tests/Finder/MissingKeysFinderTest.php b/tests/Finder/MissingKeysFinderTest.php index 144df74..60d055e 100644 --- a/tests/Finder/MissingKeysFinderTest.php +++ b/tests/Finder/MissingKeysFinderTest.php @@ -138,13 +138,13 @@ public function findMissingTranslationsFindsPersistentKeysFromConfig(): void #[Test] - public function findMissingTranslatableStringUseKeyAsDefaultValue(): void + public function findMissingTranslatableStringUseNullAsDefaultValue(): void { $multiFunctionFile = $this->createTempFile('multiFunction.php', "findMissingTranslatableStrings([$multiFunctionFile], []); - $this->assertSame(['da.key.test' => 'da.key.test', 'a long string' => 'a long string'], $foundStrings); + $this->assertSame(['da.key.test' => null, 'a long string' => null], $foundStrings); } } diff --git a/tests/TranslationManagerTest.php b/tests/TranslationManagerTest.php index 80ca5fe..3876600 100644 --- a/tests/TranslationManagerTest.php +++ b/tests/TranslationManagerTest.php @@ -77,9 +77,9 @@ public function translationsAreAppendedWhenNotUsingTranslationService(): void $this->jsonFilePath ); $this->assertEquals([ - 'app.title' => 'app.title', - 'Something cool ' => 'Something cool ', - 'greeting' => 'greeting', + 'app.title' => null, + 'Something cool ' => null, + 'greeting' => null, ], $missingTranslations); }