CorrelAid / datenguide-python

MIT License
34 stars 7 forks source link

69 translate get statistics #84

Closed cbocionek closed 4 years ago

cbocionek commented 4 years ago

Relates to issue #69. Adds possibility of translating short and long statistic descriptions in result of get_statistics into different languages by using optional argument target_language, e.g. get_statistics(target_language='en'). Added static file for translation of short and long statistic descriptions into English. Translation into other languages is currently not statically available. Optionally, an instance of a class implementing TranslationProvider can be passed to get_statistics to translate its result on-the-fly. By default, an instance of SchemaTranslationProvider is used, which accesses the static translation file.

The script tasks/translate_schema.py was used to generate the static translation file and can be reexecuted as needed. Uses the package googletrans, which was added as a development dependency.

KonradUdoHannes commented 4 years ago

While reviewing the pull request I noticed an issue regarding the pypi deployment with respect to the package data. This turned out to be a critical bug in the 0.2.1 release. I fixed this and released 0.2.2 such that the current release is working again. It meant some slight change in the package structure that is also essential for the current pull request to work as a pypi release. As such I would recommend @cbocionek to merge the current master into the branch and adjust file paths accordingly.

For the future I hope that we'll find some additional configuration/tool for qa that will help to catch this type of pypi deployment problem automatically and hence earlier.