{{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!

  • 1
    Did you define your siteUrls? 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/' Nov 8 '16 at 21:26
  • 1
    Aha! My mistake was having "en" instead of "en_us". Thank you kindly! Nov 10 '16 at 14:13
  • Looks legit, I'm stumped. Never experienced an issue like that. Nov 10 '16 at 14:21
  • Awesome, Stian – I'll add my original comment as an answer, then :) Nov 10 '16 at 18:10

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/',

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.