From c81fc9940bc083686d20d6afcb7a947dd71c1ecf Mon Sep 17 00:00:00 2001 From: Salem Code Date: Tue, 15 Oct 2024 01:03:55 +0300 Subject: [PATCH] Fix the regex --- src/Actions/SyncPhrasesAction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Actions/SyncPhrasesAction.php b/src/Actions/SyncPhrasesAction.php index a0379d6..cb44eb9 100644 --- a/src/Actions/SyncPhrasesAction.php +++ b/src/Actions/SyncPhrasesAction.php @@ -27,7 +27,7 @@ public static function execute(Translation $source, $key, $value, $locale, $file $isRoot = $file === $locale.'.json' || $file === $locale.'.php'; $extension = pathinfo($file, PATHINFO_EXTENSION); - $filePath = str_replace('.'.$extension, '', preg_replace('/^'.$locale.DIRECTORY_SEPARATOR, '', $file)); + $filePath = str_replace('.'.$extension, '', preg_replace('/^' . preg_quote($locale . DIRECTORY_SEPARATOR, '/') . '/', '', $file)); $translationFile = TranslationFile::firstOrCreate([ 'name' => $filePath,