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

feat: add locale header to request to fetch content based on system locale if possible #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

srevinsaju
Copy link
Member

Related to #176

@codecov
Copy link

codecov bot commented Jan 12, 2021

Codecov Report

Merging #178 (1775d1e) into master (3f00ed8) will increase coverage by 0.66%.
The diff coverage is 75.96%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
archivy/config.py 91.30% <ø> (ø)
archivy/search.py 39.28% <0.00%> (ø)
setup.py 0.00% <0.00%> (ø)
tests/test_click_web.py 100.00% <ø> (ø)
archivy/click_web/resources/cmd_exec.py 55.15% <40.98%> (ø)
archivy/click_web/resources/cmd_form.py 63.23% <41.66%> (ø)
archivy/click_web/web_click_types.py 73.33% <50.00%> (ø)
archivy/helpers.py 78.43% <50.00%> (ø)
archivy/cli.py 70.96% <60.00%> (ø)
archivy/click_web/resources/input_fields.py 75.72% <64.61%> (ø)
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f00ed8...58c9e40. Read the comment docs.

@srevinsaju
Copy link
Member Author

ping for a merge.

archivy/models.py Outdated Show resolved Hide resolved
@@ -92,7 +93,15 @@ def process_bookmark_url(self):
return None

try:
url_request = requests.get(self.url)
try:
lc = locale.getdefaultlocale()[0].replace('_', '-')
Copy link
Member

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 -)?

Copy link
Member Author

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?

Copy link
Member

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants