1
A
回答
1
2
对不起,重新打开这个线程,如果有人土地在这里寻找一种方式来Drupal的7为翻译字段标签,阅读下文。
在Drupal 7中,引入了核心功能template_preprocess_field()
。在我们的template.php文件中使用它,我们可以通过一个t()
函数传递每个字段标签。
/**
* Implements template_preprocess_field().
*/
function THEMENAME_preprocess_field(&$vars, $hook) {
// Check to make sure there's a label and it's visible.
if(isset($vars['label']) && $vars['label_hidden'] === FALSE)
{
$vars['label'] = t($vars['label']);
}
}
您是否尝试过翻译界面? – Paul 2010-03-02 16:54:43