I prefer my cp in English but I've noticed that it also sets the locale to "en_us" for the entire site. I need that locale to be "nl" since the site is in Dutch. Any idea how to achieve this?

up vote 1 down vote accepted

If you're running Craft Pro, you can go to your account's profile page where you can set your user's preferred language to English and the CP will display in English.

  • Is this pro only? Not seeing that setting in the client edition. – erwinheiser May 17 '15 at 21:20
  • Right... you'd need Pro for that. Will update the answer. – Brad Bell May 17 '15 at 21:32
  • The same reason why adding a define locale statement to index.php isn't working either I guess? – erwinheiser May 17 '15 at 21:35
  • Most likely... yeah. – Brad Bell May 17 '15 at 21:55
  • Is it possible to have the CP in English without actually installing the en_us content locale? I'm running a site w/ content in Norwegian and I also prefer having the CP in English. However even if I specifically set my sections to target Norwegian only, Craft renders the language select dropdown above all index tables. When there's no actual content in English, that can be confusing. I tried setting the the 'defaultCpLanguage' to 'en' without actually having the English locale installed, which – oddly enough – does render the CP in English, but then my Norwegian content is invisible :) – Mats Mikkel Rummelhoff Sep 11 '15 at 11:29

This solutions works for any locale, even if you don't have it installed as a front-end locale. It also works for Personal or Client Craft installs.

Add a translations file into craft/translations/xx.php named after the currently selected user locale or system locale for Craft Personal installs and use this code to include any locale's translations you want. You can also customize it further by overwriting select translations:

<?php
namespace Craft;

if (craft()->request->isCpRequest())
{
    $en = (include '../craft/app/translations/en.php');
    $custom = array(
        'Globals' => 'I freak out!',
    );

    return array_merge($en, $custom);
}

return [];
  • One downside of this approach: it doesn't override plugin translations (if you don not include them aswell). – carlcs Dec 2 '15 at 21:52

I've modified the snippet a bit. For me as Admin and Developer it's urgent to have it in English. But we figured out that clients want rather the native language. I think it's fine in this way.

<?php
namespace Craft;

if (craft()->request->isCpRequest())
{
    if (craft()->userSession->isAdmin())
    {
        return (include '../craft/app/translations/en_gb.php');
    }
    else
    {
        $de = (include '../craft/app/translations/de.php');
        $custom = array(
            //'Globals' => 'I freak out!',
        );

        return array_merge($de, $custom);
    }
}

return [];

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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