Skip to content

Commit

Permalink
Update site translations to popup translation key
Browse files Browse the repository at this point in the history
  • Loading branch information
sircxes committed Dec 6, 2024
1 parent 261cb8b commit 0643171
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/View/Helper/MelisSiteTranslationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,20 @@ public function __invoke($key, $langId, $siteId)
$cacheData = $siteTransSrv->getCachedTranslations($siteId);
}
$str = $cacheData[$langId][$key] ?? $key;



if(!empty($this->getView()->renderMode)){
if($this->getView()->renderMode != 'front'){
$str = '<span title="'.$key.'">'.$str.'</span>';
}
}else{//try to check uri if we are in BO
$uri = $_SERVER['REQUEST_URI'];
$uri = explode('/', $uri);
if(in_array('renderMode', $uri)){
$str = '<span title="'.$key.'">'.$str.'</span>';
}
}

return $str;
}
}

0 comments on commit 0643171

Please sign in to comment.