Skip to content

Commit

Permalink
Revert "Fix changing dump directory using AssetMapper"
Browse files Browse the repository at this point in the history
This reverts commit a27cfc8
  • Loading branch information
maelanleborgne committed Jun 12, 2024
1 parent a27cfc8 commit e551cff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions src/Translator/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ file. 2 of the new items are::
'path' => 'var/translations/configuration.js',
],

.. caution::

If you change the ``dump_directory`` in your configuration file, you will need to
replace the default ``var/translations/***`` with your new path in the
``importmap.php`` file.

These are then imported in your ``assets/translator.js`` file. This setup is
very similar to working with WebpackEncore. However, the ``var/translations/index.js``
file contains *every* translation in your app, which is not ideal for production
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ public function prepend(ContainerBuilder $container)
if (!$this->isAssetMapperAvailable($container)) {
return;
}
$config = $container->getExtensionConfig('ux_translator')[0];

$container->prependExtensionConfig('framework', [
'asset_mapper' => [
'paths' => [
__DIR__.'/../../assets/dist' => '@symfony/ux-translator',
$config['dump_directory'] => '@app/translations',
'%kernel.project_dir%/var/translations' => 'var/translations',
],
],
]);
Expand Down

0 comments on commit e551cff

Please sign in to comment.