Self deployable language packs in MuseScore
Adding new translations to MuseScore is currently done by changing a couple of files in the code in which the list of translations is hard coded. These are CMakeLists.txt, gen-qt-projectfile and gen-qt-projectfile.bat and preferences.cpp.
When a handbook is translated, the menu has to be updated in a file: mscore.cpp (line 887). This is to make a reference in the MuseScore menu to the online handbook. When adding a new translated pdf handbook, this is simply done by dropping the pdf file in the man
folder. For including the pdf into a release, there has to changed one file: CMakeLists.txt. However, this file is only for packaging.
Changing all these files when there is something new concerning translations (qm, pdf, website link) is not very convenient. Instead, it could be centralized in one file, preferably an external one and xml based. Lasconic already made a proposal for this file on the mailing list.
Having this external xml file opens the opportunity to enhance MuseScore even further to accept self deploying language packs. This means that when a new stable release is out, translations can be added and updated at any time in a simple manner. The self deploying language packs can be provided on the musescore.org website with a specific extension (e.g. .mscp) which can be opened by MuseScore and deployed/installed.
Comments
This first step for this task is to have an xml file with the list of available QM files and available handbook URL.
The file is external and can be change by an advanced user to add a language to his installation. The language will be available to choose in the preferences panel and the QM file will be picked.
This file is not linked to the PDF handbook.
The file languages.xml has been added in r2561
Please review.
To find the handbook URL, MuseScore gets the locale, the system one or the one set in preferences and try to find a match in languages.xml. If not found, it tries to match the first two letters.
Of course, adding a language to the MuseScore package is still needed to have the languages in the release. So modifying CMakeLists.txt & gen-qt-projectfile is necessary to include the default languages in the release package.
Terrific! I would like to add one property per language in the future and that will be a version number or a date. This way, one can manually see when there is an update available. The downloadable language packages could named as followed
fr-0.9.6-1.0.mscp
where the last number 1.0 stands for the translation version. 1.x could stand for small fixes, while 2.x could stand for a major overhaul.However, let's test the current changes first. It's already a great step forward.
See //musescore.org/en/node/61166
Or #61166: Get ride of locale name in languages.xml
Lol... Schitz and his love of redundancy..
@awelch83, please keep comments respectable.
Using that [ # nnnn ] Syntax ensures the issues to get cross linked to one another. It is less to type and looks nicer too.
@awelch83: So today your 'm' key is broken again? And I took your apology on IRC yesterday for real, stupid me. Won't make that mistake again.