Search code examples
drupallocalizationdrupal-7

Using t() in Drupal 7


I've searched how to do it a week, but haven't success and it's been a bottleneck in the work so, I decided to ask.

I put <h3><?php print t("strings translation"); ?></h3> in page.tpl.php and flush all caches and reload every languages available in the site.

And then I try to search for the string in /admin/config/regional/translate/i18n_string the options available are Fields, Node types, Menu, Taxonomy, Blocks.

But then I can't find the "strings translation" in /admin/config/regional/translate/translate.

I have read in drupal.org documentation but it seems like I'm missing something.

Could you please advice how to do it?


Solution

  • Are you missing echo in your code?

     <h3><?php echo t("strings translation"); ?></h3>
    

    I am not clear what are you looking for. But Stringoverrides modeule may solve your problem. It can translate any string across the project. But, if the string is inside t() function.