Skip to content

Commit

Permalink
Merge pull request #13 from bildschirmartist/bugfix-localized-languages
Browse files Browse the repository at this point in the history
Fixes problem with the  when using MetaModels with localized languages
  • Loading branch information
amenk authored Oct 5, 2022
2 parents 4ecc772 + da18809 commit 63fac9e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contao/classes/ImiMMChangeLanguageObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ public function translateMMUrlsV3(
// The target root page for current event
$targetRoot = $event->getNavigationItem()->getRootPage();
$targetLanguage = $targetRoot->language; // The target language
// since metamodels supports localization inside the languages (e.g. de-AT), these language codes
// need to be converted from e.g. de-AT to de_AT when calling getTranslatedDataFor-method
$targetLanguage = str_replace('-', '_', $targetLanguage);

$factory = $this->getMMFactory();

Expand Down

0 comments on commit 63fac9e

Please sign in to comment.