2

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

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/',
    ),
);
| improve this answer | |

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.