How to give href links in custom modules for multilingual site? I've created a custom module,having a href links like follows. 

Let's say the following link appears on example.com/somepage/another-page/nid

t('&lt;p&gt;&lt;a class="stn" href="/my-page"&gt;Back to My Page&lt;/a&gt;&lt;/p&gt;');


The above links works by default but it won't work if user is in Spanish version (example.com/es/somepage/another-page/nid). 

If user click on the link it redirects to default lang version (example.com/my-page)

I tried $GLOBALS['base_url'] but it doesn't work in this case. 

So my question is how can I give href link for multilingual? Any ideas would be much appreciated.
You have a mistake in your code.

Wrong:

t('&lt;p&gt;&lt;a class="stn" href="/my-page"&gt;Back to My Page&lt;/a&gt;&lt;/p&gt;');


Correctly

'&lt;p&gt;' . l(t('Back to My Page'), 'my-page', array('attributes' =&gt; array('class' =&gt; array('stn')))) . '&lt;/p&gt;';


For more information see function l();