I'm working on a module for a D7 site that generates a block. Unfortunately all the HTML is hard coded and I need to make it translatable. I have done the following:


$output = "<h3>Page title here</h3>";


$output = "<h3>".t('Page title here')."</h3>";

but no amount of clearing caches or refreshing strings gets "Page title here" to appear in the translate interface. I've loaded the page and even changed the text but it does not show up. I'm aware of the case sensitivity of the search

Is there something I'm missing?


As usual, I work it out shortly after posting a question. Here's what I needed to do if anyone else has this issue.

  1. The block I was trying to translate was only configured to display on the en version of the page, so I enabled it to be displayed on the other language's page as well.
  2. I enabled translation for the block as a good measure.

After that the string popped up in the translation interface.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.