Skip to content

snake method of String component returns a non clean string #57629

Closed
@sebdeleze

Description

@sebdeleze

Symfony version(s) affected

7.0.9

Description

Since version 7.0.9, the behavior of the snake method has changed. This problem was detected during the dump of translations in symfony/ux-translator.

Now, the translation keys are incorrect, because the braces and the dots are preserved, as you can see on this screenshot:

Capture d’écran 2024-07-03 à 08 49 59

Not sure it's the desired behavior, but if it's the case I will open another issue for translator dumper.

How to reproduce

s('The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.')->ascii()->snake()->toString()

Before 7.0.9, this instruction returns the string the_file_is_too_large_allowed_maximum_size_is_limit_suffix

Since 7.0.9, this instruction returns the string the_file_is_too_large._allowed_maximum_size_is_{{_limit_}}_{{_suffix_}}., with braces and dot at the end.

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