Skip to content

Commit

Permalink
Create library translation fix (#179)
Browse files Browse the repository at this point in the history
Co-authored-by: Tomasz Smolarek <tomasz.smolarek@escolasoft.com>
  • Loading branch information
dyfero and dyfero authored Nov 14, 2022
1 parent c9fbd75 commit 31122bd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Repositories/H5PLibraryLanguageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ public function create(H5PLibrary $library, string $languageCode): ?H5PLibraryLa

return H5PLibraryLanguage::firstOrCreate([
'library_id' => $library->getKey(),
'language_code' => $languageCode,
'translation' => $translation,
]);
'language_code' => $languageCode
], ['translation' => $translation,]);
}

public function createDefaults(H5PLibrary $library, string $languageCode, string $translation): ?H5PLibraryLanguage
Expand All @@ -67,8 +66,7 @@ public function createDefaults(H5PLibrary $library, string $languageCode, string
return H5PLibraryLanguage::firstOrCreate([
'library_id' => $library->getKey(),
'language_code' => $languageCode,
'translation' => $localTranslation ?: $translation,
]);
], ['translation' => $localTranslation ?: $translation]);
}

private function getLibraryTranslation(string $langCode, string $libraryName): ?string
Expand Down

0 comments on commit 31122bd

Please sign in to comment.