1

I'm trying to make a plugin in Craft 3 but want it to be possible to set different settings for each separate site or locale. How would I go about doing this?

1 Answer 1

1

Edit

OP updated the question to specify Craft 3, so this is no longer relevant.


You can define a separate value for each locale, as described in the localisation documentation:

<?php

return [
    'flagName' => [
        'de' => 'Bundesflagge',
        'fr' => 'Tricolore',
    ],
];
3
  • I can't seem to get this to work, I'm trying to do this in Craft 3 though, are you sure it's the same?
    – Rias
    Commented May 8, 2017 at 8:16
  • Ah, I see you updated the question. I'm not sure about Craft 3, but I suspect it's different. Commented May 8, 2017 at 15:52
  • I'm pretty sure that the above only ever applied to the siteUrl and wasn't generalized to work for any setting Commented Jul 12, 2018 at 4:45

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.