简体   繁体   English

Drupal:关于t()函数的问题

[英]Drupal: a question about t() function

I've added the following text in the t() function in page.tpl.php page. 我在page.tpl.php页面的t()函数中添加了以下文本。

<?php echo t('Some random text to translate.'); ?>

Now when I go to admin/build/translate/search to translate the string drupal cannot find it. 现在当我去admin / build / translate / search来翻译字符串drupal找不到它。

I've refreshed all caches, and also the "Refresh" tab in internationalization module. 我已刷新所有缓存,以及国际化模块中的“刷新”选项卡。

thanks 谢谢

The t() function , to save on performance for single-language sites, won't store the string in the database until it is requested from another language. 为了节省单语言站点的性能, t()函数在从其他语言请求之前不会将字符串存储在数据库中。 View the page in one of the non-default languages in order to populate the database (t() calls locale() to do this ), thus making the string available for translation. 以一种非默认语言查看页面以填充数据库(t()调用locale()来执行此操作 ),从而使字符串可用于转换。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM