Alir3z4 / Alir3z4/html2text

i18n

Offen
#15 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Python
Sterne
2.2k
Forks
296
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.