JosephEoff / MuseScore_UltraStar_Exporter

MuseScore plugin to create UltraStar files
GNU General Public License v2.0
0 stars 3 forks source link

Updated voices comboboxes with labels matching those from MuseScore #5

Closed jeetee closed 8 years ago

jeetee commented 8 years ago

Text keys for voices now match the ones used for translating MuseScore (from the Dutch translation index). This should benefit us in the future when plugins leverage existing translations and be more user friendly.

Also fixes auto-updating of the textlabels upon changing instrument selection.

JosephEoff commented 8 years ago

Selection box text matches in English. The German translation doesn't work, though. The translation in line 68 cannot work. qsTr needs a simple text, but line 68 gives it a text built up from a text and an integer. voiceList.append({ j: qsTr("Voice" + ' ' + (j + 1)) }); needs to be more like voiceList.append({ j: qsTr("Voice") + ' ' + (j + 1) }); Afterwards, the translations need to be updated with qt5 Linguist. There is already a translation for Voice, the Linguist just needs to be updated to include the new usage.

Fix line 68 and I will merge the change and then I will update the translation. Would it be possible for you to make a translation for Flemish or French?

jeetee commented 8 years ago

The idea was to leverage the existing MuseScore translations from the main app (which is there still a feature request though).

According to this blogpost the translation is only processed at runtime, so it technically should work. Although we should as QT_TR_NOOP calls for the dynamically created keys.

Simply speaking I was only looking to fix the number, so even just making it { j: (j+1) } would be OK for me as well, as we already have a label just in front of the combobox indicating that you're selecting the voice to be used.

Haven't used Qt Linguist before, but I'm willing to try to provide a Dutch translation. My French is rather below average, so I don't think that would be a good idea :)

JosephEoff commented 8 years ago

OK. Good. Just change the numbers, and we'll call it done.

JosephEoff commented 8 years ago

qsTr has two jobs. One is to provide the translations at runtime. The other is to mark the strings to be translated so that Linguist can find them. Linguist can't do much with a dynamically generated string, so you'll either get an error message or the string won't end up in the translation table. So, qsTr at runtime can easily translate a dynamic text provided the same text is marked with qsTr as a static text somewhere else.

As for the translations, I just realized that MuseScore itself doesn't do Flemish so that wouldn't help. I could put my kids to doing a French version (they both have French in school,) so that's covered. I'll see about creating a Dutch translation file in a separate branch.