Updated the tr strings

git-svn-id: https://svn.code.sf.net/p/pianobooster/code/trunk@103 ba081f5d-443b-49a7-ac4b-446c3f91f371
This commit is contained in:
louisjb 2010-02-11 08:56:51 +00:00
parent 5d03056061
commit 826d52adb7
6 changed files with 166 additions and 154 deletions

View File

@ -227,14 +227,14 @@ void CGLView::drawDisplayText()
glColor3f(1.0,1.0,1.0); glColor3f(1.0,1.0,1.0);
if (m_song->getPlayMode() != PB_PLAY_MODE_listen) if (m_song->getPlayMode() != PB_PLAY_MODE_listen)
renderText(30, y-4,0 ,"Accuracy:", m_timeRatingFont); renderText(30, y-4,0 ,tr("Accuracy:"), m_timeRatingFont);
if (m_titleHeight < 45 ) if (m_titleHeight < 45 )
return; return;
y = Cfg::getAppHeight() - m_titleHeight; y = Cfg::getAppHeight() - m_titleHeight;
renderText(30, y+6, 0,"Song: " + m_song->getSongTitle(), m_timeRatingFont); renderText(30, y+6, 0,tr("Song: ") + m_song->getSongTitle(), m_timeRatingFont);
/* /*
char buffer[100]; char buffer[100];
sprintf(buffer, "Notes %d wrong %d Late %d Score %4.1f%%", sprintf(buffer, "Notes %d wrong %d Late %d Score %4.1f%%",
@ -257,7 +257,7 @@ void CGLView::drawBarNumber()
//CDraw::drColour (Cfg::noteColourDim()); //CDraw::drColour (Cfg::noteColourDim());
//glRectf(x+30+10, y-2, x + 80, y + 16); //glRectf(x+30+10, y-2, x + 80, y + 16);
glColor3f(1.0,1.0,1.0); glColor3f(1.0,1.0,1.0);
renderText(x, y, 0,"Bar: " + QString::number(m_song->getBarNumber()), m_timeRatingFont); renderText(x, y, 0, tr("Bar: ") + QString::number(m_song->getBarNumber()), m_timeRatingFont);
} }
void CGLView::resizeGL(int width, int height) void CGLView::resizeGL(int width, int height)

View File

@ -89,15 +89,15 @@ void CMidiFile::openMidiFile(string filename)
m_file.open(filename.c_str(), ios_base::in | ios_base::binary); m_file.open(filename.c_str(), ios_base::in | ios_base::binary);
if (m_file.fail() == true) if (m_file.fail() == true)
{ {
QMessageBox::warning(0, "Midi File Error", QMessageBox::warning(0, tr("Midi File Error"),
"Cannot open \"" + QString(filename.c_str()) + "\""); tr("Cannot open \"" + QString(filename.c_str()) + "\""));
midiError(SMF_CANNOT_OPEN_FILE); midiError(SMF_CANNOT_OPEN_FILE);
return; return;
} }
rewind(); rewind();
if (getMidiError() != SMF_NO_ERROR) if (getMidiError() != SMF_NO_ERROR)
QMessageBox::warning(0, "Midi File Error", QMessageBox::warning(0, tr("Midi File Error"),
"Midi file\"" + QString(filename.c_str()) + "\" is corrupted"); tr("Midi file\"" + QString(filename.c_str()) + "\" is corrupted"));
} }
void CMidiFile::rewind() void CMidiFile::rewind()

View File

@ -23,19 +23,31 @@
#include <QtOpenGL> #include <QtOpenGL>
#include "QtWindow.h" #include "QtWindow.h"
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication app(argc, argv); QApplication app(argc, argv);
QString locale = QLocale::system().name();
printf("locale = %s\n", qPrintable(locale));
QTranslator translator;
translator.load(QString("pianobooster_") + locale);
app.installTranslator(&translator);
if (!QGLFormat::hasOpenGL()) { if (!QGLFormat::hasOpenGL()) {
QMessageBox::information(0, "OpenGL support", QMessageBox::information(0, tr("OpenGL support"),
"This system does not support OpenGL which is needed to run Piano Booster."); tr("This system does not support OpenGL which is needed to run Piano Booster."));
return -1; return -1;
} }
QtWindow window; QtWindow window;
window.show(); window.show();
return app.exec(); return app.exec();
} }

View File

@ -183,16 +183,16 @@ void QtWindow::decodeMidiFileArg(QString arg)
if (!fileInfo.exists() ) if (!fileInfo.exists() )
{ {
QMessageBox::warning(0, "PianoBooster Midi File Error", QMessageBox::warning(0, tr("PianoBooster Midi File Error"),
"Cannot Open\"" + fileInfo.absoluteFilePath() + "\""); tr("Cannot Open\"" + fileInfo.absoluteFilePath() + "\""));
exit(1); exit(1);
} }
else if ( !(fileInfo.fileName().endsWith(".mid", Qt::CaseInsensitive ) || else if ( !(fileInfo.fileName().endsWith(".mid", Qt::CaseInsensitive ) ||
fileInfo.fileName().endsWith(".midi", Qt::CaseInsensitive ) || fileInfo.fileName().endsWith(".midi", Qt::CaseInsensitive ) ||
fileInfo.fileName().endsWith(".kar", Qt::CaseInsensitive )) ) fileInfo.fileName().endsWith(".kar", Qt::CaseInsensitive )) )
{ {
QMessageBox::warning(0, "PianoBooster Midi File Error", QMessageBox::warning(0, tr("PianoBooster Midi File Error"),
"Not a Midi File \"" + fileInfo.fileName() + "\""); tr("Not a Midi File \"" + fileInfo.fileName() + "\""));
exit(1); exit(1);
} }
else else
@ -215,8 +215,8 @@ void QtWindow::decodeMidiFileArg(QString arg)
m_settings->setValue("CurrentSong", fileInfo.absoluteFilePath()); m_settings->setValue("CurrentSong", fileInfo.absoluteFilePath());
else else
{ {
QMessageBox::warning(0, "PianoBooster Midi File Error", QMessageBox::warning(0, tr("PianoBooster Midi File Error",
"Not a valid MIDI file \"" + fileInfo.absoluteFilePath() + "\""); tr("Not a valid MIDI file \"" + fileInfo.absoluteFilePath() + "\""));
exit(1); exit(1);
} }
} }

View File

@ -252,9 +252,9 @@ QStringList CTrackList::getAllChannelProgramNames(bool raw)
if (raw == false) if (raw == false)
{ {
if (CNote::leftHandChan() == chan) if (CNote::leftHandChan() == chan)
hand += "L"; hand += tr("L");
if (CNote::rightHandChan() == chan) if (CNote::rightHandChan() == chan)
hand += "R"; hand += tr("R");
} }
text = QString::number(chan+1) + hand + " " + getChannelProgramName(chan); text = QString::number(chan+1) + hand + " " + getChannelProgramName(chan);
items += text; items += text;
@ -327,10 +327,10 @@ QString CTrackList::getChannelProgramName(int chan)
int program = m_midiFirstPatchChannels[chan]; int program = m_midiFirstPatchChannels[chan];
if (chan==10-1) if (chan==10-1)
return "Drums"; return tr("Drums");
QString name = getProgramName(program +1); // Skip QString name = getProgramName(program +1); // Skip
if (name.isEmpty()) if (name.isEmpty())
name = "Unknown"; name = tr("Unknown");
return name; return name;
} }
@ -339,135 +339,135 @@ QString CTrackList::getProgramName(int program)
{ {
const char * const gmInstrumentNames[] = const char * const gmInstrumentNames[] =
{ {
"(None)", // Don't use tr("(None)"), // Don't use
/* 1. */ "Grand Piano", /* 1. */ tr("Grand Piano"),
/* 2. */ "Bright Piano", /* 2. */ tr("Bright Piano"),
/* 3. */ "Electric Grand", /* 3. */ tr("Electric Grand"),
/* 4. */ "Honky-tonk Piano", /* 4. */ tr("Honky-tonk Piano"),
/* 5. */ "Electric Piano 1", /* 5. */ tr("Electric Piano 1"),
/* 6. */ "Electric Piano 2", /* 6. */ tr("Electric Piano 2"),
/* 7. */ "Harpsichord", /* 7. */ tr("Harpsichord"),
/* 8. */ "Clavi", /* 8. */ tr("Clavi"),
/* 9. */ "Celesta", /* 9. */ tr("Celesta"),
/* 10. */ "Glockenspiel", /* 10. */ tr("Glockenspiel"),
/* 11. */ "Music Box", /* 11. */ tr("Music Box"),
/* 12. */ "Vibraphone", /* 12. */ tr("Vibraphone"),
/* 13. */ "Marimba", /* 13. */ tr("Marimba"),
/* 14. */ "Xylophone", /* 14. */ tr("Xylophone"),
/* 15. */ "Tubular Bells", /* 15. */ tr("Tubular Bells"),
/* 16. */ "Dulcimer", /* 16. */ tr("Dulcimer"),
/* 17. */ "Drawbar Organ", /* 17. */ tr("Drawbar Organ"),
/* 18. */ "Percussive Organ", /* 18. */ tr("Percussive Organ"),
/* 19. */ "Rock Organ", /* 19. */ tr("Rock Organ"),
/* 20. */ "Church Organ", /* 20. */ tr("Church Organ"),
/* 21. */ "Reed Organ", /* 21. */ tr("Reed Organ"),
/* 22. */ "Accordion", /* 22. */ tr("Accordion"),
/* 23. */ "Harmonica", /* 23. */ tr("Harmonica"),
/* 24. */ "Tango Accordion", /* 24. */ tr("Tango Accordion"),
/* 25. */ "Acoustic Guitar (nylon)", /* 25. */ tr("Acoustic Guitar (nylon)"),
/* 26. */ "Acoustic Guitar (steel)", /* 26. */ tr("Acoustic Guitar (steel)"),
/* 27. */ "Electric Guitar (jazz)", /* 27. */ tr("Electric Guitar (jazz)"),
/* 28. */ "Electric Guitar (clean)", /* 28. */ tr("Electric Guitar (clean)"),
/* 29. */ "Electric Guitar (muted)", /* 29. */ tr("Electric Guitar (muted)"),
/* 30. */ "Overdriven Guitar", /* 30. */ tr("Overdriven Guitar"),
/* 31. */ "Distortion Guitar", /* 31. */ tr("Distortion Guitar"),
/* 32. */ "Guitar harmonics", /* 32. */ tr("Guitar harmonics"),
/* 33. */ "Acoustic Bass", /* 33. */ tr("Acoustic Bass"),
/* 34. */ "Electric Bass (finger)", /* 34. */ tr("Electric Bass (finger)"),
/* 35. */ "Electric Bass (pick)", /* 35. */ tr("Electric Bass (pick)"),
/* 36. */ "Fretless Bass", /* 36. */ tr("Fretless Bass"),
/* 37. */ "Slap Bass 1", /* 37. */ tr("Slap Bass 1"),
/* 38. */ "Slap Bass 2", /* 38. */ tr("Slap Bass 2"),
/* 39. */ "Synth Bass 1", /* 39. */ tr("Synth Bass 1"),
/* 40. */ "Synth Bass 2", /* 40. */ tr("Synth Bass 2"),
/* 41. */ "Violin", /* 41. */ tr("Violin"),
/* 42. */ "Viola", /* 42. */ tr("Viola"),
/* 43. */ "Cello", /* 43. */ tr("Cello"),
/* 44. */ "Contrabass", /* 44. */ tr("Contrabass"),
/* 45. */ "Tremolo Strings", /* 45. */ tr("Tremolo Strings"),
/* 46. */ "Pizzicato Strings", /* 46. */ tr("Pizzicato Strings"),
/* 47. */ "Orchestral Harp", /* 47. */ tr("Orchestral Harp"),
/* 48. */ "Timpani", /* 48. */ tr("Timpani"),
/* 49. */ "String Ensemble 1", /* 49. */ tr("String Ensemble 1"),
/* 50. */ "String Ensemble 2", /* 50. */ tr("String Ensemble 2"),
/* 51. */ "SynthStrings 1", /* 51. */ tr("SynthStrings 1"),
/* 52. */ "SynthStrings 2", /* 52. */ tr("SynthStrings 2"),
/* 53. */ "Choir Aahs", /* 53. */ tr("Choir Aahs"),
/* 54. */ "Voice Oohs", /* 54. */ tr("Voice Oohs"),
/* 55. */ "Synth Voice", /* 55. */ tr("Synth Voice"),
/* 56. */ "Orchestra Hit", /* 56. */ tr("Orchestra Hit"),
/* 57. */ "Trumpet", /* 57. */ tr("Trumpet"),
/* 58. */ "Trombone", /* 58. */ tr("Trombone"),
/* 59. */ "Tuba", /* 59. */ tr("Tuba"),
/* 60. */ "Muted Trumpet", /* 60. */ tr("Muted Trumpet"),
/* 61. */ "French Horn", /* 61. */ tr("French Horn"),
/* 62. */ "Brass Section", /* 62. */ tr("Brass Section"),
/* 63. */ "SynthBrass 1", /* 63. */ tr("SynthBrass 1"),
/* 64. */ "SynthBrass 2", /* 64. */ tr("SynthBrass 2"),
/* 65. */ "Soprano Sax", /* 65. */ tr("Soprano Sax"),
/* 66. */ "Alto Sax", /* 66. */ tr("Alto Sax"),
/* 67. */ "Tenor Sax", /* 67. */ tr("Tenor Sax"),
/* 68. */ "Baritone Sax", /* 68. */ tr("Baritone Sax"),
/* 69. */ "Oboe", /* 69. */ tr("Oboe"),
/* 70. */ "English Horn", /* 70. */ tr("English Horn"),
/* 71. */ "Bassoon", /* 71. */ tr("Bassoon"),
/* 72. */ "Clarinet", /* 72. */ tr("Clarinet"),
/* 73. */ "Piccolo", /* 73. */ tr("Piccolo"),
/* 74. */ "Flute", /* 74. */ tr("Flute"),
/* 75. */ "Recorder", /* 75. */ tr("Recorder"),
/* 76. */ "Pan Flute", /* 76. */ tr("Pan Flute"),
/* 77. */ "Blown Bottle", /* 77. */ tr("Blown Bottle"),
/* 78. */ "Shakuhachi", /* 78. */ tr("Shakuhachi"),
/* 79. */ "Whistle", /* 79. */ tr("Whistle"),
/* 80. */ "Ocarina", /* 80. */ tr("Ocarina"),
/* 81. */ "Lead 1 (square)", /* 81. */ tr("Lead 1 (square)"),
/* 82. */ "Lead 2 (sawtooth)", /* 82. */ tr("Lead 2 (sawtooth)"),
/* 83. */ "Lead 3 (calliope)", /* 83. */ tr("Lead 3 (calliope)"),
/* 84. */ "Lead 4 (chiff)", /* 84. */ tr("Lead 4 (chiff)"),
/* 85. */ "Lead 5 (charang)", /* 85. */ tr("Lead 5 (charang)"),
/* 86. */ "Lead 6 (voice)", /* 86. */ tr("Lead 6 (voice)"),
/* 87. */ "Lead 7 (fifths)", /* 87. */ tr("Lead 7 (fifths)"),
/* 88. */ "Lead 8 (bass + lead)", /* 88. */ tr("Lead 8 (bass + lead)"),
/* 89. */ "Pad 1 (new age)", /* 89. */ tr("Pad 1 (new age)"),
/* 90. */ "Pad 2 (warm)", /* 90. */ tr("Pad 2 (warm)"),
/* 91. */ "Pad 3 (polysynth)", /* 91. */ tr("Pad 3 (polysynth)"),
/* 92. */ "Pad 4 (choir)", /* 92. */ tr("Pad 4 (choir)"),
/* 93. */ "Pad 5 (bowed)", /* 93. */ tr("Pad 5 (bowed)"),
/* 94. */ "Pad 6 (metallic)", /* 94. */ tr("Pad 6 (metallic)"),
/* 95. */ "Pad 7 (halo)", /* 95. */ tr("Pad 7 (halo)"),
/* 96. */ "Pad 8 (sweep)", /* 96. */ tr("Pad 8 (sweep)"),
/* 97. */ "FX 1 (rain)", /* 97. */ tr("FX 1 (rain)"),
/* 98. */ "FX 2 (soundtrack)", /* 98. */ tr("FX 2 (soundtrack)"),
/* 99. */ "FX 3 (crystal)", /* 99. */ tr("FX 3 (crystal)"),
/* 100. */ "FX 4 (atmosphere)", /* 100. */ tr("FX 4 (atmosphere)"),
/* 101. */ "FX 5 (brightness)", /* 101. */ tr("FX 5 (brightness)"),
/* 102. */ "FX 6 (goblins)", /* 102. */ tr("FX 6 (goblins)"),
/* 103. */ "FX 7 (echoes)", /* 103. */ tr("FX 7 (echoes)"),
/* 104. */ "FX 8 (sci-fi)", /* 104. */ tr("FX 8 (sci-fi)"),
/* 105. */ "Sitar", /* 105. */ tr("Sitar"),
/* 106. */ "Banjo", /* 106. */ tr("Banjo"),
/* 107. */ "Shamisen", /* 107. */ tr("Shamisen"),
/* 108. */ "Koto", /* 108. */ tr("Koto"),
/* 109. */ "Kalimba", /* 109. */ tr("Kalimba"),
/* 110. */ "Bag pipe", /* 110. */ tr("Bag pipe"),
/* 111. */ "Fiddle", /* 111. */ tr("Fiddle"),
/* 112. */ "Shanai", /* 112. */ tr("Shanai"),
/* 113. */ "Tinkle Bell", /* 113. */ tr("Tinkle Bell"),
/* 114. */ "Agogo", /* 114. */ tr("Agogo"),
/* 115. */ "Steel Drums", /* 115. */ tr("Steel Drums"),
/* 116. */ "Woodblock", /* 116. */ tr("Woodblock"),
/* 117. */ "Taiko Drum", /* 117. */ tr("Taiko Drum"),
/* 118. */ "Melodic Tom", /* 118. */ tr("Melodic Tom"),
/* 119. */ "Synth Drum", /* 119. */ tr("Synth Drum"),
/* 120. */ "Reverse Cymbal", /* 120. */ tr("Reverse Cymbal"),
/* 121. */ "Guitar Fret Noise", /* 121. */ tr("Guitar Fret Noise"),
/* 122. */ "Breath Noise", /* 122. */ tr("Breath Noise"),
/* 123. */ "Seashore", /* 123. */ tr("Seashore"),
/* 124. */ "Bird Tweet", /* 124. */ tr("Bird Tweet"),
/* 125. */ "Telephone Ring", /* 125. */ tr("Telephone Ring"),
/* 126. */ "Helicopter", /* 126. */ tr("Helicopter"),
/* 127. */ "Applause", /* 127. */ tr("Applause"),
/* 128. */ "Gunshot", /* 128. */ tr("Gunshot"),
}; };
if (program >= 0 && program < static_cast<int>(arraySize(gmInstrumentNames))) if (program >= 0 && program < static_cast<int>(arraySize(gmInstrumentNames)))

View File

@ -1,9 +1,9 @@
#CONFIG += USE_FLUIDSYNTH #CONFIG += USE_FLUIDSYNTH
CONFIG += release CONFIG += release
TRANSLATIONS = translations/pianobooster_jp_JP.ts \ TRANSLATIONS = ../translations/pianobooster_ja_JP.ts \
translations/pianobooster_cn_CN.ts \ ../translations/pianobooster_cn_CN.ts \
translations/pianobooster_es_ES.ts \ ../translations/pianobooster_es_ES.ts \
USE_FLUIDSYNTH { USE_FLUIDSYNTH {