我有一个在特征中导出的视图。我想确保自定义标签被翻译。View显示样式是一个表,我有一些自定义的标题标签,而不是使用CCK默认标签。但是,标签似乎是不可翻译的。
我将行'label' => 'Participant'修改为'label' => t('Participant')是否正确?这对将来的输出意味着什么,每次我要进行更改时,我都必须修改输出吗?
下面是我的视图的$handler->override_option('fields'属性的一个片段,它显示了标题字段和自定义标签。
'title' => array(
'label' => 'Participant',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 1,
'path' => '[field_participant_link_url]',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '_blank',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 1,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
'override' => array(
'button' => 'Use default',
),
),发布于 2011-03-02 02:38:29
答案是这是不必要的。如果标签是自定义的,Drupal会对其进行翻译。如果标签使用来自CCK的默认值,我相信这取决于CCK模块来翻译它(虽然没有确认这一点)。我只知道,当我自定义我的标签,并在“翻译接口”中为标签值提供一个翻译后的字符串时,问题就解决了。
所以从本质上讲,我认为在上面翻译'label' => t('Participant'),是错误的。
https://stackoverflow.com/questions/5148077
复制相似问题