For fields, translation is specified in /app/lang/{lang}.json
How can I set a translation for a content group?
In the app/lang/{lang}.json file:
{
"Updated news": "Lang lang"
}
I tried that - it doesn’t work.
This would work if in the getEntryTypeOptions method of the EntryBlueprint class (modules/tailor/classes/blueprint/EntryBlueprint.php)
the translation function was specified, now it looks like this:
public function getEntryTypeOptions(): array
{
if (!is_array($this->groups)) {
return [];
}
$options = [];
foreach ($this->groups as $handle => $entry) {
$options[$handle] = $entry['name'] ?? $handle;
}
return $options;
}
and a working solution would be like this:
public function getEntryTypeOptions(): array
{
if (!is_array($this->groups)) {
return [];
}
$options = [];
foreach ($this->groups as $handle => $entry) {
$options[$handle] = trans($entry['name'] ?? $handle);
}
return $options;
}