Skip to content

Commit

Permalink
Update TranslateDataObjectExtension.php
Browse files Browse the repository at this point in the history
  • Loading branch information
chromos33 authored Nov 25, 2024
1 parent 27efd81 commit f6f4de0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Extensions/TranslateDataObjectExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ public function onBeforeWrite()
if (array_key_exists("Translate", $this->owner->getChangedFields(false, 1))) {
if ($this->owner->getChangedFields(false, 1)["Translate"]["after"] == 1) {
$sourcelocale = $this->owner->getChangedFields(false, 1)["OriginalLanguage"]["after"];
$tmp = explode('_', Locale::getCurrentLocale()->Locale);
$targetlocale = strtoupper($tmp[0]);
$targetlocale = str_replace("_","-",Locale::getCurrentLocale()->Locale);

$targetlocale = strtoupper($targetlocale);
$localisedFields = [];
$includedTables = [];
$baseClass = $this->owner->baseClass();
Expand Down

0 comments on commit f6f4de0

Please sign in to comment.