我用自定义模块创建了一个自定义页面。
$items['registered-products/%'] = array(
'title' => t('Hello World'), // TRANSLATES FINE
'page callback' => 'mymodule_product_page',
'page arguments' => array(1),
'access arguments' => array('access content'),
'file' => 'includes/mymodule.product_page.inc',
);我为我的自定义页面创建了一个模板文件(.tpl.php),在这里我有:
<?php print t('hello world'); ?> <!-- DOES NOT TRANSLATE -->
t()在hook_menu中进行翻译,但在模板文件上则不然。
t()在模板文件上工作?发布于 2018-04-11 09:14:16
只要字符串是相同的,问题就应该解决。在提供的代码中,hello World不等于Hello。
匹配用于翻译的字符串是区分大小写的。
https://drupal.stackexchange.com/questions/228071
复制相似问题