Alir3z4 / Alir3z4/html2text

i18n

オープン
#15 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Python
スター
2.2k
フォーク
296
PR マージ指標
30日以内にマージされた PR はありません

説明

Since not all of the world is speaking English, having i18n (or as @svetlemodry said [internationalization](http://www.i18nguy.com/origini18n.html)) 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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。