Skip to content

Commit 2ea8d3f

Browse files
committed
Changes for translation loader
1 parent 9fac8b2 commit 2ea8d3f

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"contao/core-bundle": "^4.13.0 <5.0",
3838
"metamodels/core": "^2.3.0@dev",
3939
"symfony/dependency-injection": "^5.4",
40-
"symfony/http-kernel": "^5.4"
40+
"symfony/http-kernel": "^5.4",
41+
"symfony/translation": "^5.4"
4142
},
4243
"require-dev": {
4344
"contao/manager-plugin": "^2.1",

src/Translator/TranslationLoader.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public function load(IMetaModel $metaModel, string $locale): MessageCatalogue
6363

6464
foreach ($this->builder->fetchAllInputScreensForTable($domain) as $inputScreen) {
6565
foreach (
66-
$this->loadInputScreen($metaModel, $inputScreen, $locale, $mainLanguage, $domain)->all($domain) as
67-
$key => $value
66+
$this->loadInputScreen($metaModel, $inputScreen, $locale, $mainLanguage, $domain)
67+
->all($domain) as $key => $value
6868
) {
6969
$catalog->set($key, $value, $domain);
7070
}
@@ -134,11 +134,11 @@ private function wantToAdd(IAttribute $attribute, array $properties): bool
134134
&& (in_array($attribute->getColName(), $properties, true));
135135
}
136136

137-
private function getName(IAttribute $attribute, string $locale, $mainLanguage)
137+
private function getName(IAttribute $attribute, string $locale, string $mainLanguage): string
138138
{
139-
$colName = $attribute->getColName();
140-
$name = $attribute->get('name') ?? $colName;
141-
$description = $attribute->get('description') ?? '';
139+
$colName = $attribute->getColName();
140+
$name = $attribute->get('name') ?? $colName;
141+
142142
return $this->extractLangString($name, $locale, $mainLanguage) ?? $colName;
143143
}
144144

0 commit comments

Comments
 (0)