<p>In a multilingual site, your <a href="https://craftcms.com/docs/localization-guide#step-4-define-your-site-uRLs" rel="nofollow noreferrer"><code>siteUrl</code> config setting</a> in <code>/craft/config/general.php</code> needs to be an array where the keys correspond to your installed locales:</p>

<pre><code>return array(
    // ...
    'siteUrl' =&gt; array(
        'no' =&gt; 'http://example.com/',
        'en_us' =&gt; 'http://example.com/en/',
    ),
);
</code></pre>

CC BY-SA 3.0
2016-11-10T19:17:12.887Z
2016-11-10T19:17:12.887Z
Mats Mikkel Rummelhoff
<p><code>{{siteUrl}}</code>, <code>{{category.url}}</code>, <code>{{product.url}}</code>, etc. is not outputting any language.</p>

<p>The main language is Norwegian. I created a folder for English (/en/) with <code>define('CRAFT_LOCALE', 'en_us');</code></p>

<p>Navigating to <code>site.com/en</code> works fine, and all the english content shows as expected. However any link generated by craft simply omits "/en/", thus throwing me back to Norwegian. I don't get it.</p>

<p>Anything in particular I should look into? Thanks a lot!</p>

CC BY-SA 3.0
2016-11-08T21:26:57.517Z
Did you [define your `siteUrls`](https://craftcms.com/docs/localization-guide#step-4-define-your-site-uRLs)? The array keys for `siteUrl` should correspond to the locale keys, so in your case you'll probably need an entry like `'en_us' => 'http://example.dev/en/'`
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2016-11-10T14:13:46.917Z
Aha! My mistake was having "en" instead of "en_us". Thank you kindly!
Stian Karlsen
CC BY-SA 3.0
2016-11-10T14:21:59.440Z
Looks legit, I'm stumped. Never experienced an issue like that.
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2016-11-10T18:10:03.577Z
Awesome, Stian – I'll add my original comment as an answer, then :)
Mats Mikkel Rummelhoff
<localization>
Craft not generating language links correctly
# Craft not generating language links correctly

(Asked by: username_0 on 2016-11-08)

`{{siteUrl}}`, `{{category.url}}`, `{{product.url}}`, etc. is not outputting any language.

The main language is Norwegian. I created a folder for English (/en/) with `define('CRAFT_LOCALE', 'en_us');`

Navigating to `site.com/en` works fine, and all the english content shows as expected. However any link generated by craft simply omits "/en/", thus throwing me back to Norwegian. I don't get it.

Anything in particular I should look into? Thanks a lot!

**Tags:** localization

> **Comments:**
> **username_1**: Did you [define your `siteUrls`](https://craftcms.com/docs/localization-guide#step-4-define-your-site-uRLs)? The array keys for `siteUrl` should correspond to the locale keys, so in your case you'll probably need an entry like `'en_us' => 'http://example.dev/en/'`  
> **username_0**: Aha! My mistake was having "en" instead of "en_us". Thank you kindly!  
> **username_1**: Looks legit, I'm stumped. Never experienced an issue like that.  
> **username_1**: Awesome, Stian – I'll add my original comment as an answer, then :)  

---

## 1 answers

### Answer by username_1 on 2016-11-10. Score: 2 | Accepted answer

In a multilingual site, your siteUrl config setting in /craft/config/general.php needs to be an array where the keys correspond to your installed locales:
return array(
    // ...
    'siteUrl' => array(
        'no' => 'http://example.com/',
        'en_us' => 'http://example.com/en/',
    ),
);


---

