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('<p><a class="stn" href="/my-page">Back to My Page</a></p>');
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.