Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Symfony translator shows curly braces around vars #39854

Copy link
Copy link
Closed
@Ser5

Description

@Ser5
Issue body actions

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.