Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][ADD] website_geoip_language #1042

Closed
wants to merge 1 commit into from

Conversation

yibudak
Copy link

@yibudak yibudak commented May 8, 2024

While experimenting with Odoo's GeoIP capabilities, I noticed that the website did not have automatic language selection based on the customer's IP address. I searched for modules that did this, but I could not find an example and decided to make this module.

Technically, I monkey-patching the “best_lang” property in the odoo.http.Request class so that the client's IP address takes priority in language selection. Maybe there is a better way, but this is how I was able to make the module without breaking the overall functioning of the system.

There is no need to make any additional configuration for the module, it works if the module is installed and the GeoIP database is defined in Odoo. Maybe I need to explain this in a better way in the “Usage” section, I am waiting for your help.

@yibudak
Copy link
Author

yibudak commented May 8, 2024

@pedrobaeza pedrobaeza added this to the 16.0 milestone May 11, 2024
@pedrobaeza
Copy link
Member

Interesting addition. Maybe you should use Odoo patch method instead of direct Python monkey-patching. Apart from that, it seems good.

@yibudak
Copy link
Author

yibudak commented May 11, 2024

Interesting addition. Maybe you should use Odoo patch method instead of direct Python monkey-patching. Apart from that, it seems good.

Thanks for your attention Pedro. I don't know what you mean by using Odoo's patch method, is there such a method for Python like there is for Javascript?

@pedrobaeza
Copy link
Member

Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Sep 15, 2024
@yibudak yibudak closed this Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants