diff --git a/src/TranslationPayload.php b/src/TranslationPayload.php index 4d69c46..8a73724 100755 --- a/src/TranslationPayload.php +++ b/src/TranslationPayload.php @@ -44,12 +44,12 @@ private function phpTranslations(string $locale): array return collect(File::allFiles($path))->mapWithKeys(function (\SplFileInfo $file) use ($locale) { $key = str($file->getPathname()) ->replace([lang_path(), '.php'], '') - ->replace('/'.$locale.'/', '') + ->replace(DIRECTORY_SEPARATOR.$locale.DIRECTORY_SEPARATOR, '') ->toString(); - $keyPath = explode('/', $key); + $keyPath = explode(DIRECTORY_SEPARATOR, $key); $keyPath = array_reverse($keyPath); return [ - str($key)->replace('/', '.')->toString() => trans($key, [], $locale) + str($key)->replace(DIRECTORY_SEPARATOR, '.')->toString() => trans($key, [], $locale) ]; })->undot()->toArray(); }