Problem/Motivation

The README is a really great overview of the module! Unfortunately it shows TranslatableMarkup which is used with a variable. However, such usage is disallowed and the first argument to TranslatableMarkup or related functions should always be a static string. This ensures that Drupal's translation template extractor can properly find the string and make it available for translation on https://translate.drupal.org/

Since this is documentation, this is not a big issue, but it might encourage newcomers to do the wrong thing and run into unexpected problems.

Steps to reproduce

Proposed resolution

Inline the $str variable so that the full string is statically provided as first argument to TranslatableMarkup.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork grequest-3459017

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

Kingdutch created an issue. See original summary.

jagraj_singh_gill’s picture

Assigned: Unassigned » jagraj_singh_gill

I am working on this issue.

jagraj_singh_gill’s picture

Assigned: jagraj_singh_gill » Unassigned
Status: Active » Needs review

Hey @Kingdutch I have corrected the incorrect usage of TranslatableMarkup in README and created the MR for same. Please review.

Thank You !!

ankitv18’s picture

Status: Needs review » Reviewed & tested by the community

Changes looks clean, hence marking this RTBC

gogowitsch’s picture

The proposed change looks good. Let’s get this merged. 🙂