Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Website browsing in another language

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
languagewebsiteodoo17CE
2 Răspunsuri
3665 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
HAMIDREZA HESARAKI
Autor

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

Imagine profil
Ray Carnes (ray)
Cel mai bun răspuns

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
Imagine profil
Abandonează
HAMIDREZA HESARAKI
Autor

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.

Imagine profil
CodeWasher
Cel mai bun răspuns

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
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Box multi language sur site web Rezolvat
language website
Imagine profil
Imagine profil
Imagine profil
3
apr. 24
4263
Some parts don't translate in any languages in webpages
language website
Imagine profil
0
ian. 23
2954
how to disable browser language detection for odoo website ?
language browser website
Imagine profil
Imagine profil
1
apr. 21
6033
Link translation
language translation website
Imagine profil
Imagine profil
2
nov. 17
5103
Cómo deshabilitar la detección de idioma del navegador para el sitio web de Odoo?
language browser website_builder website
Imagine profil
0
sept. 24
1571
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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