mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 23:16:03 +00:00
language restore entity type translation
This commit is contained in:
@@ -248,6 +248,10 @@ class LanguageService
|
||||
}
|
||||
}
|
||||
|
||||
if (!str_contains($target, '.')) {
|
||||
$this->restoreEntityType($data, $languageObj, $target);
|
||||
}
|
||||
|
||||
$pointer =& $data;
|
||||
|
||||
foreach ($targetArr as $i => $k) {
|
||||
@@ -269,4 +273,17 @@ class LanguageService
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
private function restoreEntityType(&$data, LanguageUtil $languageObj, string $target): void
|
||||
{
|
||||
$data['Global'] ??= [];
|
||||
$data['Global']['scopeNames'] ??= [];
|
||||
$data['Global']['scopeNamesPlural'] ??= [];
|
||||
|
||||
$data['Global']['scopeNames'][$target] = $languageObj->translateLabel($target, 'scopeNames');
|
||||
$data['Global']['scopeNamesPlural'][$target] = $languageObj->translateLabel($target, 'scopeNamesPlural');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user