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

fix some translatable strings #6077

Merged
merged 1 commit into from
May 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mscore/metaedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void MetaEditDialog::setDirty(const bool dirty)
return;

saveButton->setEnabled(dirty);
setWindowTitle(tr("Score properties: ") + m_score->title() + (dirty ? "*" : ""));
setWindowTitle(tr("Score properties: %1%2").arg(m_score->title()).arg((dirty ? "*" : "")));

m_dirty = dirty;
}
Expand Down Expand Up @@ -223,8 +223,8 @@ bool MetaEditDialog::save()
if (map.contains(tagText)) {
if (isBuiltinTag(tagText)) {
QMessageBox::warning(this, tr("MuseScore"),
tagText + tr(" is a reserved builtin tag.\n"
"It can't be used."),
tr("%1 is a reserved builtin tag.\n"
"It can't be used.").arg(tagText),
QMessageBox::Ok, QMessageBox::Ok);
tag->setFocus();
return false;
Expand Down
50 changes: 24 additions & 26 deletions mscore/musescore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4105,33 +4105,31 @@ bool MuseScore::readLanguages(const QString& path)
//: The default language of the operating system. NOT a music system.
_languages.append(LanguageItem("system", tr("System")));
QFile qf(path);
if (qf.exists()){
QDomDocument doc;
int line, column;
QString err;
if (!doc.setContent(&qf, false, &err, &line, &column)) {
QString error;
error.sprintf(qPrintable(tr("Error reading language file %s at line %d column %d: %s\n")),
qPrintable(qf.fileName()), line, column, qPrintable(err));
QMessageBox::warning(0,
QWidget::tr("Load Languages Failed:"),
error,
QString(), QWidget::tr("Quit"), QString(), 0, 1);
return false;
}

for (QDomElement e = doc.documentElement(); !e.isNull(); e = e.nextSiblingElement()) {
if(e.tagName() == "languages") {
for (e = e.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
if (e.tagName() == "language") {
QString code = e.attribute(QString("code"));
QString name = e.attribute(QString("name"));
QString handbook = e.attribute(QString("handbook"));
_languages.append(LanguageItem(code, name, handbook));
if (qf.exists()) {
QDomDocument doc;
int line, column;
QString err;
if (!doc.setContent(&qf, false, &err, &line, &column)) {
QMessageBox::warning(0,
QWidget::tr("Load Languages Failed:"),
tr("Error reading language file %1 at line %2 column %3: %4")
.arg(qf.fileName()).arg(line).arg(column).arg(err),
QString(), QWidget::tr("Quit"), QString(), 0, 1);
return false;
}

for (QDomElement e = doc.documentElement(); !e.isNull(); e = e.nextSiblingElement()) {
if(e.tagName() == "languages") {
for (e = e.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
if (e.tagName() == "language") {
QString code = e.attribute(QString("code"));
QString name = e.attribute(QString("name"));
QString handbook = e.attribute(QString("handbook"));
_languages.append(LanguageItem(code, name, handbook));
}
}
}
}
}
}
}
return true;
}
return false;
Expand Down
4 changes: 2 additions & 2 deletions mscore/partedit.ui
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
</size>
</property>
<property name="text" >
<string>Rev</string>
<string>Rev.</string>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
Expand Down Expand Up @@ -318,7 +318,7 @@
</size>
</property>
<property name="text" >
<string>Cho</string>
<string>Cho.</string>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
Expand Down
2 changes: 1 addition & 1 deletion mscore/pianoroll/pianoroll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ void PianorollEditor::setStaff(Staff* st)
return;

if (st)
partLabel->setText("Part: " + st->partName());
partLabel->setText(tr("Part: %1").arg(st->partName()));

if ((st && st->score() != _score) || (!st && _score)) {
if (_score) {
Expand Down
10 changes: 5 additions & 5 deletions mscore/scoreaccessibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,11 @@ std::pair<int, float> ScoreAccessibility::barbeat(Element *e)
void ScoreAccessibility::makeReadable(QString& s)
{
static std::vector<std::pair<QString, QString>> unicodeReplacements {
{ "♭", tr(" flat") },
{ "♮", tr(" natural") },
{ "♯", tr(" sharp") },
{ "𝄫", tr(" double flat") },
{ "𝄪", tr(" double sharp") },
{ "♭", " " + tr("flat") },
{ "♮", " " + tr("natural") },
{ "♯", " " + tr("sharp") },
{ "𝄫", " " + tr("double flat") },
{ "𝄪", " " + tr("double sharp") },
};

if (!QAccessible::isActive())
Expand Down