Skip to content

Commit 74756b2

Browse files
committed
Changes for translation loader
1 parent f7a92b0 commit 74756b2

File tree

7 files changed

+31
-32
lines changed

7 files changed

+31
-32
lines changed

.tx/config

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[main]
2+
host = https://app.transifex.com
3+
4+
[o:metamodels:p:attribute-contentarticle:r:tl_metamodel_attribute]
5+
file_filter = src/Resources/translations/tl_metamodel_attribute.<lang>.xlf
6+
source_file = src/Resources/translations/tl_metamodel_attribute.en.xlf
7+
type = XLIFF
8+
minimum_perc = 0
9+
resource_name = tl_metamodel_attribute
10+
replace_edited_strings = false
11+
keep_translations = false

composer.json

+1-7
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"ext-pdo": "*",
3232
"contao-community-alliance/dc-general": "^2.3",
3333
"contao/core-bundle": "^4.13.0 <5.0",
34-
"metamodels/core": "^2.3.0@dev",
34+
"metamodels/core": "^2.3@dev",
3535
"symfony/dependency-injection": "^5.4",
3636
"symfony/http-kernel": "^5.4"
3737
},
@@ -40,12 +40,6 @@
4040
"menatwork/contao-multicolumnwizard-bundle": "^3.4",
4141
"phpcq/runner-bootstrap": "^1.0@dev"
4242
},
43-
"repositories": [
44-
{
45-
"type": "composer",
46-
"url": "https://packages.cyberspectrum.de/r"
47-
}
48-
],
4943
"autoload": {
5044
"psr-4": {
5145
"MetaModels\\AttributeContentArticleBundle\\": "src/"

src/Resources/config/routing.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ metamodels.content-article:
44
_controller: MetaModels\AttributeContentArticleBundle\Controller\Backend\MetaModelController
55
_scope: backend
66
_store_referrer: true
7-
# _contao_referer_id: true
87
_token_check: true
8+
requirements:
9+
itemId: '[a-zA-Z0-9]*'

src/Resources/contao/languages/en/tl_content.php

-21
This file was deleted.

src/Resources/contao/templates/widget_contentarticle.html5

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php if ($this->hasEmptyId): ?>
2-
<p class="tl_error" style="margin-top: 5px; margin-bottom: 5px;"><?= $this->translate('attribute_contentarticle.missing_id') ?></p>
3-
<button type="button" name="<?= $this->name ?>" class="tl_submit" disabled><?= $this->translate('MSC.changeSelection') ?></button>
2+
<p class="tl_error" style="margin-top: 5px; margin-bottom: 5px;"><?= $this->translator->trans('attribute_contentarticle.missing_id', [], 'contao_default') ?></p>
3+
<button type="button" name="<?= $this->name ?>" class="tl_submit" disabled><?= $this->translator->trans('MSC.changeSelection', [], 'contao_default') ?></button>
44
<?php else: ?>
55
<div>
66
<div class="selector_container">
@@ -12,7 +12,7 @@
1212
<?php endforeach; ?>
1313
</ul>
1414
<?php if (!$this->readonly): ?>
15-
<p><a id="ft_<?= $this->name ?>" href="<?= $this->link ?>" class="tl_submit"><?= $this->translate('MSC.changeSelection') ?></a></p>
15+
<p><a id="ft_<?= $this->name ?>" href="<?= $this->link ?>" class="tl_submit"><?= $this->translator->trans('MSC.changeSelection', [], 'contao_default') ?></a></p>
1616
<?php endif; ?>
1717
</div>
1818
<?php if (!$this->readonly): ?>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
3+
<file source-language="en" datatype="plaintext" original="src/Resources/translations/tl_metamodel_attribute.en.xlf">
4+
<body>
5+
<trans-unit id="typeOptions.contentarticle" resname="typeOptions.contentarticle">
6+
<source>Content article</source>
7+
</trans-unit>
8+
<trans-unit id="missing_id" resname="missing_id">
9+
<source>You must save the main data set before you can create new data.</source>
10+
</trans-unit>
11+
</body>
12+
</file>
13+
</xliff>

src/Widgets/ContentArticleWidget.php

+1
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ public function generate()
249249

250250
$content = (new ContaoBackendViewTemplate($this->subTemplate))
251251
->setTranslator($translator)
252+
->set('translator', $this->translator)
252253
->set('name', $this->strName)
253254
->set('id', $this->strId)
254255
->set('label', $this->label)

0 commit comments

Comments
 (0)