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

Support different languages #111

Open
steveway opened this issue Aug 25, 2021 · 9 comments
Open

Support different languages #111

steveway opened this issue Aug 25, 2021 · 9 comments

Comments

@steveway
Copy link
Collaborator

Currently Papagayo-NG is English only.
There is not a lot of text so it shouldn't be a big problem.
But having some translations will possibly lower the entry step for some people.
I've done some testing and this seems to be not too complicated.
I've created a .pro project file which can be used with the pyside2-lupdate utility to create some .ts translation files.
These can then be opened with QTLinguist to create some .qm files with the translations.
I've tested some quick German translation of a few things using this:
papagayo-ng-german
As you can see in the image it seems to work pretty well.
I'll add some options to change the language from the GUI and some cleanup/organizing.
And then that part should be good to go.
Currently my tests can be found in this branch: https://github.com/steveway/papagayo-ng/tree/translations

@steveway
Copy link
Collaborator Author

Alright, translations are now better integrated.
They can be selected in the settings, for now only English and German are available.
I will do some tests to see if everything works with that and push and merge this up to this main repo.
After that is merged anyone can create more translations.
@morevnaproject Maybe a Russian translation?

@aziagiles
Copy link

@steveway Hello Steve. Please, send me a tutorial on how to do translations and which files will need to be modified. I actually was the person who did the french phonetic breakdown in Papagayo-NG, and will thus like to help translate the software to french (fr) as the french is a language I master, and one of the 2 official languages in my country.

@steveway
Copy link
Collaborator Author

That is great, having a french translation should help the reach of Papagayo-NG quite a lot.
I will prepare some instructions about creating translations.

@steveway
Copy link
Collaborator Author

Alright, here are the instructions to translate Papagayo-NG in written form first.

  • If your language is not yet added add, an entry to the "TRANSLATIONS" part of the "papagayo-ng.pro" file.
  • use the "pyside2-lupdate" tool to generate the .ts files. (If you have PySide2 installed then you can find the tool in the Scripts folder of your python installation, look into your venv folder if you have a venv.)
    pyside2-lupdate /path/to/papagayo-ng.pro
  • Now you should have a .ts file for all the languages.
  • Use QTLinguist to open these. (On Windows I found a linguist.exe file in the PySide2 folder in my site-packages.)
  • There you should go through the entries and can translate them to your desired language, it looks kinda like this:
    translation_information
  • The grey question mark means that a string is not yet translated.
  • Some strings contain formatting symbols {}, please include them as fits too because the program will add more text there during runtime.
  • Don't forget to save your changes to the .ts file.
  • When you finished your translation, you can share/release it.
  • This will allow you to save your changes as a .qm file, save this to the /rsrc/i18n/ folder.
  • Your translation should now be available in the settings.

It's best to update to my newest Git Commit 08c4d03 because I improved some things regarding the translations.

@ogallagher
Copy link
Contributor

Note that QT is not included in the installation of PySide; you'll need to install that separately in order to have access to QT Linguist. On Mac, after installing (ex. via brew install qt) there is an alias of the tool available at /usr/local/bin/Linguist.

@steveway How do I update to your linked git commit? Is it already merged into any branches in this repo or your fork?

@ogallagher
Copy link
Contributor

I'm currently working on a Spanish translation.

@ogallagher
Copy link
Contributor

@steveway I think these backslash file paths are causing errors for me (not Windows). If I replace them w forward slashes, can you check that the .pro file is still able to be parsed correctly by pyside2-lupdate?

FORMS += rsrc\papagayo-ng2.ui \
rsrc\settings.ui \
rsrc\about_box.ui

@ogallagher
Copy link
Contributor

Here are some results after apparently finishing translations for all available text:

papagayo_lang_select

papagayo_mainwindow_spanish

papagayo_settings_colors_spanish

However, the About window is still showing in English
papagayo_about_english

... even though I thought this was already finished in linguist:
papagayo_linguist_about_spanish

Is the About window purposefully excluded from translations?

@steveway
Copy link
Collaborator Author

The About Dialog loads an html file, about_markdown.html .
There is no code added yet to translate this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants