Change texts according to other language in template.php I have multilangual website ancak my site's footer is in template.php.

Like this:

function _site_footer(){
    global $language;

    $output = '&lt;div class="footer_content container_12"&gt;
                &lt;div class="item address grid_4"&gt;
                   this is a lorem ipsum
                &lt;/div&gt;
            &lt;/div&gt;
    return $output;
}


I want, when I turn my site to other language, get this footer:

function _site_footer(){
    global $language;

    $output = '&lt;div class="footer_content container_12"&gt;
                &lt;div class="item address grid_4"&gt;
                   TESTTESTTESTTEST
                &lt;/div&gt;
            &lt;/div&gt;
    return $output;
}


How can I change it in template.php? Thank you.
Global $language variable returns current language object, you can get current language code by $language-&gt;language property. Example:

global $language;
$output = '&lt;div class="footer_content container_12"&gt;
                &lt;div class="item address grid_4"&gt;
                   this is a lorem ipsum
                &lt;/div&gt;
            &lt;/div&gt;';
if($language-&gt;language == 'en') {
    $output = '&lt;div class="footer_content container_12"&gt;
                &lt;div class="item address grid_4"&gt;
                   this is a lorem ipsum in english
                &lt;/div&gt;
            &lt;/div&gt;';
}

return $output;


But better way would be using Render Arrays

2-Solution: is to wrap the text with t() function. And translate the text by admin/config/regional/translate link.

function _site_footer(){    
    $output = '&lt;div class="footer_content container_12"&gt;
                &lt;div class="item address grid_4"&gt;
                   ' . t('this is a lorem ipsum') . 
                '&lt;/div&gt;
            &lt;/div&gt;'
    return $output;
}