Problem/Motivation
In the print_mail module, the node title is translated with the t()-function. I think this is unnecessary an fills only the translate table.
if (!empty($title)) {
if (drupal_substr($path, 0, 5) == 'node/') {
$title = t($title);
}
$form['fld_title'] = array(
'#type' => 'item',
'#title' => t('Page to be sent'),
'#value' => '<span id="sent-title">'. l($title, $path, array('attributes' => array('title' => t('View page')))) .'</span>',
'#id' => 'sent-title',
);
}
Maybe it's a good idea to translate other other stings, when is not a node (e.g. a view title).
Proposed resolution
Only translate the title when it's not a node-title.
Comments
Comment #1
weri commentedOnly translate title when it's not a node-title
Comment #2
jcnventuraDuplicate of #1410262: unnecessary title translation in print_mail.inc
Comment #3
jcnventuraSorry, too fast.. You're right.
Comment #4
weri commentedNo problem. I forgot to place a note that also an issue for the D7 version exists.
Comment #5
jcnventuraYes, bugs are usually shared between versions.. Thanks for the patch!
http://drupalcode.org/project/print.git/commit/20a2c1b
Comment #7
Jorrit commentedThis was a huge performance problem for my site, because it had a lot of nodes. Every time a visitor (or search engine) visited a mail form page, the language cache was invalidated. The cache also contained all node titles, which consumed a lot of memory. My language cache contains 101092 entries, of which 70336 with a location starting with
/printmail. I suggest that anyone with a similar situation remove all strings starting with /printmail from the locales_source table.