Skip to content

Conversation

@MasterOdin
Copy link
Contributor

The current implementation of languages is a bit simplistic and makes it hard for foreign users to actually use tldr. To start, if LANG was set, it's probable that the user would not want to set this just for the sake of tldr. Additionally, there was no support for LANGUAGES which goes against the spec.

Anyway, this improves things (imo) to be a bit nicer on the user.

Some examples and full resolution pattern (ignoring platform):

TLDR_LANGUAGE=ja python3 tldr.py cd
# checks ja

TLDR_LANGUAGE=fr LANG=es python3 tldr.py cd
# checks fr

LANGUAGES=fr:en TLDR_LANGUAGE=ja LANG=es python3 tldr.py cd
# checks ja, then fr, then en

LANGUAGES=fr:en LANG=C python3 tldr.py cd
# ignores C, checks fr, then en

The change to how the page itself was rendered was that setting your LANG=en would cause my system to attempt the page in ascii regardless of the resolved language, which would throw an error if printing out non-en pages.

@MasterOdin MasterOdin requested a review from zlatanvasovic May 16, 2020 02:09
@zlatanvasovic
Copy link
Contributor

Perfect!

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.

2 participants