Skip to content

Commit

Permalink
Merge pull request #2 from CaReS0107/1.1.1
Browse files Browse the repository at this point in the history
Added stripslashes support
  • Loading branch information
CaReS0107 authored Mar 5, 2024
2 parents 1cf647c + f128c08 commit 8f8ee94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Commands/TranslatableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ public function handle(): int

if (preg_match_all("/__\(['\"](.*?)['\"]\)/", $content, $matches)) {
foreach ($matches[1] as $match) {
$match = stripslashes($match);
$this->info("Found translation: $match in file ".$phpFile->getRealPath());

foreach ($translatableFilePaths as $path) {
$translationContent = json_decode(file_get_contents($path), true);
$translationContent = json_decode(file_get_contents($path), true, 512, JSON_THROW_ON_ERROR);

if (! array_key_exists($match, $translationContent)) {
$translationContent[$match] = '';
Expand Down

0 comments on commit 8f8ee94

Please sign in to comment.