Please, see attached patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nsk’s picture

Status: Active » Needs review

I had a look on the patch and it looks ok. I am marking it for review for now, then if another contributor agrees I think it can be committed as it is.

killes@www.drop.org’s picture

Status: Needs review » Needs work

Sorry, the patch needs work.

it should be

t('

%title

by %name', array('%title' => check_plain($node->title), '%name' => theme('username', $node));

and the other place needs also work.

markus_petrux’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
583 bytes

Sweet! Patch reworked.

chx’s picture

FileSize
592 bytes

Patch rerolled so it conforms to our standards.

Bèr Kessels’s picture

I tested the patch and can confirm it works. Though some themes don't use this (bluebeach did not honour it, it seems).

markus_petrux’s picture

bluebeach is not on the drupal repository. Anyway, this would only affects themes that do not override the theme_node method.

Dries’s picture

Status: Reviewed & tested by the community » Needs work

I don't see why we put <h2 class="title">%title</h2> inside the t() function. Translations should not be used to modify HTML code.

markus_petrux’s picture

hmm... I could re-work the first one, using t('by') w/o spaces.

Better approach or ... ?

killes@www.drop.org’s picture

Status: Needs work » Reviewed & tested by the community

Dries, there is no way to avoid that. the intend is not to change the markup, the intend is to make a proper sentence for translation.

Dries’s picture

Instead of writing:

  t('<h2 class="title">%title</h2> by %name', array('%title' => check_plain($node->title), 

maybe you can write:

  t('%title by %name', array('%title' => '<h2 class="title">'. check_plain($node->title) .'</h2>', 

Maybe?

killes@www.drop.org’s picture

yep, good idea

markus_petrux’s picture

FileSize
616 bytes

I like it, Makes sense.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks.

Stefan Nagtegaal’s picture

Status: Fixed » Needs work

I think your patch should look like this:

--- cvs\includes\theme.inc	Tue Jan 17 00:01:28 2006
+++ new\includes\theme.inc	Wed Jan 18 02:28:46 2006
@@ -567,10 +567,10 @@
   }
 
   if ($page == 0) {
-    $output = '<h2 class="title">'. check_plain($node->title) .'</h2> by '. theme('username', $node);
+    $output = '<h2 class="title">'. check_plain($node->title) .'</h2>'. ' '. t('by %name', array('%name' => theme('username', $node)));
   }
   else {
-    $output = 'by '. theme('username', $node);
+    $output = t('by %name', array('%name' => theme('username', $node)));
   }
 
   if (count($terms)) {

instead of what you did.. this is the way we consistently use in core, so without the <h2>-tags. Setting back to 'code needs work'..

killes@www.drop.org’s picture

Status: Needs work » Fixed

sorry, stefan, the patch that went in was better.

Stefan Nagtegaal’s picture

Killes, I'll agree about the fact it's better but now we have to change all the translatable strings once again to make them all consistent. Or do you think we should wait untill after 4.7 is released?

killes@www.drop.org’s picture

there were two strings added. I will regenerate the pot files or the next beta or rc.

Anonymous’s picture

Status: Fixed » Closed (fixed)