artvdputte asked a question still unanswered after 7 months, probably because he posted it in the wrong forum, so would you allow me to post it here:
I have a string inside the t() function inside my page.tpl.php template:
<?php
print t('test string');
?>The string is displayed perfectly when I visit a page.
Now I'ld like to translate this string now using the "translate interface" page, but the string is not showing up there?What am I doing wrong?
I'm using drupal 7.12 and following "multilingual" modules are enabled:Content translation
Locale
ALL modules from multilingual-internationalization except contact translation and multilingual forum.Thanks for your help.
I have the same problem with Drupal 7.17 and the contributed Internationalization 7.x-1.7 module. Is it even possible to use t() in template files? If yes, how?
Comments
Not only is it possible, you
Not only is it possible, you are supposed to use text when outputting it in template files. So you are doing it right. That leads to the question as to why you are not seeing the strings in the translate interface. One possibility is that the string in question has not been outputted yet. Until a string is outputted (meaning it's been run through the t() function), it will not appear in the translate interface page. Have you visited the page (template) in question and viewed the text in English before visiting the translate interface page?
Jaypan We build websites
It works.
Thank you very much. It works. In fact, I had forgotten to write "print".
It didn't work immediately. I cleared the caches.
I had never thought it would have been so easy.
http://Fiable.biz Web site creation.
Note that you need to visit
Note that you need to visit the page *when in a non-default language*. See http://drupal.org/node/1496740