We want our users to choose their language when they first register for the community or also if they log in. How do the settings need to be adapted? We have a welcome message in two language and would like to be able to let the user choose which language is displayed.
If you enable the allow user locale and set locale from accept language header Discourse settings (both are found near the top of the “Basic Setup” settings) users will have their language automatically set to the locale that is set on their web browser when they first register on the site. For many cases this would work to set the proper language for a user.
Discourse doesn’t have an option to allow users to manually select their language when they register their account. I can see how this would be a useful feature for some sites though.
As long as the allow user locale site setting is enabled, users can change their locale after signing up for the site. This is done from the Interface section of the user’s preferences page:
great implementation. How did you create this registration form? It looks very professional! Our current registration process is very basic. The registration form you created suggests exclusiveness! It would also be very welcoing for diverse user to choose their language/country of orgin. Also the question where the user has heard from us is great!
This is done in Wordpress using the wp discourse plugin and gravity forms. There is some custom code dealing with syncing of preferred interface language @hudsonwebdev might be willing to explain for you.
@roemer Désolé pour le délai. Comme l’a mentionné Tobias, il s’agit d’une combinaison de WordPress et de Gravity Forms.
Gravity Forms vous permet de « hooker » la soumission. Lorsque le formulaire Gravity est soumis, vous lui indiquez d’exécuter un bout de code que vous écrivez dans vos fichiers de thème ou de plugin. Ce code est généralement composé de PHP utilisant une instruction CURL pour se connecter à l’API de Discourse. Vous pouvez ainsi envoyer directement à Discourse les informations que vous collectez dans votre formulaire Gravity.