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 label and 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

Command icon 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

sergeydruua created an issue. See original summary.

  • sergeydruua committed a03dd547 on 1.0.x
    Issue #3619989: Replace the placeholder of a failed translation with the...
sergeydruua’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

sergeydruua’s picture

Status: Fixed » Closed (fixed)