Cambiar idioma para usuario no registrado

Hi,

Some of our customers want to be able to visit our discourse in their language (we are in Switzerland, we have to play with french, german, italian and english). Thse customers are not / don’t want to register. How could we add a way for them to change language of Discourse?
I could see a dropdown menu listing some languages in the header. Is there already a plugin, of some code I could use ?

Thanks

If your site is not using a CDN to deliver assets, you could try enabling the set locale from accept language header SIte Setting. When enabled, this setting will set the locale for non-logged-in users from the language preferences they have set on their web browser. For the setting to work, you also need to enable the allow user locale Site Setting.

Hi Simon,

We aren’t using a CDN, indeed :slight_smile: I didn’t saw that switch. Its an experimental feature… is it still solid ?

Yes. As long as you are not using a CDN, it should reliably set the locale for anonymous users to their web browser’s locale. How well it works for your users will depend on whether or not they have configured their web browsers to use their preferred language. You could try enabling the setting and then asking users about how well it’s working for them.

Ten en cuenta que ahora también puedes permitir que los invitados configuren su idioma utilizando el “Selector de idioma para invitados” en Multilingual Plugin 🌐.

Menú o pie de página

o

¿Has investigado problemas de caché con esto? El problema solo afectaría a los sitios que utilizan una CDN.

Sí, he analizado bastante la caché. No creo que lo tenga 100% correcto aún, pero sí creo que es posible (lograrlo).

Sí, o si el invitado desea usar una configuración regional diferente a la de su navegador. Por ejemplo, si están usando una computadora en una biblioteca, escuela u otro equipo compartido, o si ellos mismos son multilingües.

La configuración establecer configuración regional desde el encabezado de idioma aceptado sigue funcionando de forma predeterminada con el selector de configuración regional habilitado. Si el usuario no ha hecho clic explícitamente en otra configuración regional en el selector, se establecerá por defecto la de su navegador mediante esa configuración (si es posible).

¿Puedo usar solo el selector de idioma sin el plugin completo? ¿Tal vez existe una opción aparte de este plugin?