Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Main] Demo for translating UI #3825

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

OzzieIsaacs
Copy link
Contributor

Describe the changes

Currently the translation files for the backend are missing and the translation for the WebUI isn't working. This PR creates a demo for translating the UI, to have a base for discussing further development. It also addresses issue: #3725

First the easy one: Issue #3725: The traceback is thrown because there are no locale files for "en", but this will also never happen, so I added a if lang == "en": do not output traceback expression.

Next one: The webserver is initialized in __init__() function, so self._ is not a valid function, therefore the "starting webserver" message is never outputted translated, as it's the only string in webserver thread to translate, I removed the corresponding function.

I added demo files for the german translation (only a few strings are translated, as demo). The mechanism for doing the WebUI translation is setting the default locale to the choosen language, so a language change requires a restart of pyload-ng.

The code conflicts a bit with the path_prefix change, I hope you can manage this for getting a basic impression.

Now my questions:

The implementation now uses 2 language files for backend (pyload.mo) and frontend (message.mo), shall we change it to one file, or leave it seperate?

How do you plan to generate the language files (looks like apart from documentation it should be babel), then it would be better to have one language file (.mo) where both (back- and frontend) take their translations from?

Do you want to use crowdin for doing the translation work?

Is it okay to have the language change valid after reboot (changing this would create bigger impact, as I can oversee it now)?

Adding translated languages to pyload-ng currently requires a manual edit of pyload.cfg file, shall this be also the future way?

Is this related to a problem?

Translation of UI is currently not working

Additional references

@pep8speaks
Copy link

pep8speaks commented Nov 1, 2020

Hello @OzzieIsaacs! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers!We recommend to use black to automatically correct these files.

Comment last updated at 2021-05-04 18:11:13 UTC

@vuolter vuolter added checking Working on the subject, please wait pyLoad Next labels Nov 9, 2020
# Conflicts:
#	src/pyload/webui/app/__init__.py
#	src/pyload/webui/app/extensions.py
#	src/pyload/webui/webserver_thread.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
checking Working on the subject, please wait pyLoad Next
Development

Successfully merging this pull request may close these issues.

None yet

3 participants