Skip to content

Commit 18a18d1

Browse files
committed
bug #1913 [Translator] Revert Fix changing dump directory using AssetMapper (maelanleborgne)
This PR was merged into the 2.x branch. Discussion ---------- [Translator] Revert Fix changing dump directory using AssetMapper | Q | A | ------------- | --- | Bug fix? | yes | New feature? |no | Issues | #1904 (comment) | License | MIT [This PR ](#1904) introduced a bug : when using 'var/translations' in the `importmap.php` file instead of a relative path, it would break the twig `importmap()` function. ~~This PR aims to rectify this regression by keeping a 'var/translations' namespace pointing to the dump_directory. If this is not accepted, the previous PR should be reverted to prevent users using 'var/translations' in there `importmap.php` to face this issue, but the documentation should still be updated to display an example using the relative path instead of a misleading namespace.~~ This PR reverts the change. A word in the doc to say that the `dump_directory` conf is not compatible with asset_mapper would be nice. Commits ------- e551cff Revert "Fix changing dump directory using AssetMapper"
2 parents 3b65275 + e551cff commit 18a18d1

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/Translator/doc/index.rst

-6
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,6 @@ file. 2 of the new items are::
138138
'path' => 'var/translations/configuration.js',
139139
],
140140

141-
.. caution::
142-
143-
If you change the ``dump_directory`` in your configuration file, you will need to
144-
replace the default ``var/translations/***`` with your new path in the
145-
``importmap.php`` file.
146-
147141
These are then imported in your ``assets/translator.js`` file. This setup is
148142
very similar to working with WebpackEncore. However, the ``var/translations/index.js``
149143
file contains *every* translation in your app, which is not ideal for production

src/Translator/src/DependencyInjection/UxTranslatorExtension.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ public function prepend(ContainerBuilder $container)
4343
if (!$this->isAssetMapperAvailable($container)) {
4444
return;
4545
}
46-
$config = $container->getExtensionConfig('ux_translator')[0];
46+
4747
$container->prependExtensionConfig('framework', [
4848
'asset_mapper' => [
4949
'paths' => [
5050
__DIR__.'/../../assets/dist' => '@symfony/ux-translator',
51-
$config['dump_directory'] => '@app/translations',
51+
'%kernel.project_dir%/var/translations' => 'var/translations',
5252
],
5353
],
5454
]);

0 commit comments

Comments
 (0)