Hi,

I found out that the title of the page where the user is referred to by clicking on the "Send by Emal" link is not translated - and I could not find the place where to add the "t()" function in the module code.

Best,
Tobias

Comments

pandersb’s picture

Yes, I have the same problem.

The title of the page uses drupal_set_title in the function forward_page(). So even when I tried hook_menu_alter, the title would still get overridden in line 491 of forward.module.

I needed to wrap the variable with the t function. This is not ideal since it'll conflict when I do updates of this module.

drupal_set_title(check_plain(t(variable_get('forward_page_title', 'Forward this page'))));

tobiberlin’s picture

Title: "Forward this page" on the forwar form page title not translated » "Forward this page" on the forward form page title not translated

Could anyone help please?

tobiberlin’s picture

again: any suggestions?

zilverdistel’s picture

Status: Active » Needs review
StatusFileSize
new1.86 KB

This is indeed an annoying bug.

On line 62:

  $items['forward'] = array(
    'title'            => variable_get('forward_page_title', 'Forward this page'),
    'page callback'    => 'forward_page',
    'access arguments' => array('access forward'),
    'type'             => MENU_CALLBACK
  );

I don't see why the page callback should use drupal_set_title() (on line 490) to reset the page title. Titles defined in hook_menu are translated automatically, drupal_set_title() doesn't take care of that.

Also, I noticed the variable 'forward_page_title' never gets set. This is the output of grep -rni forward_page_title *

forward.module:64:    'title'            => variable_get('forward_page_title', 'Forward this page'),
forward.module:491:    drupal_set_title(check_plain(variable_get('forward_page_title', 'Forward this page')));
forward.module:957:        'attributes' => array('title' => variable_get('forward_page_title', t('Forward this page to a friend')), 'class' => 'forward-page'),

My guess is that this should be changed to variable_get('forward_email_title', t('Forward this page')) in these cases. The included patch fixes it for me (applies to git-version).

john.oltman’s picture

Status: Needs review » Reviewed & tested by the community

Patch worked for me, just committed to 6.x branch. I also picked up the epostcard title while I was in there. I will create a new production release after resolving an issue with adding Mollom support.

zilverdistel’s picture

Thanx!

john.oltman’s picture

Status: Reviewed & tested by the community » Closed (fixed)