This thread is resolved. Here is a description of the problem and solution.
Problem:
You are developing a site and want Buddyboss users to set their preferred language in the account settings, but you are unsure how to implement this feature.
Solution:
We recommend the following steps to allow Buddyboss users to set their preferred language:
1) Add a dropdown menu in their account settings or profile where they can pick their preferred language, using either a regular WP language field or a custom profile field.
2) Ensure that the site saves their language choice (e.g., 'fr' for French) into the database, attached to their user meta.
3) When the user logs in, have the site check their language choice and switch the website language accordingly. You can use the
wpml_switch_language()
function for this. More details can be found here: https://wpml.org/wpml-hook/wpml_switch_language/
Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If this solution does not resolve your issue, please open a new support ticket at WPML support forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.