Skip to content

Commit 1a85ae4

Browse files
committed
Fix l10n support
1 parent c75dcea commit 1a85ae4

File tree

6 files changed

+36
-36
lines changed

6 files changed

+36
-36
lines changed

plugins/SkyCultureMaker/src/ScmDraw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void scm::ScmDraw::setSearchMode(bool active)
4949
}
5050
else
5151
{
52-
qDebug() << "SkyCultureMaker: Failed to release ctrl key";
52+
qDebug() << "SkyCultureMaker: Failed to release Ctrl key";
5353
}
5454
}
5555

plugins/SkyCultureMaker/src/SkyCultureMaker.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ StelPluginInfo SkyCultureMakerStelPluginInterface::getPluginInfo() const
6161

6262
StelPluginInfo info;
6363
info.id = "SkyCultureMaker";
64-
info.displayedName = "Sky Culture Maker";
64+
info.displayedName = N_("Sky Culture Maker");
6565
info.authors = "Vincent Gerlach (RivinHD), Luca-Philipp Grumbach (xLPMG), Fabian Hofer (Integer-Ctrl), Richard "
6666
"Hofmann (ZeyxRew), Mher Mnatsakanyan (MherMnatsakanyan03)";
67-
info.contact = "Contact us using our GitHub usernames, via an Issue or the Discussion tab in the Stellarium "
68-
"repository.";
69-
info.description = "Plugin to draw and export sky cultures in Stellarium.";
67+
info.contact = N_("Contact us using our GitHub usernames, via an Issue or the Discussion tab in the Stellarium "
68+
"repository.");
69+
info.description = N_("Plugin to draw and export sky cultures in Stellarium.");
7070
info.version = SKYCULTUREMAKER_PLUGIN_VERSION;
7171
info.license = SKYCULTUREMAKER_PLUGIN_LICENSE;
7272
return info;

plugins/SkyCultureMaker/src/gui/ScmConstellationDialog.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -241,22 +241,22 @@ void ScmConstellationDialog::triggerUndo()
241241

242242
void ScmConstellationDialog::triggerUploadImage()
243243
{
244-
QString filePath = QFileDialog::getOpenFileName(ui->artworkTab, "Open Artwork", lastUsedImageDirectory,
245-
"Images (*.png *.jpg *.jpeg)");
244+
QString filePath = QFileDialog::getOpenFileName(ui->artworkTab, q_("Open Artwork"), lastUsedImageDirectory,
245+
q_("Images (*.png *.jpg *.jpeg)"));
246246
QFileInfo fileInfo(filePath);
247247
lastUsedImageDirectory = fileInfo.absolutePath();
248248

249249
if (!fileInfo.isFile())
250250
{
251-
ui->infoLbl->setText("Choosen path is not a valid file:\n" + filePath);
251+
ui->infoLbl->setText(q_("Choosen path is not a valid file:\n") + filePath);
252252
return;
253253
}
254254

255255
if (!(fileInfo.suffix().compare("PNG", Qt::CaseInsensitive) == 0 ||
256256
fileInfo.suffix().compare("JPG", Qt::CaseInsensitive) == 0 ||
257257
fileInfo.suffix().compare("JPEG", Qt::CaseInsensitive) == 0))
258258
{
259-
ui->infoLbl->setText("Chosen file is not a PNG, JPG or JPEG image:\n" + filePath);
259+
ui->infoLbl->setText(q_("Chosen file is not a PNG, JPG or JPEG image:\n") + filePath);
260260
return;
261261
}
262262

@@ -285,7 +285,7 @@ void ScmConstellationDialog::bindSelectedStar()
285285
{
286286
if (!imageItem->hasAnchorSelection())
287287
{
288-
ui->infoLbl->setText("WARNING: Select an anchor to bind to.");
288+
ui->infoLbl->setText(q_("WARNING: Select an anchor to bind to."));
289289
qDebug() << "SkyCultureMaker: No anchor was selected.";
290290
return;
291291
}
@@ -295,7 +295,7 @@ void ScmConstellationDialog::bindSelectedStar()
295295

296296
if (!objectMgr.getWasSelected())
297297
{
298-
ui->infoLbl->setText("WARNING: Select a star to bind to the current selected anchor.");
298+
ui->infoLbl->setText(q_("WARNING: Select a star to bind to the current selected anchor."));
299299
qDebug() << "SkyCultureMaker: No star was selected to bind to.";
300300
return;
301301
}
@@ -304,23 +304,23 @@ void ScmConstellationDialog::bindSelectedStar()
304304
assert(stelObj != nullptr); // Checked through getWasSelected
305305
if (stelObj->getType().compare("star", Qt::CaseInsensitive) != 0)
306306
{
307-
ui->infoLbl->setText("WARNING: The selected object must be of type star.");
307+
ui->infoLbl->setText(q_("WARNING: The selected object must be of type star."));
308308
qDebug() << "SkyCultureMaker: The selected object is not of type start, got " << stelObj->getType();
309309
return;
310310
}
311311

312312
ScmConstellationImageAnchor *anchor = imageItem->getSelectedAnchor();
313313
if (anchor == nullptr)
314314
{
315-
ui->infoLbl->setText("WARNING: No anchor is selected.");
315+
ui->infoLbl->setText(q_("WARNING: No anchor is selected."));
316316
qDebug() << "SkyCultureMaker: No anchor is selected";
317317
return;
318318
}
319319

320320
bool success = anchor->trySetStarHip(stelObj->getID());
321321
if (success == false)
322322
{
323-
ui->infoLbl->setText("WARNING: The selected object must contain a HIP number.");
323+
ui->infoLbl->setText(q_("WARNING: The selected object must contain a HIP number."));
324324
qDebug() << "SkyCultureMaker: The object does not contain a HIP, id = " << stelObj->getID();
325325
return;
326326
}
@@ -344,14 +344,14 @@ bool ScmConstellationDialog::canConstellationBeSaved() const
344344
scm::ScmSkyCulture *currentSkyCulture = maker->getCurrentSkyCulture();
345345
if (currentSkyCulture == nullptr)
346346
{
347-
ui->infoLbl->setText("WARNING: Could not save: Sky Culture is not set");
347+
ui->infoLbl->setText(q_("WARNING: Could not save: Sky Culture is not set"));
348348
qDebug() << "SkyCultureMaker: Could not save: Sky Culture is not set";
349349
return false;
350350
}
351351

352352
if (constellationEnglishName.isEmpty())
353353
{
354-
ui->infoLbl->setText("WARNING: Could not save: English name is empty");
354+
ui->infoLbl->setText(q_("WARNING: Could not save: English name is empty"));
355355
qDebug() << "SkyCultureMaker: Could not save: English name is empty";
356356
return false;
357357
}
@@ -360,15 +360,15 @@ bool ScmConstellationDialog::canConstellationBeSaved() const
360360
QString finalId = constellationId.isEmpty() ? constellationPlaceholderId : constellationId;
361361
if (finalId.isEmpty())
362362
{
363-
ui->infoLbl->setText("WARNING: Could not save: Constellation ID is empty");
363+
ui->infoLbl->setText(q_("WARNING: Could not save: Constellation ID is empty"));
364364
qDebug() << "SkyCultureMaker: Could not save: Constellation ID is empty";
365365
return false;
366366
}
367367

368368
// Not editing a constellation, but the ID already exists
369369
if (constellationBeingEdited == nullptr && currentSkyCulture->getConstellation(finalId) != nullptr)
370370
{
371-
ui->infoLbl->setText("WARNING: Could not save: Constellation with this ID already exists");
371+
ui->infoLbl->setText(q_("WARNING: Could not save: Constellation with this ID already exists"));
372372
qDebug() << "SkyCultureMaker: Could not save: Constellation with this ID already exists, id = "
373373
<< finalId;
374374
return false;
@@ -377,7 +377,7 @@ bool ScmConstellationDialog::canConstellationBeSaved() const
377377
else if (constellationBeingEdited != nullptr && constellationBeingEdited->getId() != finalId &&
378378
currentSkyCulture->getConstellation(finalId) != nullptr)
379379
{
380-
ui->infoLbl->setText("WARNING: Could not save: Constellation with this ID already exists");
380+
ui->infoLbl->setText(q_("WARNING: Could not save: Constellation with this ID already exists"));
381381
qDebug() << "SkyCultureMaker: Could not save: Constellation with this ID already exists, id = "
382382
<< finalId;
383383
return false;
@@ -387,7 +387,7 @@ bool ScmConstellationDialog::canConstellationBeSaved() const
387387
auto drawnConstellation = maker->getScmDraw()->getCoordinates();
388388
if (drawnConstellation.empty())
389389
{
390-
ui->infoLbl->setText("WARNING: Could not save: The constellation does not contain any drawings");
390+
ui->infoLbl->setText(q_("WARNING: Could not save: The constellation does not contain any drawings"));
391391
qDebug() << "SkyCultureMaker: Could not save: The constellation does not contain any drawings";
392392
return false;
393393
}
@@ -397,8 +397,8 @@ bool ScmConstellationDialog::canConstellationBeSaved() const
397397
{
398398
if (!imageItem->isImageAnchored())
399399
{
400-
ui->infoLbl->setText("WARNING: Could not save: An artwork is attached, but not all "
401-
"anchors have a star bound.");
400+
ui->infoLbl->setText(q_("WARNING: Could not save: An artwork is attached, but not all "
401+
"anchors have a star bound."));
402402
qDebug() << "SkyCultureMaker: Could not save: An artwork is attached, but not all "
403403
"anchors have a star bound.";
404404
return false;

plugins/SkyCultureMaker/src/gui/ScmSkyCultureDialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ void ScmSkyCultureDialog::saveSkyCulture()
174174
// check if license is set
175175
if (desc.license == scm::LicenseType::NONE)
176176
{
177-
ui->infoLbl->setText("WARNING: Please select a license for the sky culture.");
177+
ui->infoLbl->setText(q_("WARNING: Please select a license for the sky culture."));
178178
return;
179179
}
180180
// check if description is complete
181181
if (!desc.isComplete())
182182
{
183-
ui->infoLbl->setText("WARNING: The sky culture description is not complete.");
183+
ui->infoLbl->setText(q_("WARNING: The sky culture description is not complete."));
184184
return;
185185
}
186186

plugins/SkyCultureMaker/src/gui/ScmSkyCultureExportDialog.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void ScmSkyCultureExportDialog::saveSkyCulture()
9696
if (currentSkyCulture == nullptr)
9797
{
9898
qWarning() << "SkyCultureMaker: current sky culture is nullptr. Cannot export.";
99-
maker->setSkyCultureDialogInfoLabel("ERROR: No sky culture is set.");
99+
maker->setSkyCultureDialogInfoLabel(q_("ERROR: No sky culture is set."));
100100
ScmSkyCultureExportDialog::close();
101101
return;
102102
}
@@ -110,15 +110,15 @@ void ScmSkyCultureExportDialog::saveSkyCulture()
110110
{
111111
qWarning() << "SkyCultureMaker: Could not export sky culture. User cancelled or failed to choose "
112112
"directory.";
113-
maker->setSkyCultureDialogInfoLabel("ERROR: Failed to choose export directory.");
113+
maker->setSkyCultureDialogInfoLabel(q_("ERROR: Failed to choose export directory."));
114114
return; // User cancelled or failed to choose directory
115115
}
116116

117117
if (skyCultureDirectory.exists())
118118
{
119119
qWarning() << "SkyCultureMaker: Sky culture with ID" << skyCultureId
120120
<< "already exists. Cannot export.";
121-
maker->setSkyCultureDialogInfoLabel("ERROR: Sky culture with this ID already exists.");
121+
maker->setSkyCultureDialogInfoLabel(q_("ERROR: Sky culture with this ID already exists."));
122122
// dont close the dialog here, so the user can delete the folder first
123123
return;
124124
}
@@ -127,7 +127,7 @@ void ScmSkyCultureExportDialog::saveSkyCulture()
127127
bool createdDirectorySuccessfully = skyCultureDirectory.mkpath(".");
128128
if (!createdDirectorySuccessfully)
129129
{
130-
maker->setSkyCultureDialogInfoLabel("ERROR: Failed to create sky culture directory.");
130+
maker->setSkyCultureDialogInfoLabel(q_("ERROR: Failed to create sky culture directory."));
131131
qWarning() << "SkyCultureMaker: Failed to create sky culture directory at"
132132
<< skyCultureDirectory.absolutePath();
133133
return;
@@ -138,7 +138,7 @@ void ScmSkyCultureExportDialog::saveSkyCulture()
138138
QDir::separator() + "illustrations");
139139
if (!savedIllustrationsSuccessfully)
140140
{
141-
maker->setSkyCultureDialogInfoLabel("WARNING: Failed to save the illustrations.");
141+
maker->setSkyCultureDialogInfoLabel(q_("WARNING: Failed to save the illustrations."));
142142
qWarning() << "SkyCultureMaker: Failed to export sky culture illustrations.";
143143
// delete the created directory
144144
skyCultureDirectory.removeRecursively();
@@ -153,7 +153,7 @@ void ScmSkyCultureExportDialog::saveSkyCulture()
153153
if (scJsonDoc.isNull() || scJsonDoc.isEmpty())
154154
{
155155
qWarning() << "SkyCultureMaker: Failed to create JSON document for sky culture.";
156-
maker->setSkyCultureDialogInfoLabel("ERROR: Failed to create JSON document for sky culture.");
156+
maker->setSkyCultureDialogInfoLabel(q_("ERROR: Failed to create JSON document for sky culture."));
157157
skyCultureDirectory.removeRecursively();
158158
ScmSkyCultureExportDialog::close();
159159
return;
@@ -162,7 +162,7 @@ void ScmSkyCultureExportDialog::saveSkyCulture()
162162
if (!scJsonFile.open(QIODevice::WriteOnly | QIODevice::Text))
163163
{
164164
qWarning() << "SkyCultureMaker: Failed to open index.json for writing.";
165-
maker->setSkyCultureDialogInfoLabel("ERROR: Failed to open index.json for writing.");
165+
maker->setSkyCultureDialogInfoLabel(q_("ERROR: Failed to open index.json for writing."));
166166
skyCultureDirectory.removeRecursively();
167167
ScmSkyCultureExportDialog::close();
168168
return;
@@ -174,7 +174,7 @@ void ScmSkyCultureExportDialog::saveSkyCulture()
174174
bool savedDescriptionSuccessfully = maker->saveSkyCultureDescription(skyCultureDirectory);
175175
if (!savedDescriptionSuccessfully)
176176
{
177-
maker->setSkyCultureDialogInfoLabel("WARNING: Failed to export sky culture description.");
177+
maker->setSkyCultureDialogInfoLabel(q_("WARNING: Failed to export sky culture description."));
178178
qWarning() << "SkyCultureMaker: Failed to export sky culture description.";
179179
skyCultureDirectory.removeRecursively();
180180
ScmSkyCultureExportDialog::close();
@@ -185,14 +185,14 @@ void ScmSkyCultureExportDialog::saveSkyCulture()
185185
bool savedCMakeListsSuccessfully = saveSkyCultureCMakeListsFile(skyCultureDirectory);
186186
if (!savedCMakeListsSuccessfully)
187187
{
188-
maker->setSkyCultureDialogInfoLabel("WARNING: Failed to export CMakeLists.txt.");
188+
maker->setSkyCultureDialogInfoLabel(q_("WARNING: Failed to export CMakeLists.txt."));
189189
qWarning() << "SkyCultureMaker: Failed to export CMakeLists.txt.";
190190
skyCultureDirectory.removeRecursively();
191191
ScmSkyCultureExportDialog::close();
192192
return;
193193
}
194194

195-
maker->setSkyCultureDialogInfoLabel("Sky culture exported successfully to " +
195+
maker->setSkyCultureDialogInfoLabel(q_("Sky culture exported successfully to ") +
196196
skyCultureDirectory.absolutePath());
197197
qInfo() << "SkyCultureMaker: Sky culture exported successfully to" << skyCultureDirectory.absolutePath();
198198
ScmSkyCultureExportDialog::close();
@@ -210,7 +210,7 @@ bool ScmSkyCultureExportDialog::chooseExportDirectory(const QString& skyCultureI
210210

211211
if (!QDir(selectedDirectory).exists())
212212
{
213-
maker->setSkyCultureDialogInfoLabel("ERROR: The selected directory is not valid");
213+
maker->setSkyCultureDialogInfoLabel(q_("ERROR: The selected directory is not valid"));
214214
qDebug() << "SkyCultureMaker: Selected non-existing export directory";
215215
return false;
216216
}

plugins/SkyCultureMaker/src/gui/ScmStartDialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void ScmStartDialog::createDialogContent()
101101
#else // SCM_CONVERTER_ENABLED_CPP is not defined
102102
// Converter is disabled, so disable the button
103103
ui->scmStartConvertpushButton->setEnabled(false);
104-
ui->scmStartConvertpushButton->setToolTip(tr("The Sky Culture Converter has been turned off for this build."));
104+
ui->scmStartConvertpushButton->setToolTip(q_("The Sky Culture Converter has been turned off for this build."));
105105
#endif // SCM_CONVERTER_ENABLED_CPP
106106
/* ================================================================================================================== */
107107
}

0 commit comments

Comments
 (0)