Skip to content

Commit 0659a10

Browse files
committed
bug #2060 [Translator] Revert #1965, which break cache warmup for Symfony applications (Kocal)
This PR was merged into the 2.x branch. Discussion ---------- [Translator] Revert #1965, which break cache warmup for Symfony applications | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Issues | Fix #2056 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Hi everyone! It looks like we were too fast on #1965, and our tests base didn't see the issue. With 2.19.0, people started to have issues with the CacheWarmer from UX Translator, which was... simply never called, and so the folder `var/translations` was not generated anymore. In private, we've decided to revert the feature to fix the issue, and to re-open the discussion if necessary. Commits ------- baf9f5e [Translator] Revert #1965, which break cache warmup for Symfony applications
2 parents 9b0d118 + baf9f5e commit 0659a10

File tree

5 files changed

+0
-56
lines changed

5 files changed

+0
-56
lines changed

src/Translator/doc/index.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ For a better developer experience, TypeScript types definitions are also generat
7171
Then, you will be able to import those JavaScript translations in your assets.
7272
Don't worry about your final bundle size, only the translations you use will be included in your final bundle, thanks to the `tree shaking <https://webpack.js.org/guides/tree-shaking/>`_.
7373

74-
.. note::
75-
76-
This package requires the `translator` to be enabled in your Symfony application. If you don't use the `translator` service, the warmup command will not generate any translations.
77-
7874
Configuring the dumped translations
7975
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8076

src/Translator/src/DependencyInjection/TranslatorCompilerPass.php

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/Translator/src/UxTranslatorBundle.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
namespace Symfony\UX\Translator;
1313

14-
use Symfony\Component\DependencyInjection\ContainerBuilder;
1514
use Symfony\Component\HttpKernel\Bundle\Bundle;
16-
use Symfony\UX\Translator\DependencyInjection\TranslatorCompilerPass;
1715

1816
/**
1917
* @author Hugo Alliaume <[email protected]>
@@ -28,9 +26,4 @@ public function getPath(): string
2826
{
2927
return \dirname(__DIR__);
3028
}
31-
32-
public function build(ContainerBuilder $container): void
33-
{
34-
$container->addCompilerPass(new TranslatorCompilerPass());
35-
}
3629
}

src/Translator/tests/Kernel/FrameworkAppKernel.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ public function registerContainerConfiguration(LoaderInterface $loader)
3838
'secret' => '$ecret',
3939
'test' => true,
4040
'translator' => [
41-
'enabled' => match ($this->environment) {
42-
'test_without_translator' => false,
43-
default => true,
44-
},
4541
'fallbacks' => ['en'],
4642
],
4743
'http_method_override' => false,

src/Translator/tests/UxTranslatorBundleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public static function provideKernels()
2222
{
2323
yield 'empty' => [new EmptyAppKernel('test', true)];
2424
yield 'framework' => [new FrameworkAppKernel('test', true)];
25-
yield 'framework without translator' => [new FrameworkAppKernel('test_without_translator', true)];
2625
}
2726

2827
/**

0 commit comments

Comments
 (0)