تغيير اللغة للمستخدم غير المسجل

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.

يُرجى ملاحظة أنه يمكنك الآن السماح للضيوف بتحديد لغتهم باستخدام “مبدل لغة الضيوف” في Multilingual Plugin 🌐.

القائمة أو التذييل

أو

هل بحثت في مشكلات التخزين المؤقت المتعلقة بهذا؟ المشكلة تؤثر فقط على المواقع التي تستخدم شبكة توصيل المحتوى (CDN).

نعم، لقد راجعت التخزين المؤقت إلى حد كبير. لا أظن أنني حققتها بنسبة 100% بعد، لكنني أعتقد أنه من الممكن تحقيق ذلك.

نعم، أو إذا أراد الزائر استخدام لغة مختلفة عن لغة متصفحه. على سبيل المثال، إذا كانوا يستخدمون حاسوبًا في مكتبة أو مدرسة أو أي حاسوب مشترك آخر، أو إذا كانوا هم أنفسهم متعددي اللغات.

لا يزال إعداد “ضبط اللغة من رأس قبول اللغة” يعمل افتراضيًا مع تفعيل مفتاح تبديل اللغة. إذا لم يقم المستخدم بالنقر صراحةً على لغة أخرى في المفتاح، فسيتم افتراضياً استخدام لغة متصفحه عبر هذا الإعداد (إذا أمكن).

هل يمكنني استخدام مفكك اللغة فقط دون إضافة كاملة؟ هل هناك إمكانية لذلك بخلاف هذه الإضافة؟