Problem/Motivation
The module was written with its comments and its interface strings in one language, and a single commit translated all of them to English at once. Wherever that pass failed to produce a translation it wrote the word [Translated] instead of the text, and nothing since has removed it. The result is in the branch today: the literal [Translated] stands in 28 files, on roughly 150 lines.
Most of them are comments and docblocks, which makes the code hard to read and impossible to review honestly - a docblock that says Returns [Translated] [Translated], if [Translated]/field [Translated] documents nothing. But not all of them are comments, and that is the part that matters:
- Strings passed to
t()and returned in API responses, so a client receives[Translated] [Translated]as a title or a label. - The subject line of an e-mail the module sends after a form submission.
- The
labeland the page name in the annotations of several REST resource plugins, so[Translated]appears in the administrative interface where the resources are listed and enabled.
Because these are the arguments of t(), they are also what the module offers translators: the source strings collected for translation are the placeholder, not the sentence. No translation of this module can be correct while they stand.
Proposed resolution
- Restore the text from the commit that precedes the translation pass, which still has every original string, and translate it properly this time.
- Fix the visible strings first - the arguments of
t(), the e-mail subject, the plugin annotations - because those are what a user and an API client see; the comments and docblocks follow. - Add a check that fails the pipeline if the literal appears again, so this cannot return quietly: neither PHPCS nor PHPStan reports it, which is why it survived this long.
Remaining tasks
Everything.
Issue fork myrest-3619989
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
sergeydruua commentedComment #6
sergeydruua commented