How can I override the string programmatically in forum topic list? I am using the Forum module in Drupal 7. I want to change "Topic" with "foo", for example, in the General discussion forum page.


  


 &nbsp;

Where did I search for this


I did check the template in the forum module file and for this page it is forum-topic-list.tpl.php. There I found that, it is printed by following code,

&lt;thead&gt;
    &lt;tr&gt;&lt;?php print $header; ?&gt;&lt;/tr&gt;
&lt;/thead&gt; 


And in the description, the following statement has been provided.


  Available variables:
  
  
  $header: The table header. This is pre-generated with click-sorting information. If you need to change this, see template_preprocess_forum_topic_list().
  


Hence, there is nothing called "Topic" which I can just change as this header coming from the $header.

Now, I did check template_preprocess_forum_topic_list() but it does not have provision to Change "Topic" string.
Lastly, I did check the forum.module where I found the following function starting at line 914.

 function forum_get_topics($tid, $sortby, $forum_per_page) {
   global $user, $forum_topic_list_header;

   $forum_topic_list_header = array(
     NULL,
     array('data' =&gt; t('Topic'), 'field' =&gt; 'f.title'),
     array('data' =&gt; t('Replies'), 'field' =&gt; 'f.comment_count'),
     array('data' =&gt; t('Last reply'), 'field' =&gt; 'f.last_comment_timestamp'),
  );


Now, in the above function you can see t('Topic'). I could simply replace it with t('foo'), but I think this is not the right way.


Any suggestion, how can I override this? Thanks.
You could do it using the String Overrides module.


  Provides a quick and easy way to replace any text on the site.