-
Docs explain you can enable pseudo-localization in your YAML settings file: # config/packages/translation.yaml
framework:
translator:
pseudo_localization:
# replace characters by their accented version
accents: true
# wrap strings with brackets
brackets: true
# controls how many extra characters are added to make text longer
expansion_factor: 1.4
# maintain the original HTML tags of the translated contents
parse_html: true
# also translate the contents of these HTML attributes
localizable_html_attributes: ['title'] Is there a way to have it disabled by default, but be able to enable it by setting a parameter? I can read such parameter with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes: # config/packages/translation.yaml
framework:
translator:
pseudo_localization:
enabled: '%localization.pseudo_localization_enabled%'
expansion_factor: 1.4
parse_html: true
localizable_html_attributes: ['title'] Note that if enabling the pseudo-localization only depends on the environment you should leverage Symfony’s way: https://symfony.com/doc/current/configuration.html#configuration-environments |
Beta Was this translation helpful? Give feedback.
Yes:
pseudo_localization
can be enabled by configuring any of its options like you did, but it also has anenabled
option you can set tofalse
to disable it. So you could write something likeNote that if enabling the pseudo-localization only depends on the environment you should leverage Symfony’s way: https://symfony.com/doc/current/configuration.html#configuration-environments