Came across this issue on a monolingual non-English site (with 'locale' => 'nl_BE.UTF'
in config.php
for example), where emails sent with $kirby->auth()->createChallenge()
are in English, unless I explicitly set Kirby\Toolkit\I18n::$locale = 'nl';
which I found weird. I expected them to be in the site’s locale.
But personally I think Kirby should check the user’s selected panel language and use that as the default.
Probably related: I18n config option for locale on single-language sites
Locale and language are two separate things. You can set the Panel default language with the panel.language
option, which will then be used for the login UI and the emails: https://getkirby.com/docs/reference/system/options/panel#default-panel-language
In any case, good idea to use the user language! I will see what I can do.
Setting the panel.language option did not have any effect on the language of the emails though, while setting locale did. Is this a bug then?
I just tried it again and it did have an effect. Currently the email body text is not translated in Dutch, but the subject should be. If it still doesn’t work, please check if the Panel login UI is displayed in Dutch (which is also controlled by this option).
In any case, the user language will be used for the emails in 3.5.5.
Ah, wait. You are right – I tested with the new development version, which will use the following languages in that order: user language, panel.language
, site language, multilang default language, English. The old implementation indeed only used English so far. In the Panel it did work, but not programmatically.