בחר שפה בעת ההרשמה או הכניסה

סיכום מבוסס בינה מלאכותית

In a discussion about allowing users to choose their language during registration or login on a self-hosted Discourse community, roemer seeks guidance on configuring settings to support multilingual welcome messages. simon explains that while Discourse can auto-detect language via browser locale (via allow user locale and set locale from accept language header settings), it does not natively support manual language selection during registration — though users can change it later in their preferences. tobiaseigen suggests using SSO with a custom registration form, as implemented on Namati.org, which allows language selection. roemer praises the professional design and inclusivity of that form and asks for implementation details. tobiaseigen clarifies that the form is built in WordPress using the wp-discourse plugin and Gravity Forms, with custom PHP code syncing user preferences (including language) to Discourse via its API. hudsonwebdev confirms this setup involves Gravity Forms hooks and cURL requests to Discourse’s API to pass collected data. The community expresses enthusiasm for native language selection at registration, calling it a valuable feature for multilingual sites.

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.

Thank you in advance!

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:

There are some existing discussions on Meta about multi-lingual sites. There are a few ideas in this topic that could be helpful: Structuring a multilingual community.

If you use sso you can set this up on the registration form. This is how it works at Network Registration Form - Grassroots Justice Network.

That would be an awesome feature. :crossed_fingers:t2:

Hi Tobias,

great implementation. How did you create this registration form? It looks very professional! :slight_smile: 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!

Thank you so much in advance!

Thank you so much for the detailed instruction!!

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.

@tobiaseigen Thank you!!

@hudsonwebdev Hi, would you mind explainig it to me?

@roemer Sorry for the delay. As Tobias mentioned it is a combination of Wordpress and Gravity Forms.
Gravity forms allows you to “hook” into the submission. When the gravity form is submitted you tell it to run a piece of code that you write in you theme or plugin files. That code is generally made up of PHP using a CURL statement to connect to the discourse API. You can send information that you collect in your gravity form directly to discourse.