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
feat: add locale header to request to fetch content based on system locale if possible #178
base: master
Are you sure you want to change the base?
Conversation
04c4c15
to
9a39260
Compare
Codecov Report
@@ Coverage Diff @@
## master #178 +/- ##
==========================================
+ Coverage 82.01% 82.68% +0.66%
==========================================
Files 27 27
Lines 1763 1808 +45
==========================================
+ Hits 1446 1495 +49
+ Misses 317 313 -4
Continue to review full report at Codecov.
|
ping for a merge. |
9a39260
to
58c9e40
Compare
@@ -92,7 +93,15 @@ def process_bookmark_url(self): | |||
return None | |||
|
|||
try: | |||
url_request = requests.get(self.url) | |||
try: | |||
lc = locale.getdefaultlocale()[0].replace('_', '-') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work for every locale (replacing _
with -
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope it works, is there any case it doesnt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, I don't know much about locales and how it works with web requests, so I was asking since you opened the PR.
I just want to make sure the code we merge in works well :)
Related to #176