Use Panels' hook to embed t() function (for example, your module name is my_module):
/*
* Implementation of hook_panels_pane_content_alter
*/
function my_module_feature_panels_pre_render(&$display) {
//panel title
$display->title = t($display->title);
//pane titles
foreach($display->content as $pane) {
if (isset($pane->configuration['override_title_text'])) {
$pane->configuration['override_title_text'] = t($pane->configuration['override_title_text']);
};
}
}

I tried to put this function in my theme's template.php but it doesn't work. Do I have to change anything in your code (maybe the 'dpm_feature' string?)
ReplyDeleteI'm so sorry for late response! Yes, you must change dpm to the name of your module or theme. It was my fault, sorry, I copied my code and pasted here as a notice. The post is edited. I'll be careful from now on. Thank you! :)
DeleteHi! If you're interested to efficiently localize Drupal websites, consider this online string management platform: https://poeditor.com
ReplyDeleteYou can use it with this plugin to automate the translation process more: https://poeditor.com/help/user_contributions#Drupal-Plugin
Good day!