Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

languages not loaded #6

Open
dstucky opened this issue Jul 15, 2024 · 0 comments
Open

languages not loaded #6

dstucky opened this issue Jul 15, 2024 · 0 comments

Comments

@dstucky
Copy link

dstucky commented Jul 15, 2024

I set custom lexicon entries for additional languages, but the hook MailChimpSubscribe always used the standard language and the current language (cultureKey) of the page was ignored.

I checked /core/components/mailchimpsubscribe/model/mailchimpsubscribe/mailchimpsubscribe.class.php for these outputs and ist uses $this->modx->cultureKey for getting the error messages, which always is set to the default language. When I use $this->modx->getOption('cultureKey') it works fine.

I have a language switch on system event OnMODXInit and ClientConfig_ConfigChange. I also set the same events as the plugin ContextRouter, but this didnt change anything. I assume the hook is initiated before the language switch is executed? The hook uses $modx->getService().

When I set the cultureKey additionally with $modx->cultureKey = "fr"; in the language switch it works, but I assumed that $modx->switchContext('webFR'); would do this anyway.

$this->mcSubscribeMessage = $this->modx->lexicon(
    'mailchimpsubscribe.error.pending',
    [],
    $this->modx->getOption('cultureKey') // INSTEAD OF $this->modx->cultureKey
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant