ux icon indicating copy to clipboard operation
ux copied to clipboard

[Translator] TranslationsDumper builds invalid constant names

Open aleho opened this issue 1 year ago • 4 comments

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?

aleho avatar Jul 01 '24 09:07 aleho

See https://github.com/symfony/symfony/issues/57612

jmsche avatar Jul 01 '24 09:07 jmsche

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

aleho avatar Jul 01 '24 09:07 aleho

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

Kocal avatar Jul 05 '24 08:07 Kocal

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

smnandre avatar Jul 05 '24 22:07 smnandre

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

Kocal avatar Jul 06 '24 14:07 Kocal

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

carsonbot avatar Jan 08 '25 12:01 carsonbot

Yes, this is fixed.

aleho avatar Jan 08 '25 14:01 aleho

Thank you for this update!

smnandre avatar Jan 08 '25 15:01 smnandre