switch languages using pygettext in runtime
Ngân sách $10-30 USD
- Freelancer
- Các công việc
- Python
- switch languages using pygettext in runtime
There is a small project:
[login to view URL]
It outputs:
'one, two, three'
If the line 13 _ = [login to view URL] is commented, then the output is translated to Russian:
'раз, два, три'.
Translation is performed using pygettext. Translations are stored in the locales folder.
There is a python module appendix.py. The module contains class Output. Output has a method additional_print().
Task: I need to switch between languages in __main__.py.
If i want to get Russian output , then _ = ru.gettext.
If i want to use English output, then _ = gettext.gettext.
I want to choose the language in __main__ only, and not in appendix.py.
No changes to the Output class should be done. The choise of the language should be somehow expanded to the [login to view URL] module. Language should not be passed as argument to the additional_print() funciton. Output class should stay in the module appendix.py. No dependency injection is possible.
Được trao cho:
I am an Python Expert I can get this done for you in time. I have understand the project requirement and have gone through the code as well. Please consider me for this and text me for further details. I will provide Thêm
2 freelancer chào giá trung bình$23 cho công việc này
Hello I need more details as how you want to switch between languages we can make an input statement where you enter the language you want Please contact me to discuss how you want it done