You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just updated my Symfony project from Symfony 7.1 to 7.2.0.
Now, when I run the command bin/console lint:container, I get this error:
[ERROR] Invalid definition for service "console.command.translation_lint": argument 1 of "Symfony\Component\Translation\Command\TranslationLintCommand::__construct()" accepts "Symfony\Contracts\Translation\TranslatorInterface&Symfony\Component\Translation\TranslatorBagInterface", "Symfony\Component\Translation\PseudoLocalizationTranslator" passed.
I tried using the --resolve-env-vars parameter: same error.
I also receive the same error in both the dev and production environments.
This is my translation.yaml file:
# config/packages/translation.yamlframework:
default_locale: '%locale%'# Read from parameters.localeenabled_locales: '%locales%'# Read from parameters.localestranslator:
default_path: '%kernel.project_dir%/translations'# This option is used when the translation key for the current locale wasn't found | default: the value of default_localefallbacks:
- '%locale%'providers:
pseudo_localization:
# replace characters by their accented versionaccents: false# wrap strings with bracketsbrackets: false# controls how many extra characters are added to make text longerexpansion_factor: 1# maintain the original HTML tags of the translated contentsparse_html: true# also translate the contents of these HTML attributes#localizable_html_attributes: ['title']when@prod:
framework:
translator:
pseudo_localization:
accents: falsebrackets: false
If I comment out the pseudo_localization: block, the error goes away.
# config/packages/translation.yamlframework:
translator:
pseudo_localization:
# replace characters by their accented versionaccents: true# wrap strings with bracketsbrackets: true# controls how many extra characters are added to make text longerexpansion_factor: 1.4# maintain the original HTML tags of the translated contentsparse_html: true# also translate the contents of these HTML attributeslocalizable_html_attributes: ['title']
How to reproduce
Run the command bin/console lint:container with:
# config/packages/translation.yamlframework:
translator:
pseudo_localization:
# replace characters by their accented versionaccents: true# wrap strings with bracketsbrackets: true# controls how many extra characters are added to make text longerexpansion_factor: 1.4# maintain the original HTML tags of the translated contentsparse_html: true# also translate the contents of these HTML attributeslocalizable_html_attributes: ['title']
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered:
SindlaXYZ
changed the title
bin/console lint:container - Invalid definition for service "console.command.translation_lint"
bin/console lint:container - Invalid definition for service "console.command.translation_lint" with "pseudo_localization"
Dec 5, 2024
…ibility with the `PseudoLocalizationTranslator` (xabbuh)
This PR was merged into the 7.2 branch.
Discussion
----------
[FrameworkBundle][Translation] fix translation lint compatibility with the `PseudoLocalizationTranslator`
| Q | A
| ------------- | ---
| Branch? | 7.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix#59101
| License | MIT
Commits
-------
2695871 fix translation lint compatibility with the PseudoLocalizationTranslator
Symfony version(s) affected
7.2.0
Description
I just updated my Symfony project from Symfony 7.1 to 7.2.0.
Now, when I run the command
bin/console lint:container
, I get this error:[ERROR] Invalid definition for service "console.command.translation_lint": argument 1 of "Symfony\Component\Translation\Command\TranslationLintCommand::__construct()" accepts "Symfony\Contracts\Translation\TranslatorInterface&Symfony\Component\Translation\TranslatorBagInterface", "Symfony\Component\Translation\PseudoLocalizationTranslator" passed.
I tried using the
--resolve-env-vars
parameter: same error.I also receive the same error in both the dev and production environments.
This is my
translation.yaml
file:If I comment out the
pseudo_localization:
block, the error goes away.I encountered the same error with the
translation.yaml
example from https://symfony.com/doc/current/translation.html.How to reproduce
Run the command
bin/console lint:container
with:Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: