Skip to content
Permalink
Browse files

Make tours translatable

  • Loading branch information...
lasconic committed Dec 21, 2018
1 parent 12d0e18 commit 2c9935fcd4540f57ec7b5bf26c458cca0b0c8ce9
Showing with 10,877 additions and 2 deletions.
  1. +7 −0 .tx/config
  2. +6 −0 CMakeLists.txt
  3. +16 −0 build/gen-tours-projectfile
  4. +16 −0 build/gen-tours-projectfile.bat
  5. +4 −0 build/travis/job_macos_lupdate/script.sh
  6. +1 −0 mscore/musescore.cpp
  7. +7 −1 mscore/resourceManager.cpp
  8. +2 −1 mscore/tourhandler.cpp
  9. +1 −0 share/locale/README.md
  10. +167 −0 share/locale/tours_af.ts
  11. +167 −0 share/locale/tours_ar.ts
  12. +167 −0 share/locale/tours_ar_DZ.ts
  13. +167 −0 share/locale/tours_ar_EG.ts
  14. +167 −0 share/locale/tours_ar_SD.ts
  15. +167 −0 share/locale/tours_ast.ts
  16. +167 −0 share/locale/tours_be.ts
  17. +167 −0 share/locale/tours_bg.ts
  18. +167 −0 share/locale/tours_ca.ts
  19. +167 −0 share/locale/tours_ca@valencia.ts
  20. +167 −0 share/locale/tours_cs.ts
  21. +167 −0 share/locale/tours_cy.ts
  22. +167 −0 share/locale/tours_da.ts
  23. +167 −0 share/locale/tours_de.ts
  24. +167 −0 share/locale/tours_el.ts
  25. +233 −0 share/locale/tours_en.ts
  26. +167 −0 share/locale/tours_en_GB.ts
  27. +167 −0 share/locale/tours_en_US.ts
  28. +167 −0 share/locale/tours_eo.ts
  29. +167 −0 share/locale/tours_es.ts
  30. +167 −0 share/locale/tours_et.ts
  31. +167 −0 share/locale/tours_eu.ts
  32. +167 −0 share/locale/tours_fa.ts
  33. +167 −0 share/locale/tours_fi.ts
  34. +167 −0 share/locale/tours_fo.ts
  35. +167 −0 share/locale/tours_ga.ts
  36. +167 −0 share/locale/tours_gd.ts
  37. +167 −0 share/locale/tours_gl.ts
  38. +167 −0 share/locale/tours_he.ts
  39. +167 −0 share/locale/tours_hi_IN.ts
  40. +167 −0 share/locale/tours_hr.ts
  41. +167 −0 share/locale/tours_hu.ts
  42. +167 −0 share/locale/tours_hy.ts
  43. +167 −0 share/locale/tours_id.ts
  44. +167 −0 share/locale/tours_ig.ts
  45. +167 −0 share/locale/tours_it.ts
  46. +167 −0 share/locale/tours_ja.ts
  47. +167 −0 share/locale/tours_ka.ts
  48. +167 −0 share/locale/tours_kab.ts
  49. +167 −0 share/locale/tours_ko.ts
  50. +167 −0 share/locale/tours_lt.ts
  51. +167 −0 share/locale/tours_lv.ts
  52. +167 −0 share/locale/tours_ml.ts
  53. +167 −0 share/locale/tours_mn_MN.ts
  54. +167 −0 share/locale/tours_nb.ts
  55. +167 −0 share/locale/tours_nl.ts
  56. +167 −0 share/locale/tours_nn.ts
  57. +167 −0 share/locale/tours_pl.ts
  58. +167 −0 share/locale/tours_pt.ts
  59. +167 −0 share/locale/tours_pt_BR.ts
  60. +167 −0 share/locale/tours_ro.ts
  61. +167 −0 share/locale/tours_ru.ts
  62. +167 −0 share/locale/tours_sk.ts
  63. +167 −0 share/locale/tours_sl.ts
  64. +167 −0 share/locale/tours_sr.ts
  65. +167 −0 share/locale/tours_sr_RS.ts
  66. +167 −0 share/locale/tours_sv.ts
  67. +167 −0 share/locale/tours_th.ts
  68. +167 −0 share/locale/tours_tr.ts
  69. +167 −0 share/locale/tours_uk.ts
  70. +167 −0 share/locale/tours_uz@Latn.ts
  71. +167 −0 share/locale/tours_vi.ts
  72. +167 −0 share/locale/tours_zh_CN.ts
  73. +167 −0 share/locale/tours_zh_TW.ts
  74. +36 −0 share/tours/generateTs.py
  75. +27 −0 share/tours/tourxml.h
@@ -14,4 +14,11 @@ source_file = share/locale/instruments_en_US.ts
source_lang = en_US
type = QT

[musescore.tours]
file_filter = share/locale/tours_<lang>.ts
source_file = share/locale/tours_en_US.ts
source_lang = en_US
type = QT



@@ -831,6 +831,8 @@ add_custom_target(lupdate
COMMAND Qt5::lupdate ${PROJECT_BINARY_DIR}/mscore.pro
COMMAND ${PROJECT_SOURCE_DIR}/build/gen-instruments-projectfile ${PROJECT_SOURCE_DIR}/share/instruments > instruments.pro
COMMAND Qt5::lupdate ${PROJECT_BINARY_DIR}/instruments.pro
COMMAND ${PROJECT_SOURCE_DIR}/build/gen-tours-projectfile ${PROJECT_SOURCE_DIR}/share/tours > tours.pro
COMMAND Qt5::lupdate ${PROJECT_BINARY_DIR}/tours.pro
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)

@@ -842,13 +844,17 @@ file(GLOB INSTRUMENTS_TS_FILES
file(GLOB MSCORE_TS_FILES
"share/locale/mscore*.ts"
)
file(GLOB TOURS_TS_FILES
"share/locale/tours*.ts"
)
file(GLOB QT_TS_FILES
"share/locale/qt*.ts"
)

add_custom_target(lrelease
COMMAND Qt5::lrelease ${INSTRUMENTS_TS_FILES}
COMMAND Qt5::lrelease ${MSCORE_TS_FILES}
COMMAND Qt5::lrelease ${TOURS_TS_FILES}
COMMAND Qt5::lrelease ${QT_TS_FILES}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)
@@ -0,0 +1,16 @@
#!/bin/sh

echo "TRANSLATIONS = \\"
uis=`find $1/../../share/locale/ -name "tours_*.ts"`
for a in $uis; do
echo " " $a \\;
done
echo

echo "HEADERS = \\"
uis=`find $1 -name "*.h"`
for a in $uis; do
echo " " $a \\;
done
echo
echo
@@ -0,0 +1,16 @@
@echo off

set OLD_DIR=%CD%

echo TRANSLATIONS = \
for /r %1/../../share/locale/ %%a in (tours_*.ts) do echo %%a \
echo.

cd /d %1

echo HEADERS= \
for /r %1 %%a in (*.h) do echo %%a \
echo.
echo.

cd /d %OLD_DIR%
@@ -13,8 +13,12 @@ fi
lupdate mscore.pro
./build/gen-instruments-projectfile ./share/instruments > instruments.pro
lupdate instruments.pro
./build/gen-tours-projectfile ./share/tours > tours.pro
lupdate tours.pro

rm mscore.pro
rm instruments.pro
rm tours.pro

sudo pip install transifex-client

@@ -3134,6 +3134,7 @@ void setMscoreLocale(QString _localeName)
// try to replicate QTranslator.load algorithm in our particular case
loadTranslation("mscore", _localeName);
loadTranslation("instruments", _localeName);
loadTranslation("tours", _localeName);

QString resourceDir;
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
@@ -231,7 +231,13 @@ void ResourceManager::displayLanguages()

bool verifyInstruments = verifyLanguageFile(filenameInstruments, hashInstruments);

if (verifyMScore && verifyInstruments) { // compare local file with distant hash
QJsonObject toursObject = value.value("tours").toObject();
QString hashTours = toursObject.value("hash").toString();
QString filenameTours = toursObject.value("file_name").toString();

bool verifyTours = verifyLanguageFile(filenameTours, hashTours);

if (verifyMScore && verifyInstruments && verifyTours) { // compare local file with distant hash
temp->setText(tr("Updated"));
temp->setDisabled(1);
}
@@ -154,7 +154,8 @@ void TourHandler::loadTour(XmlReader& tourXml)
while (tourXml.readNextStartElement()) {
if (tourXml.name() == "Text") {
QTextDocument doc;
doc.setHtml(tourXml.readXml());
QString ttext = qApp->translate("TourXML", tourXml.readXml().toUtf8().data());
doc.setHtml(ttext);
text = doc.toPlainText().replace("\\n", "\n");
}
else if (tourXml.name() == "Widget")
@@ -21,6 +21,7 @@ In [MuseScore source](https://github.com/musescore/MuseScore)

* Add the share/locale/mscore_XX.ts file, tx pull can help (`tx pull -t language_code)
* Add the share/locale/instruments_XX.ts file, see above
* Add the share/locale/tours_XX.ts file, see above
* Finally create a PR
@@ -0,0 +1,167 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="af">
<context>
<name>TourXML</name>
<message>
<source>To add a note to a chord, press Shift while typing its letter name, or click on the staff.</source>
<comment>note-input</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>To create a triplet or other tuplet, select the duration representing the total length of the tuplet, then press Ctrl+number or use Add / Tuplets.</source>
<comment>note-input</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Welcome to MuseScore! This brief tour will guide you through the MuseScore user interface.</source>
<comment>welcome</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>The Playback Controls toolbar allows you to play/pause your score and control various aspects of playback.</source>
<comment>welcome</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>The Note Input toolbar allows you to enter notes and rests into your score.</source>
<comment>welcome</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>The Palettes allow you to add most other notation elements to your score.</source>
<comment>welcome</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>The Inspector allows you to control various details of the elements in your score.</source>
<comment>welcome</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Each palette contains items that can be added to the score.</source>
<comment>show-palette</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Welcome to the Palettes, where you will add various elements to your score. Click &quot;Next&quot; to learn more.</source>
<comment>show-palette</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>To enter a note of the selected duration, type its letter name or click on the staff.
Press Ctrl+Up/Down (macOS: Cmd+Up/Down) to change octave.</source>
<comment>note-input</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>To add an accidental to a note, press the shortcut Up or Down to raise or lower its pitch,
or click one of these icons.</source>
<comment>note-input</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>To enter notes with different rhythms in the same measure, use multiple voices.
Each staff can have up to four voices.
The default is voice 1, and it should be used first for each staff.
To enter notes into a different voice, click one of these icons.</source>
<comment>note-input</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>This is the score view, where you can view and edit your score.
Use your mouse wheel or touchpad to scroll (with Shift to scroll horizontally).
If you have multiple scores open, you can switch between them using tabs at the top of your score view.</source>
<comment>welcome</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>These are the toolbars.
The main three are File Operations, Playback Controls, and Note Input.</source>
<comment>welcome</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>The File Operations toolbar allows you to create/save/open/print files and undo/redo changes.
You can also save to your musescore.com account if you go to File / Save Online.
The controls at the right of this toolbar control the display of your score.</source>
<comment>welcome</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>The main menu contains most other commands.
In addition, many commands can be accessed via keyboard shortcuts or by right-clicking (macOS: Ctrl+clicking) within the score view.</source>
<comment>welcome</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>There are different workspaces available with different sets of palettes.
The &quot;Advanced&quot; workspace contains more items than the &quot;Basic&quot; workspace.</source>
<comment>show-palette</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>To add a palette item to your score, first select an element or range in your score, then double-click on the palette item to add it to the selected elements.
You can also drag an item from the palette and drop it on a specific element in your score.</source>
<comment>show-palette</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>You have toggled multimeasure rests in this score.
This combines multiple measures of rests into a single multimeasure rest.
To toggle this setting again, press the shortcut &quot;M&quot;.</source>
<comment>mmrest</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Each box represents a measure of a specific instrument.
If it is highlighted, then there are notes in that measure.
The timeline also shows rehearsal marks, changes of tempo, key, or time signature, and other points of interest.
Boxes within the thin blue outline represent measures that are currently in view.
You can click anywhere to jump to the corresponding location in your score.</source>
<comment>timeline-tour</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Welcome to note input, where you will enter notes and rests into your score.
Click &quot;Next&quot; to learn more.</source>
<comment>note-input</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>To enable note input mode, click the &quot;Note input&quot; icon or press the shortcut &quot;N&quot;.</source>
<comment>note-input</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Select a duration by clicking one of these icons or pressing the shortcuts &quot;1&quot; - &quot;9&quot;.
To include an augmentation dot, click the appropriate icon or press the shortcut &quot;.&quot;.</source>
<comment>note-input</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>To enter a rest of the selected duration, press the shortcut &quot;0&quot;, or select this icon then click on the staff.</source>
<comment>note-input</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>To extend a note by adding a tied note, select the duration to extend by, then press &quot;+&quot; or click this button.</source>
<comment>note-input</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>That&apos;s the end of this tour!
As you use MuseScore, more tours will pop up to further explain functionality.
To disable these, deselect &quot;Continue showing tours&quot; before closing this window.
You can also enable/disable tours in Help / Tours.</source>
<comment>welcome</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>Welcome to the Timeline, where you can view a reduction of the score for easier navigation.
Click &quot;Next&quot; to learn more.</source>
<comment>timeline-tour</comment>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

0 comments on commit 2c9935f

Please sign in to comment.
You can’t perform that action at this time.