This topic describes how to initialize the language environment when wecom users log in for the first time

Viewed 135

I originally wanted to set the user default when initializing, but I found that I could not get it, and I did not pass it on when executing the plug-in

image.png

Then I modified the source code to get the language when it was initialized

  1. Modifying the wecom_user_center.go file of project user-center-wecom.
    The plugin gets the language and sets it.
  2. Modifying the user_center.go and plugin.go file of project answer.
    The language of the current environment is exposed to all plug-ins.

I don't know if it was designed this way on purpose, so I didn't submit the code to you

企业微信截图_20240308015917.png

image.png

1 Answers

Firstly, if you need to allow users to have a default language, you can simply set the default language of your website to the desired language. That way after the user logs in without making any changes it is the default language.

image.png

User will use the default language after login.

image.png

Of course, as I can see from your image, you want the notifications to be in the appropriate language as well. There is a bug here. In case the user doesn't set the language, instead of passing an empty ReceiverLang to the plugin, the default language of the site should be passed.

So you can submit a issue and we will fix it in the next version. Thanks for your feedback.