Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cfa0484

Browse files
authoredJun 5, 2023
Do not use dot notation for sentences (#443)
1 parent 17f5f11 commit cfa0484

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/Manager.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ protected function makeTree($translations, $json = false)
347347
{
348348
$array = [];
349349
foreach ($translations as $translation) {
350-
if ($json) {
350+
// For JSON and sentences, do not use dotted notation
351+
if ($json || Str::contains($translation->key, [' ']) || Str::endsWith($translation->key, ['.'])) {
351352
$this->jsonSet($array[$translation->locale][$translation->group], $translation->key,
352353
$translation->value);
353354
} else {

0 commit comments

Comments
 (0)
Please sign in to comment.