Skip to content

Commit 09d47fd

Browse files
committed
Merge branch 'Laravel-7.x' into Laravel-8.x
2 parents d855512 + 088c70a commit 09d47fd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Controller.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Illuminate\Support\Facades\Response;
1313
use Illuminate\Support\Facades\Route;
1414
use Illuminate\Support\Facades\View;
15+
use Illuminate\Support\Str;
1516
use Symfony\Component\HttpFoundation\ParameterBag;
1617
use Vsch\TranslationManager\Classes\TranslationLocales;
1718
use Vsch\TranslationManager\Events\TranslationsPublished;
@@ -245,7 +246,7 @@ public function isLocaleEnabled($locale)
245246
$packLocales = TranslationLocales::packLocales($this->transLocales->userLocales);
246247
if (!is_array($locale)) $locale = array($locale);
247248
foreach ($locale as $item) {
248-
if (!str_contains($packLocales, ',' . $item . ',')) return false;
249+
if (!Str::contains($packLocales, ',' . $item . ',')) return false;
249250
}
250251
return true;
251252
}

src/Manager.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Illuminate\Support\Facades\App;
1313
use Illuminate\Support\Facades\Cache;
1414
use Illuminate\Support\Facades\Gate;
15+
use Illuminate\Support\Str;
1516
use Symfony\Component\Finder\Finder;
1617
use Vsch\TranslationManager\Classes\PathTemplateResolver;
1718
use Vsch\TranslationManager\Classes\TranslationFileRewriter;
@@ -656,7 +657,7 @@ public function cachedTranslations($namespace, $group, $locale, $translations =
656657
$localePrefix = "$locale:";
657658
$prefixLen = strlen($localePrefix);
658659
foreach ($values as $key => $translation) {
659-
if (str_starts_with($key, $localePrefix)) {
660+
if (Str::startsWith($key, $localePrefix)) {
660661
$transKey = substr($key, $prefixLen);
661662
$translations[$transKey] = $translation;
662663
}
@@ -1297,8 +1298,8 @@ function findTranslations($path = null)
12971298
foreach ($matches[3] as $index => $key) {
12981299
$quote = $matches[2][$index][0];
12991300
$keyValue = $key[0];
1300-
if ($quote == '\'' && !str_contains($keyValue, ["\"", "'", "->",]) ||
1301-
$quote == '"' && !str_contains($keyValue, ["$", "\"", "'", "->",])
1301+
if ($quote == '\'' && !Str::contains($keyValue, ["\"", "'", "->",]) ||
1302+
$quote == '"' && !Str::contains($keyValue, ["$", "\"", "'", "->",])
13021303
) {
13031304
if ($fileLines == null) {
13041305
$fileLines = self::computeFileLines($fileContents);

0 commit comments

Comments
 (0)