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!

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

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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