tldr-pages / tldr

📚 Collaborative cheatsheets for console commands
https://tldr.sh
Other
49.45k stars 4.06k forks source link

Client Spec: Language detection for non-POSIX systems #3886

Open dbrgn opened 4 years ago

dbrgn commented 4 years ago

The spec says:

If a client has access to environment variables, several standard ones exist to specify the language in which a client should operate. If not, then clients MUST make reasonable assumptions based on the information provided by the environment in which they operate (e.g. consulting navigator.languages in a browser, etc.).

Windows systems do have environment variables, but the language detection does not work that way. (I don't know right now how detection should be done, but it's not through env vars.)

I would suggest to make the wording a bit more generic, stating that a client must implement reasonable detection of the system language. Then, I would move the parts about LANG, LANGUAGE and LC_MESSAGES to a section that only applies to POSIX-ish systems.

schneiderl commented 4 years ago

I agree that we should state this in a more generic way. I don't believe it's us that must specify how someone implementing a client should detect the system language. Just saying it must do it should be enough.

sbrl commented 4 years ago

Ah, thanks for opening this issue! Indeed, this is a problem. I think we should still include at least some guidance on the environment variable for POSIX systems though, because I would guess that implementers writing POSIX-compatible clients will find it helpful.