html2text icon indicating copy to clipboard operation
html2text copied to clipboard

i18n

Open Alir3z4 opened this issue 10 years ago • 6 comments

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:

  1. ~/.config/html2text
  2. Pass to ENV var
  3. Pass the translation on runtime to CLI

So let's talk about those options:

  1. Having app conf under ~/.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.
  2. ENV is a good place if we're not going to keep lots of conf file and an env var such as HTML2TEXT_LANG=miow can be enough and we're good to go. it can be easily picked up while running the program.
  3. I'm not a fan on these, no never! Program should know the translation without explicitly declaring the language.

Alir3z4 avatar Jul 05 '14 00:07 Alir3z4

What is meant by i18n?

theSage21 avatar Feb 27 '16 20:02 theSage21

Usualy it's the abreviation for internationalization.

svetlemodry avatar Feb 28 '16 08:02 svetlemodry

Ok. What would it mean in this context?

theSage21 avatar Feb 28 '16 09:02 theSage21

@theSage21 @svetlemodry Just updated the issue description about it. Thanks for your consideration and I'm sorry for not writing any description earlier.

Alir3z4 avatar Feb 28 '16 11:02 Alir3z4

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 avatar Sep 01 '17 01:09 JokerQyou

@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.

Alir3z4 avatar Sep 01 '17 16:09 Alir3z4