Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-10T19:17:12.887Z
Answers.LastActivityDate: 2016-11-10T19:17:12.887Z
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Body: <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>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-08T21:26:57.517Z
Comments.Text: 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/'`
Comments.UserDisplayName: Mats Mikkel Rummelhoff
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-10T14:13:46.917Z
Comments.Text: Aha! My mistake was having "en" instead of "en_us". Thank you kindly!
Comments.UserDisplayName: Stian Karlsen
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-10T14:21:59.440Z
Comments.Text: Looks legit, I'm stumped. Never experienced an issue like that.
Comments.UserDisplayName: Mats Mikkel Rummelhoff
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-10T18:10:03.577Z
Comments.Text: Awesome, Stian – I'll add my original comment as an answer, then :)
Comments.UserDisplayName: Mats Mikkel Rummelhoff
Tags: <localization>
Title: Craft not generating language links correctly
ThreadText: # 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, username_0 – 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](https://craftcms.com/docs/localization-guide#step-4-define-your-site-uRLs) 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/',
      ),
  );
  
  ```
  
  
  ---
  
  