From 3cd8a743c85eb5cbbf932a09ca3bf3b44d8e575f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Wi=C5=9Bniewski?= <58150098+daVitekPL@users.noreply.github.com> Date: Fri, 15 Nov 2024 09:47:56 +0100 Subject: [PATCH] Fix lang script (#217) --- src/Services/HeadlessH5PService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Services/HeadlessH5PService.php b/src/Services/HeadlessH5PService.php index 180cdb5..1f95d51 100644 --- a/src/Services/HeadlessH5PService.php +++ b/src/Services/HeadlessH5PService.php @@ -26,6 +26,7 @@ use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\URL; use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Str; use JsonSerializable; class HeadlessH5PService implements HeadlessH5PServiceContract @@ -843,7 +844,7 @@ private function getEditorLangScript(string $lang, string $h5pEditorDir): string if ($lang === 'pl') { $resourceFile = __DIR__ . '/../../resources/lang/' . $lang . '/h5p.js'; - !File::exists($resourceFile) ?: File::replace($h5pEditorDir . $language_script, File::get($resourceFile)); + !File::exists($resourceFile) ?: Storage::put(Str::after($h5pEditorDir, env('AWS_URL')) . $language_script, File::get($resourceFile)); } return $language_script;