Closed lucasoshiro closed 4 years ago
ping @waldyrious ! Can you review this, please? Thanks!
This PR is very interesting. When I have a bit of time I could review it, but I can't promise it, @lucasoshiro.
@ivanhercaz ok, thanks!
@lucasoshiro I wasn't active much when you proposed this, so it seems I missed this PR.
This has some merge conflicts with the recently merged PRs that changed the way page requests operate. Are you still interested in working on this, to check if those recent changes work along with your proposed change?
Thank you for the valuable contribution nevertheless.
@zdroid I rebased this PR with master and solved the conflitcts, I think it's ok now. Thanks for the review!
What do you think about adding another TLDR_
configuration variable? Maybe TLDR_PAGES_LANGUAGE
or just TLDR_LANGUAGE
. It would replace the need to type -l <language>
every time.
The client specification already includes words on how to support language environment variables: https://github.com/tldr-pages/tldr/blob/master/CLIENT-SPECIFICATION.md#language.
@MasterOdin I decided to merge #101 first because else we'd be making too many redundant changes. But we can move on to complete this one now.
I've resolved the merge conflicts. What's left is to fix the way update_cache()
works, so that it doesn't store redundant languages.
Hi!
Although the https://github.com/tldr-pages/tldr repository has pages in other languages than English, the only way to read a page in another language was changing the page source with
-s
or--source
.This PR makes
tldr
detect the system language and use it to download the page in that language if it's available. Otherwise, it will download in English instead. It's also possible to provide the language with-l
or--language
.