Make link translatable in Admin from a PHP string in a tpl-file In a custom user-login-block.tpl.php file i want to make a link in the Create an Account -button which links to /doctor/register. Here the link to the example page (you are redirected to this page from specific nodes who needs permission (by Content Access module).

How do i make this link in PHP so i am able to make it multilingual and translate it in Administration » Configuration » Regional and language » Translate interface to:


benl/doctor/register (for Belgium dutch site)
befr/doctor/register (for Belgium French site)


I think i need somehow the base_url because otherwise it gives the string from the restricted page (in this example benl/producten/injectables).

How do i manage this?

Update:

To make it more clear this is my HTML:

&lt;div class="well"&gt;
    &lt;a class="btn btn-large btn-primary" href="HERE THE LINK"&gt;&lt;?php print t('Create an Account'); ?&gt;&lt;/a&gt;
&lt;/div&gt;


So where is written HERE THE LINK i have to insert the php-code.
You can use path aliases for this. Go to /admin/config/search/path/add and create a new alias with the following settings:


Language: Dutch (or whatever it is called in your site)
Existing system path: 'doctor/register'
Path alias: 'dokter/registreer' (or whatever suits your fancy)


Repeat for the French site. Drupal core and contrib modules should automatically pick up the language-dependent aliases. If you're creating a link in a template yourself, make sure you use the l() function to build the entire &lt;a&gt; tag. To get the result in your question, you need something like this:

&lt;div class="well"&gt;
  &lt;?php
    $link_options['attributes']['class'] = array('btn', 'btn-large',' btn-primary');
    print l(t('Create an Account'), 'doctor/register', $link_options);
  ?&gt;
&lt;/div&gt;