Open Alir3z4 opened 10 years ago
What is meant by i18n?
Usualy it's the abreviation for internationalization.
Ok. What would it mean in this context?
@theSage21 @svetlemodry Just updated the issue description about it. Thanks for your consideration and I'm sorry for not writing any description earlier.
I don't quite understand why i18n matters for a cli tool, but if you're going to implement it, wouldn't it be enough to just read from LANG
/ LANGUAGE
/ LC_CTYPE
environment variables?
@JokerQyou the CLI help and description in the source code are all written in English. Would be fine if the CLI was in Arabic or Spanish and English speaking people wanted to use it ? I don't think so. The same goes for non-english speaking people.
Since not all of the world is speaking English, having i18n (or as @svetlemodry said internationalization) would be really good.
Right now, https://github.com/Alir3z4/html2text/blob/master/html2text/cli.py is the only place to start working on its translation.
Python itself is great with
gettext
and handling translations, the only thing that remains is how to run the app in the specific translation.For example how to keep track of the selected translation would be keeping the configuration via:
~/.config/html2text
ENV
varSo let's talk about those options:
~/.config/html2text
is something standard in GNU/Linux and *unix based machines. In future with regards of the progress of the CLI we can easily expand and use that configuration file. This option makes CLI slower on load time, since it should read a file from user conf dir.ENV
is a good place if we're not going to keep lots of conf file and an env var such asHTML2TEXT_LANG=miow
can be enough and we're good to go. it can be easily picked up while running the program.