Skip to content

Symfony translator shows curly braces around vars #39854

@Ser5

Description

@Ser5

Symfony version(s) affected: 4.4.18

Description
See there for the reproduction project:
https://github.com/Ser5/SymfonyTranslatorBug

I want to use the Symfony validators library in standalone mode. Therefore, AFAIK, I should also use the translator library, but during experiments with it I found that it doesn't work as I expected.

According to these docs
https://symfony.com/doc/current/components/form.html
I installed symfony/config and symfony/translation packages via Composer.

According to these
https://symfony.com/doc/current/translation/message_format.html
created messages file and index.php file.

Then ran index.php.
expected:

Hello Fabien!
Hello Symfony!

got:

Hello {Fabien}!
Hello {Symfony}!

How to reproduce

git clone https://github.com/Ser5/SymfonyTranslatorBug.git
cd SymfonyTranslatorBug/lib/
composer install
cd ../
php index.php

Possible Solution
May be one of these problems:

  • I have read the docs wrong - where?
  • Docs are unclear - clear them
  • Docs are outdated - update them
  • Libs are buggy - fix them

Additional context
Windows 10
PHP 7.2.4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions