Commit b04597b1 authored by Antoni Bella Pérez's avatar Antoni Bella Pérez 🚵🏻
Browse files

l10n fixes

* Add @title:window helpers
* Capitalize menu items, titles and page names into settings dialog
parent 6d9f335c
Pipeline #85822 passed with stage
in 47 seconds
......@@ -49,7 +49,7 @@ Palapeli::ConfigDialog::ConfigDialog(QWidget* parent)
, m_triggerPage(new Palapeli::TriggerConfigWidget)
, m_shownForFirstTime(false)
{
//setup page "General settings"
//setup page "General Settings"
QWidget* generalPage = new QWidget;
m_generalUi.setupUi(generalPage);
......@@ -59,10 +59,10 @@ Palapeli::ConfigDialog::ConfigDialog(QWidget* parent)
Palapeli::TextureHelper::instance());
setupSolutionAreaComboBox();
addPage(generalPage, i18n("General settings"))->
addPage(generalPage, i18n("General Settings"))->
setIcon(QIcon::fromTheme( QStringLiteral( "configure" )));
//setup page "Mouse interaction"
addPage(m_triggerPage, i18n("Mouse interaction"))->
//setup page "Mouse Interaction"
addPage(m_triggerPage, i18n("Mouse Interaction"))->
setIcon(QIcon::fromTheme( QStringLiteral( "input-mouse" )));
connect(m_triggerPage, &TriggerConfigWidget::associationsChanged,
this, &ConfigDialog::updateButtons);
......
......@@ -17,8 +17,8 @@ Palapeli::TriggerConfigWidget::TriggerConfigWidget(QWidget* parent)
, m_mouseView(new Palapeli::TriggerListView(m_interactors, Palapeli::MouseInteractor, this))
, m_wheelView(new Palapeli::TriggerListView(m_interactors, Palapeli::WheelInteractor, this))
{
addTab(m_mouseView, i18n("Mouse buttons"));
addTab(m_wheelView, i18n("Mouse wheel"));
addTab(m_mouseView, i18n("Mouse Buttons"));
addTab(m_wheelView, i18n("Mouse Wheel"));
connect(m_mouseView, &Palapeli::TriggerListView::associationsChanged, this, &TriggerConfigWidget::associationsChanged);
connect(m_wheelView, &Palapeli::TriggerListView::associationsChanged, this, &TriggerConfigWidget::associationsChanged);
}
......
......@@ -35,7 +35,7 @@ Palapeli::PuzzleCreatorDialog::PuzzleCreatorDialog()
, m_slicerConfigMasterWidget(new QStackedWidget)
{
//setup dialog
setWindowTitle(i18nc("@title:window", "Create new puzzle"));
setWindowTitle(i18nc("@title:window", "Create New Puzzle"));
buttonBox()->button(QDialogButtonBox::Help)->setVisible(false);
//setup image selector
m_imageSelector->setMode(KFile::File | KFile::LocalOnly | KFile::ExistingOnly);
......
......@@ -311,7 +311,7 @@ void Palapeli::GamePlay::actionImport()
{
const QString filter = i18nc("Filter for a file dialog", "Palapeli puzzles (*.puzzle)");
const QStringList paths = QFileDialog::getOpenFileNames(m_mainWindow,
i18n("Import Palapeli puzzles"),
i18nc("@title:window", "Import Palapeli Puzzles"),
QString(),
filter);
Palapeli::Collection* coll = Palapeli::Collection::instance();
......@@ -337,7 +337,7 @@ void Palapeli::GamePlay::actionExport()
const QString startLoc = QString::fromLatin1("%1.puzzle").arg(cmp->metadata.name);
const QString filter = i18nc("Filter for a file dialog", "Palapeli puzzles (*.puzzle)");
const QString location = QFileDialog::getSaveFileName(m_mainWindow,
i18n("Save Palapeli puzzles"),
i18nc("@title:window", "Save Palapeli Puzzles"),
startLoc,
filter);
if (location.isEmpty())
......
......@@ -26,7 +26,7 @@ Palapeli::PuzzlePreview::PuzzlePreview(QWidget* parent)
setScene(new QGraphicsScene(this));
setParent(parent);
setWindowTitle(i18nc("Window title", "Preview of completed puzzle"));
setWindowTitle(i18nc("@title:window", "Preview of completed puzzle"));
setWindowFlags(Qt::Tool | Qt::WindowTitleHint);
setAttribute (Qt::WA_NoMousePropagation); // Accept all mouse events.
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
......@@ -61,7 +61,7 @@ void Palapeli::PuzzlePreview::loadImageFrom(const Palapeli::PuzzleMetadata& md)
{
// Metadata is assumed to have been loaded by the caller.
setImage(md.image);
setWindowTitle(i18n("%1 - Preview", md.name));
setWindowTitle(i18nc("@title:window", "%1 - Preview", md.name));
// Set hover-zoom so that 3x3 pieces would be visible on a square grid.
m_hoverZoom = sqrt(md.pieceCount)/3.0;
if (m_hoverZoom < 1)
......
......@@ -55,11 +55,11 @@ Palapeli::CollectionView::CollectionView(QWidget* parent)
searchLine->setClearButtonEnabled(true);
connect(searchLine, &QLineEdit::textChanged, this, &Palapeli::CollectionView::slotTextChanged);
//setup sort button
QPushButton* sortButton = new QPushButton(i18nc("@action:button that pops up sorting strategy selection menu", "Sort list..."), this);
QPushButton* sortButton = new QPushButton(i18nc("@action:button that pops up sorting strategy selection menu", "Sort List..."), this);
QMenu* sortMenu = new QMenu(sortButton);
sortButton->setMenu(sortMenu);
m_sortByTitle = sortMenu->addAction(i18nc("@action:inmenu selects sorting strategy for collection list", "By title"));
m_sortByPieceCount = sortMenu->addAction(i18nc("@action:inmenu selects sorting strategy for collection list", "By piece count"));
m_sortByTitle = sortMenu->addAction(i18nc("@action:inmenu selects sorting strategy for collection list", "By Title"));
m_sortByPieceCount = sortMenu->addAction(i18nc("@action:inmenu selects sorting strategy for collection list", "By Piece Count"));
m_sortByTitle->setCheckable(true);
m_sortByPieceCount->setCheckable(true);
m_sortByTitle->setChecked(true);
......
......@@ -50,24 +50,24 @@ void Palapeli::MainWindow::setupActions()
QAction * statusBarAct = KStandardAction::showStatusbar
(m_game->puzzleTable(), &PuzzleTableWidget::showStatusBar, actionCollection());
statusBarAct->setChecked(Settings::showStatusBar());
statusBarAct->setText(i18n("Show statusbar of puzzle table"));
statusBarAct->setText(i18n("Show Statusbar of Puzzle Table"));
// Back to collection.
QAction * goCollAct = new QAction(QIcon::fromTheme(QStringLiteral("go-previous")), i18n("Back to &collection"), this);
QAction * goCollAct = new QAction(QIcon::fromTheme(QStringLiteral("go-previous")), i18n("Back to &Collection"), this);
goCollAct->setToolTip(i18n("Go back to the collection to choose another puzzle"));
goCollAct->setEnabled(false); //because the collection is initially shown
actionCollection()->addAction(QStringLiteral("view_collection"), goCollAct);
connect(goCollAct, &QAction::triggered, m_game, &GamePlay::actionGoCollection);
// Create new puzzle (FIXME: action should have a custom icon).
QAction * createAct = new QAction(QIcon::fromTheme(QStringLiteral("tools-wizard")), i18n("Create &new puzzle..."), this);
QAction * createAct = new QAction(QIcon::fromTheme(QStringLiteral("tools-wizard")), i18n("Create &New Puzzle..."), this);
createAct->setToolTip(i18n("Create a new puzzle using an image file from your disk"));
actionCollection()->setDefaultShortcuts(createAct, KStandardShortcut::openNew());
actionCollection()->addAction(QStringLiteral("game_new"), createAct);
connect(createAct, &QAction::triggered, m_game, &GamePlay::actionCreate);
// Delete a puzzle.
QAction * deleteAct = new QAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("&Delete puzzle"), this);
QAction * deleteAct = new QAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("&Delete Puzzle"), this);
deleteAct->setEnabled(false); //will be enabled when something is selected
deleteAct->setToolTip(i18n("Delete the selected puzzle from your collection"));
actionCollection()->addAction(QStringLiteral("game_delete"), deleteAct);
......@@ -75,13 +75,13 @@ void Palapeli::MainWindow::setupActions()
connect(deleteAct, &QAction::triggered, m_game, &GamePlay::actionDelete);
// Import from file...
QAction * importAct = new QAction(QIcon::fromTheme(QStringLiteral("document-import")), i18n("&Import from file..."), this);
QAction * importAct = new QAction(QIcon::fromTheme(QStringLiteral("document-import")), i18n("&Import from File..."), this);
importAct->setToolTip(i18n("Import a new puzzle from a file into your collection"));
actionCollection()->addAction(QStringLiteral("game_import"), importAct);
connect(importAct, &QAction::triggered, m_game, &GamePlay::actionImport);
// Export to file...
QAction * exportAct = new QAction(QIcon::fromTheme(QStringLiteral("document-export")), i18n("&Export to file..."), this);
QAction * exportAct = new QAction(QIcon::fromTheme(QStringLiteral("document-export")), i18n("&Export to File..."), this);
exportAct->setEnabled(false); //will be enabled when something is selected
exportAct->setToolTip(i18n("Export the selected puzzle from your collection into a file"));
actionCollection()->addAction(QStringLiteral("game_export"), exportAct);
......@@ -89,7 +89,7 @@ void Palapeli::MainWindow::setupActions()
connect(exportAct, &QAction::triggered, m_game, &GamePlay::actionExport);
//Reshuffle and restart puzzle
QAction * restartPuzzleAct = new QAction(QIcon::fromTheme(QStringLiteral("view-refresh")), i18n("&Restart puzzle..."), this);
QAction * restartPuzzleAct = new QAction(QIcon::fromTheme(QStringLiteral("view-refresh")), i18n("&Restart Puzzle..."), this);
restartPuzzleAct->setToolTip(i18n("Delete the saved progress and reshuffle the pieces"));
restartPuzzleAct->setEnabled(false); //no puzzle in progress initially
actionCollection()->addAction(QStringLiteral("game_restart"), restartPuzzleAct);
......@@ -97,7 +97,7 @@ void Palapeli::MainWindow::setupActions()
// Quit.
KStandardGameAction::quit (this, &QWidget::close, actionCollection());
// Create piece-holder.
QAction * createHolderAct = new QAction(i18n("&Create piece holder..."), this);
QAction * createHolderAct = new QAction(i18n("&Create Piece Holder..."), this);
createHolderAct->setToolTip(i18n("Create a temporary holder for sorting pieces"));
actionCollection()->setDefaultShortcut(createHolderAct, QKeySequence(Qt::Key_C));
actionCollection()->addAction(QStringLiteral("move_create_holder"), createHolderAct);
......@@ -105,21 +105,21 @@ void Palapeli::MainWindow::setupActions()
qOverload<>(&GamePlay::createHolder));
// Delete piece-holder.
QAction * deleteHolderAct = new QAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("&Delete piece holder"), this);
QAction * deleteHolderAct = new QAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("&Delete Piece Holder"), this);
deleteHolderAct->setToolTip(i18n("Delete a selected temporary holder when it is empty"));
actionCollection()->setDefaultShortcut(deleteHolderAct, QKeySequence(Qt::Key_D));
actionCollection()->addAction(QStringLiteral("move_delete_holder"), deleteHolderAct);
connect(deleteHolderAct, &QAction::triggered, m_game, &GamePlay::deleteHolder);
// Select all pieces in a piece-holder.
QAction * selectAllAct = new QAction(QIcon::fromTheme(QStringLiteral("edit-select-all")), i18n("&Select all in holder"), this);
QAction * selectAllAct = new QAction(QIcon::fromTheme(QStringLiteral("edit-select-all")), i18n("&Select All in Holder"), this);
selectAllAct->setToolTip(i18n("Select all pieces in a selected piece holder"));
actionCollection()->setDefaultShortcut(selectAllAct, QKeySequence(Qt::Key_A));
actionCollection()->addAction(QStringLiteral("move_select_all"), selectAllAct);
connect(selectAllAct, &QAction::triggered, m_game, &GamePlay::selectAll);
// Rearrange a selected piece-holder or selected pieces in any view.
QAction * rearrangeAct = new QAction(i18n("&Rearrange pieces"), this);
QAction * rearrangeAct = new QAction(i18n("&Rearrange Pieces"), this);
rearrangeAct->setToolTip(i18n("Rearrange all pieces in a selected piece holder or selected pieces in any window"));
actionCollection()->setDefaultShortcut(rearrangeAct, QKeySequence(Qt::Key_R));
actionCollection()->addAction(QStringLiteral("move_rearrange"), rearrangeAct);
......@@ -144,7 +144,7 @@ void Palapeli::MainWindow::setupActions()
KStandardAction::zoomOut(m_game, &GamePlay::actionZoomOut,
actionCollection());
// Settings: enable messages that the user marked "Do not show again".
QAction * enableMessagesAct = new QAction(i18n("Enable all messages"), this);
QAction * enableMessagesAct = new QAction(i18n("Enable All Messages"), this);
actionCollection()->addAction(QStringLiteral("enable_messages"), enableMessagesAct);
connect(enableMessagesAct, &QAction::triggered, this, &MainWindow::enableMessages);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment