İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

Website browsing in another language

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
languagewebsiteodoo17CE
2 Cevaplar
3655 Görünümler
Avatar
HAMIDREZA HESARAKI

Hi Odoo developers, 


I need to set the default browsing language of the website to Arabic so that when someone browses the website for the first time sees the content in Arabic and the language selector shows Arabic as the default option, not English


I tried to set the default language of the website to Arabic but the result was not the same as I wanted.


Thanks in advance for your replies.

0
Avatar
Vazgeç
HAMIDREZA HESARAKI
Üretici

Thanks for the reply,

Your solution seems interesting, but the get_response is not defined in the website module so I do not know where I need to intercept the request correctly

I will follow your lead 

Best regards

CodeWasher

ok, I did not test the code myself, but just try the idea, you may search in the odoo source code for where the method def get_response is defined and then inherit that model and try.

best wishes

Avatar
Ray Carnes (ray)
En İyi Yanıt

HOW did you set the default language of your Website?

Did you follow the documentation?

https://www.odoo.com/documentation/17.0/applications/websites/website/configuration/translate.html


WHAT was the result?  It is hard to answer your question because we don't know what you tried and what you mean by "not the same as I wanted".


Something you should know about how Odoo sets the language on the Website:

1) First, Odoo checks the GeoIP of the user. Basically, what location in the world is the User accessing the database from. If the country code for that location has a default language that matches one from the Website, Odoo will use that first.

2) Second, Odoo checks the browser language set for the User's browser. Similarly to the approach above, if that language code matches one from the Website, Odoo will use that.

3) Last, Odoo will check the default language set on the Website and use that.


As you can see the default language on the website is only used if Odoo can't determine the language using the first two approaches.


2
Avatar
Vazgeç
HAMIDREZA HESARAKI
Üretici

Thank you for the clear explanation

Yes I did change the default language from website settings but it always shows English first when browsing.

I am browsing from Kuwait and my browser lang is English but I expected that odoo ignore the detection from geo and the browser lang and show me the website from default language I selected.

Best regards

Ray Carnes (ray)

We are trying to be as helpful as we can to the visitor, since the browser is set to English in your case, but it may not be what you want in all cases.

JH

@Ray Carnes (ray)

Are you sure about point 1, that the odoo ecommerce checks the GeoIP of the user surfing to the site and changes language accordingly if the language is installed?

I cannot get it working.
Only point 2 where it checks the browser language.

I'd rather use GeoIP where odoo ecommerce checks the IP address.

Avatar
CodeWasher
En İyi Yanıt

in your  custom module, you can try something like below 

from odoo import models, http

from odoo.http import request


class Website(models.Model):

    _inherit = 'website'


    def get_response(self, path, query_string, anchor, response=None):

        # Check if the user is visiting for the first time (no cookies set)

        if not request.httprequest.cookies.get('visited_before'):

            # Force Arabic language

            lang_code = 'ar'

            request.env['ir.http']._set_cookie_language(lang_code)

           

            # Redirect to Arabic version of the page

            url = request.httprequest.url.replace('/en/', f'/{lang_code}/')

            return request.redirect(url)

       

        # Set a cookie to indicate that the user has visited

        response = super(Website, self).get_response(path, query_string, anchor, response)

        response.set_cookie('visited_before', '1')

        return response


1
Avatar
Vazgeç
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Box multi language sur site web Çözüldü
language website
Avatar
Avatar
Avatar
3
Nis 24
4255
Some parts don't translate in any languages in webpages
language website
Avatar
0
Oca 23
2953
how to disable browser language detection for odoo website ?
language browser website
Avatar
Avatar
1
Nis 21
6026
Link translation
language translation website
Avatar
Avatar
2
Kas 17
5102
Cómo deshabilitar la detección de idioma del navegador para el sitio web de Odoo?
language browser website_builder website
Avatar
0
Eyl 24
1568
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now