Help message checks whether library jquery Tablesort is installed or not. If not, suggests a Drush command to install library.
We should also add git repo path for manual approach if User does not have Drush installed.

Comments

bhavikshah9 created an issue. See original summary.

bhavikshah9’s picture

Status: Active » Needs review
StatusFileSize
new1.32 KB

Here is the patch.

emcoward’s picture

Status: Needs review » Needs work
  1. +++ b/content_report.module
    @@ -15,7 +15,12 @@ function content_report_help($path, $arg) {
    +        $output .= "<li>" . t("If you have Drush installed, use ") . "<code>drush ldl jquery.tablesorter
  2. ";

    Translatable strings shouldn't begin or end with white spaces, use placeholders with t() for variables.

    Do not concatenate strings to translatable strings, they should be part of the t() argument.

  3. +++ b/content_report.module
    @@ -15,7 +15,12 @@ function content_report_help($path, $arg) {
    +        $output .= "<li>" . t("If you don't have Drush installed, you can download library from git repo: <a href='@libgitrepo'>https://github.com/christianbach/tablesorter</a>", array('@libgitrepo' => 'https://github.com/christianbach/tablesorter')) . "</li>";
    

    Do not concatenate strings to translatable strings, they should be part of the t() argument.

KeyboardCowboy’s picture

@bhavikshah9, if you care to reroll your patch with @emcoward's suggestions I'd be happy to give you commit credit for it. Otherwise I can implement the changes.

Thanks to both of you for your review.

bhavikshah9’s picture

Hey @emcoward,

Thanks for the review.
I understood about placeholders. But, can you please spare a minute to help me understand about

Do not concatenate strings to translatable strings, they should be part of the t() argument?

Two points:

  1. I have checked block_help(hook_help of block module in core) which also concatenate strings to translatable strings.
  2. I have checked with Coder module and it does not show any such error to me.
aditya.n’s picture

Status: Needs work » Needs review
StatusFileSize
new1.01 KB
new1.11 KB

@emcoward, are these the changes you mean? Please review the patch.

amit.drupal’s picture

StatusFileSize
new1.19 KB

Update Patch #6

jaykandari’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new18.71 KB
new37.03 KB

Help Message changed. Attached OLD & NEW screenshots.

emcoward’s picture

I've reviewed the patch in #7 (2837922-7.patch).

It's looking good apart from a couple of tiny points:

  • There should be a space between the opening PHP tag.
  • Line 24 'return $output' should be indented 6 rather than 4.

The issue 'Do not concatenate strings to translatable strings, they should be part of the t() argument' could be fixed by doing something like:

$output .= "<li>";
$output .= t("If you don't have Drush installed, you can download library from git repo: <a href='@libgitrepo'>@libgitrepo</a>", array('@libgitrepo' => 'https://github.com/christianbach/tablesorter'));
$output .= "</li>";
$output .= "</ol>";

Also makes it slightly easier to read/follow.

emcoward’s picture

lomasr’s picture

StatusFileSize
new1.14 KB

As suggested in #10 . I have made the changes . Please review.

lomasr’s picture

Status: Reviewed & tested by the community » Needs review
bhavikshah9’s picture

Hi @emcoward,

Thanks for explaining the reason of 'Do not concatenate strings to translatable strings, they should be part of the t() argument' in comment#9

Here is the updated patch and interdiff.

emcoward’s picture

@bhavikshah9 looks good. Just need to add a space after the opening PHP tag and the comment and it's good to go.

emcoward’s picture

Status: Needs review » Needs work
gfcamilo’s picture

Status: Needs work » Needs review
Issue tags: +ciandt-contrib
StatusFileSize
new5.47 KB
new4.07 KB

Hello,

I added the space after php open tag and passed the drupal code sniffer in the module.

renatog’s picture

Assigned: bhavikshah9 » Unassigned
Status: Needs review » Reviewed & tested by the community

Hi.

It's good for me.

Congrats.

lomasr’s picture

Grt

emcoward’s picture

Latest patch looks good! Good to go.

opdavies’s picture

StatusFileSize
new1.33 KB
new5.41 KB

I'd suggest using theme('item_list', ...) to add the list rather than concatenating each line of HTML manually.

bhavikshah9’s picture

Hi @opdavies,

That's wonderful. +1 from me.

swaps’s picture

StatusFileSize
new35.19 KB

This looks good . Working as expected .

Cheers
SwapS