Alir3z4 / Alir3z4/html2text

i18n

未关闭
#15 6 条评论 0 个 reaction 已指派 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 摘要。