Michal Čihař - Blog Archives for Odorik

Translating Sphinx documentation

Few days ago, I've started writing Odorik module to manipulate with API of one Czech mobile network operator. As usual, the code comes with documentation written in English. Given that vast majority of users are Czech, it sounds useful to have in Czech language as well.

The documentation itself is written in Sphinx and built using Read the Docs. Using those to translate the documentation is quite easy.

First step is to add necessary configuration to the Sphinx project as described in their Internationalization Quick Guide. It's matter of few configuration directives and invoking of sphinx-intl and the result can be like this commit.

Once the code in repository is ready, you can start building translated documentation on the Read the docs. There is nice guide for that as well. All you need to do is to create another project, set it's language and link it from master project as translation.

The last step is to find some translators to actually translate the document. For me the obvious choice was using Weblate, so the translation is now on Hosted Weblate. The mass import of several po files can be done by import_project management command.

And thanks to all these you can now read Czech documentation for python Odorik module.

Odorik modul 0.4

Dnes jsem vydal novou verzi Python modulu Odorik. Přidává spoustu užitečných vlastností pro zjištění stavu účtu.

Jako bonus k tomuto vydání je dokumentace přeložená do češtiny za použití Weblate.

Python modul pro Odorik

Pokud náhodou použáváte operátora Odorik, mohl by se vám hodit můj nový modul pro Python. Dokonce ani nemusíte umět Python, dá se použít i přímo z příkazové řádky.

Funkčnost je zatím velmi jednoduchá, ale čase určitě přibudou další užitečné funkce (nebojte se mi nahlásit nápady).

Zjištění zůstatku na účtu:

$ odorik balance
balance: 123.45

Zjištění aktuálního využití dat:

$ odorik mobile-data --phone 00420789123456
bytes_total: 111593707
bytes_down: 87039672
bytes_up: 24554035
price: 0

Odeslání SMS zprávy:

$ odorik send-sms 00420789123456 "Ahoj, jak se mas?"

Více příkadů naleznete v dokumentaci.