|
12 | 12 | use Illuminate\Support\Facades\App; |
13 | 13 | use Illuminate\Support\Facades\Cache; |
14 | 14 | use Illuminate\Support\Facades\Gate; |
| 15 | +use Illuminate\Support\Str; |
15 | 16 | use Symfony\Component\Finder\Finder; |
16 | 17 | use Vsch\TranslationManager\Classes\PathTemplateResolver; |
17 | 18 | use Vsch\TranslationManager\Classes\TranslationFileRewriter; |
@@ -656,7 +657,7 @@ public function cachedTranslations($namespace, $group, $locale, $translations = |
656 | 657 | $localePrefix = "$locale:"; |
657 | 658 | $prefixLen = strlen($localePrefix); |
658 | 659 | foreach ($values as $key => $translation) { |
659 | | - if (str_starts_with($key, $localePrefix)) { |
| 660 | + if (Str::startsWith($key, $localePrefix)) { |
660 | 661 | $transKey = substr($key, $prefixLen); |
661 | 662 | $translations[$transKey] = $translation; |
662 | 663 | } |
@@ -1297,8 +1298,8 @@ function findTranslations($path = null) |
1297 | 1298 | foreach ($matches[3] as $index => $key) { |
1298 | 1299 | $quote = $matches[2][$index][0]; |
1299 | 1300 | $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, ["$", "\"", "'", "->",]) |
1302 | 1303 | ) { |
1303 | 1304 | if ($fileLines == null) { |
1304 | 1305 | $fileLines = self::computeFileLines($fileContents); |
|
0 commit comments