neos-ui icon indicating copy to clipboard operation
neos-ui copied to clipboard

TASK: Use new `translate()` method if possible

Open mhsdesign opened this issue 1 year ago • 1 comments

Followup to https://github.com/neos/neos-ui/pull/3804 which deprecates the use of the component and the i18nRegistry, as this is now a global concept via the translate method.

What I did

Using various careful regex replacements and manual adjustments, commit by commit the translate() method was introduced.

As written here https://github.com/neos/neos-ui/pull/3804#issuecomment-2613992743 the new method does not handle user input gracefully, which is the reason why non static strings are still using the old translation methods to ensure nothing breaks here.

How I did it

How to verify it

Via the regex

translate\('(?!(Neos\.Neos:(Main|Inspector|Modules)|Neos\.Neos\.Ui:(Error|Main|PublishingDialog|SyncWorkspaceDialog)):[a-zA-Z._-]+')

All source files can be checked that each call to translate() now specifies the translation as fully qualified shorthand string.

Replacing the component with a direct call to translate() might not always look correct as this leads to a missing <span /> tag. Those cases have to be identified by eye.

mhsdesign avatar Jan 26 '25 15:01 mhsdesign

Wow, that’s a lot to take in! I’ll need some time to look into it. Thanks a bunch!

markusguenther avatar Jan 27 '25 08:01 markusguenther