Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Translator] TranslationsDumper builds invalid constant names #1950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aleho opened this issue Jul 1, 2024 · 8 comments
Closed

[Translator] TranslationsDumper builds invalid constant names #1950

aleho opened this issue Jul 1, 2024 · 8 comments

Comments

@aleho
Copy link
Contributor

aleho commented Jul 1, 2024

If the translation sources contain strings instead of identifiers the dumper builds invalid constant names.

"The passwords don't match.": "Die Passwörter stimmen nicht überein."
"Your password should be at least {{ limit }} characters.": "Ihr Passwort sollte mindestens {limit} Zeichen lang sein."

results in

export const THE_PASSWORDS_DON'T_MATCH. = {"id":"The passwords don't match.","translations":{"validators+intl-icu":{"en":"The passwords don't match.","de":"Die Passw\u00f6rter stimmen nicht \u00fcberein."}}};
export const YOUR_PASSWORD_SHOULD_BE_AT_LEAST_{{_LIMIT_}}_CHARACTERS. = {"id":"Your password should be at least {{ limit }} characters.","translations":{"validators+intl-icu":{"en":"Your password should be at least {limit} characters.","de":"Ihr Passwort sollte mindestens {limit} Zeichen lang sein."}}};

Are messages as IDs not supported or is this a bug?
If bug, should the IDs be run through e.g. AsciiSlugger?

@jmsche
Copy link
Contributor

jmsche commented Jul 1, 2024

See symfony/symfony#57612

@aleho
Copy link
Contributor Author

aleho commented Jul 1, 2024

@jmsche Ah! Didn't consider there could have been a breaking change in the String component.

@Kocal
Copy link
Member

Kocal commented Jul 5, 2024

Note that it also broke the Translator demo on the Symfony UX website:
image
image

@smnandre
Copy link
Member

smnandre commented Jul 5, 2024

Do we need to fix something or is this going to be fixed in next SF release ?

@Kocal
Copy link
Member

Kocal commented Jul 6, 2024

This has been reverted, let's wait for a new Symfony release

@carsonbot
Copy link

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@aleho
Copy link
Contributor Author

aleho commented Jan 8, 2025

Yes, this is fixed.

@aleho aleho closed this as completed Jan 8, 2025
@smnandre
Copy link
Member

smnandre commented Jan 8, 2025

Thank you for this update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants