From 9d516b7e1f3250a50c28c5896c324241de49627a Mon Sep 17 00:00:00 2001 From: Jaye Evins Date: Mon, 10 Nov 2025 17:46:07 -0500 Subject: [PATCH] Minor string cleanup (#248) - Simplified some strings to not include unnecessary markup. - Fix translator comments so that they actually make it to glabels_C.ts file - Reconciled the style of these comments. - Added translator comments --- glabels/ColorPaletteDialog.cpp | 2 +- glabels/MainWindow.cpp | 6 ++- glabels/TemplateDesigner.cpp | 2 + glabels/ui/PrintView.ui | 17 ++++--- glabels/ui/PropertiesView.ui | 11 +++-- glabels/ui/TemplateDesignerContinuousPage.ui | 2 +- glabels/ui/TemplateDesignerIntroPage.ui | 5 ++- glabels/ui/TemplateDesignerPathPage.ui | 2 +- glabels/ui/VariablesView.ui | 6 +-- model/Frame.cpp | 12 ++--- .../raw/crew-orientation-name-tags-7.glabels | 28 ++++++------ translations/glabels_C.ts | 45 ++++++++++--------- 12 files changed, 78 insertions(+), 60 deletions(-) diff --git a/glabels/ColorPaletteDialog.cpp b/glabels/ColorPaletteDialog.cpp index eabf386..ab414c8 100644 --- a/glabels/ColorPaletteDialog.cpp +++ b/glabels/ColorPaletteDialog.cpp @@ -265,7 +265,7 @@ namespace glabels mColorNode = newColorNode; // TRANSLATORS - //: %1 = color specification in hex. String must not contain a colon (:). + //: %1 = color specification in hex. String must not contain a colon (:). mColorHistory->addColor( mColorNode.color(), QString(tr("Custom Color %1")).arg(mColorNode.color().name()) ); diff --git a/glabels/MainWindow.cpp b/glabels/MainWindow.cpp index e40e4ab..1c4ea4c 100644 --- a/glabels/MainWindow.cpp +++ b/glabels/MainWindow.cpp @@ -921,7 +921,8 @@ namespace glabels if ( mUndoRedoModel->canUndo() ) { editUndoAction->setEnabled( true ); - /* Translators: %1 is the action description to undo. */ + // TRANSLATORS + //: %1 is the action name/description (e.g. move, delete, ...) to undo. editUndoAction->setText( QString( tr("Undo %1") ).arg( mUndoRedoModel->undoDescription() ) ); } else @@ -932,7 +933,8 @@ namespace glabels if ( mUndoRedoModel->canRedo() ) { editRedoAction->setEnabled( true ); - /* Translators: %1 is the action description to redo. */ + // TRANSLATORS + //: %1 is the action name/description (e.g. move, delete, ...) to redo. editRedoAction->setText( QString( tr("Redo %1") ).arg( mUndoRedoModel->redoDescription() ) ); } else diff --git a/glabels/TemplateDesigner.cpp b/glabels/TemplateDesigner.cpp index 7944445..858fbeb 100644 --- a/glabels/TemplateDesigner.cpp +++ b/glabels/TemplateDesigner.cpp @@ -1580,6 +1580,8 @@ namespace glabels QMessageBox msgBox( wizard() ); msgBox.setWindowTitle( tr("Save Product Template") ); msgBox.setIcon( QMessageBox::Warning ); + // TRANSLATORS + //: %1 = brand name of product (e.g. Avery), %2 = part number of product (e.g. 5026). msgBox.setText( tr("User product template (%1 %2) already exists.").arg(brand).arg(part) ); msgBox.setInformativeText( tr("Do you want to replace it?") ); msgBox.setStandardButtons( QMessageBox::Yes | QMessageBox::No ); diff --git a/glabels/ui/PrintView.ui b/glabels/ui/PrintView.ui index cdeef1a..b5d18fd 100644 --- a/glabels/ui/PrintView.ui +++ b/glabels/ui/PrintView.ui @@ -263,7 +263,8 @@ Uncollated (e.g. 1,1,1 2,2,2 3,3,3) - + + .. @@ -271,7 +272,8 @@ Collated (e.g. 1,2,3 1,2,3 1,2,3) - + + .. @@ -292,7 +294,8 @@ Merge groups are contiguous - + + .. @@ -300,7 +303,8 @@ Merge groups start on a new page - + + .. @@ -448,7 +452,8 @@ Print... - + + .. @@ -491,7 +496,7 @@ - <html><head/><body><p>(Will print a total of xxxx items on nnn pages.)</p></body></html> + (Will print a total of xxxx items on nnn pages.) Qt::AlignCenter diff --git a/glabels/ui/PropertiesView.ui b/glabels/ui/PropertiesView.ui index dad9cb0..94b62dd 100644 --- a/glabels/ui/PropertiesView.ui +++ b/glabels/ui/PropertiesView.ui @@ -248,7 +248,7 @@ - <html><head/><body><p>Select another product for this gLabels project.</p></body></html> + Select another product for this gLabels project. text-align:left; padding:3px; @@ -257,7 +257,8 @@ Change product - + + .. @@ -351,7 +352,8 @@ Horizontal orientation - + + .. @@ -359,7 +361,8 @@ Vertical orientation - + + .. diff --git a/glabels/ui/TemplateDesignerContinuousPage.ui b/glabels/ui/TemplateDesignerContinuousPage.ui index d3cc112..49679f1 100644 --- a/glabels/ui/TemplateDesignerContinuousPage.ui +++ b/glabels/ui/TemplateDesignerContinuousPage.ui @@ -32,7 +32,7 @@ - <html><head/><body><p>Click &quot;Cancel&quot; to quit, or click &quot;Back&quot; to begin with a different product.</p></body></html> + Click "Cancel" to quit, or click "Back" to begin with a different product. true diff --git a/glabels/ui/TemplateDesignerIntroPage.ui b/glabels/ui/TemplateDesignerIntroPage.ui index 9b397cb..9f74cb4 100644 --- a/glabels/ui/TemplateDesignerIntroPage.ui +++ b/glabels/ui/TemplateDesignerIntroPage.ui @@ -32,7 +32,10 @@ - <html><head/><body><p>This dialog will help you create a custom product template. Let's get started:</p></body></html> + This dialog will help you create a custom product template. Let's get started: + + + true diff --git a/glabels/ui/TemplateDesignerPathPage.ui b/glabels/ui/TemplateDesignerPathPage.ui index 3b59a4c..e9d273d 100644 --- a/glabels/ui/TemplateDesignerPathPage.ui +++ b/glabels/ui/TemplateDesignerPathPage.ui @@ -32,7 +32,7 @@ - <html><head/><body><p>Click &quot;Cancel&quot; to quit, or click &quot;Back&quot; to begin with a different product.</p></body></html> + Click "Cancel" to quit, or click "Back" to begin with a different product. true diff --git a/glabels/ui/VariablesView.ui b/glabels/ui/VariablesView.ui index c0953d6..5c37df5 100644 --- a/glabels/ui/VariablesView.ui +++ b/glabels/ui/VariablesView.ui @@ -66,7 +66,7 @@ - <html><head/><body><p>Add variable</p></body></html> + Add variable Add @@ -76,7 +76,7 @@ - <html><head/><body><p>Edit selected variable</p></body></html> + Edit selected variable Edit @@ -86,7 +86,7 @@ - <html><head/><body><p>Delete selected variable</p></body></html> + Delete selected variable Delete diff --git a/model/Frame.cpp b/model/Frame.cpp index 8b9111a..e910422 100644 --- a/model/Frame.cpp +++ b/model/Frame.cpp @@ -120,17 +120,17 @@ namespace glabels // Update layout description if ( mLayouts.size() == 1 ) { - /* - * Translators: %1 = number of labels across a page, - * %2 = number of labels down a page, - * %3 = total number of labels on a page (sheet). - */ + // TRANSLATORS + //: %1 = number of labels across a page, + //: %2 = number of labels down a page, + //: %3 = total number of labels on a page (sheet). mLayoutDescription = QString( tr("%1 x %2 (%3 per sheet)") ) .arg(layout.nx()).arg(layout.ny()).arg(mNLabels); } else { - /* Translators: %1 is the total number of labels on a page (sheet). */ + // TRANSLATORS + //: %1 is the total number of labels on a page (sheet). mLayoutDescription = QString( tr("%1 per sheet") ).arg(mNLabels); } } diff --git a/test-data/glabels-3/raw/crew-orientation-name-tags-7.glabels b/test-data/glabels-3/raw/crew-orientation-name-tags-7.glabels index 3932ff9..040c901 100644 --- a/test-data/glabels-3/raw/crew-orientation-name-tags-7.glabels +++ b/test-data/glabels-3/raw/crew-orientation-name-tags-7.glabels @@ -1,24 +1,22 @@ - -