Commit 1f70496c authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Add more UI context markers for strings

parent 0f37967d
......@@ -109,22 +109,22 @@ void Killbots::Coordinator::setScene(Scene *scene)
m_scene = scene;
m_roundDisplay = new NumericDisplayItem;
m_roundDisplay->setLabel(i18n("Round:"));
m_roundDisplay->setLabel(i18nc("@label", "Round:"));
m_roundDisplay->setDigits(2);
m_scene->addNumericDisplay(m_roundDisplay);
m_scoreDisplay = new NumericDisplayItem;
m_scoreDisplay->setLabel(i18n("Score:"));
m_scoreDisplay->setLabel(i18nc("@label", "Score:"));
m_scoreDisplay->setDigits(5);
m_scene->addNumericDisplay(m_scoreDisplay);
m_enemyCountDisplay = new NumericDisplayItem;
m_enemyCountDisplay->setLabel(i18n("Enemies:"));
m_enemyCountDisplay->setLabel(i18nc("@label", "Enemies:"));
m_enemyCountDisplay->setDigits(3);
m_scene->addNumericDisplay(m_enemyCountDisplay);
m_energyDisplay = new NumericDisplayItem;
m_energyDisplay->setLabel(i18n("Energy:"));
m_energyDisplay->setLabel(i18nc("@label", "Energy:"));
m_energyDisplay->setDigits(2);
m_scene->addNumericDisplay(m_energyDisplay);
......@@ -413,22 +413,22 @@ void Killbots::Coordinator::showUnqueuedMessage(const QString &message, int time
void Killbots::Coordinator::showRoundCompleteMessage()
{
m_stages.last().message = i18n("Round complete.");
m_stages.last().message = i18nc("@info", "Round complete.");
}
void Killbots::Coordinator::showBoardFullMessage()
{
m_stages.last().message = i18n("Board is full.\nResetting enemy counts.");
m_stages.last().message = i18nc("@info", "Board is full.\nResetting enemy counts.");
}
void Killbots::Coordinator::showNewGameMessage()
{
showUnqueuedMessage(i18n("New game."));
showUnqueuedMessage(i18nc("@info", "New game."));
}
void Killbots::Coordinator::showGameOverMessage()
{
showUnqueuedMessage(i18n("Game over."), 15000);
showUnqueuedMessage(i18nc("@info", "Game over."), 15000);
}
#include "moc_coordinator.cpp"
......@@ -8,7 +8,7 @@
<MenuBar>
<Menu name="moveMenu">
<text>Move</text>
<text context="@title:menu">Move</text>
<Action name="teleport"/>
<Action name="teleport_safely"/>
<Action name="teleport_sip"/>
......
......@@ -100,19 +100,19 @@ void Killbots::MainWindow::configurePreferences()
// Creating setting pages and adding them to the dialog
configDialog->addPage(new OptionsPage(this),
i18n("General"),
i18nc("@title", "General"),
QStringLiteral("configure"),
i18n("Configure general settings")
i18nc("@info", "Configure general settings")
);
configDialog->addPage(new RulesetSelector(this),
i18n("Game Type"),
i18nc("@title", "Game Type"),
QStringLiteral("games-config-custom"),
i18n("Select a game type")
i18nc("@info", "Select a game type")
);
configDialog->addPage(new KgThemeSelector(Renderer::self()->themeProvider()),
i18n("Appearance"),
i18nc("@title", "Appearance"),
QStringLiteral("games-config-theme"),
i18n("Select a graphical theme")
i18nc("@info", "Select a graphical theme")
);
configDialog->setMaximumSize(800, 600);
......@@ -147,9 +147,9 @@ void Killbots::MainWindow::onConfigDialogClosed()
if (!m_engine->gameHasStarted()
|| KMessageBox::questionYesNo(this,
i18n("A new game type has been selected, but there is already a game in progress."),
i18n("Game Type Changed"),
KGuiItem(i18n("Continue Current Game")),
KGuiItem(i18n("Start a New Game"))
i18nc("@title:window", "Game Type Changed"),
KGuiItem(i18nc("@action:button", "Continue Current Game")),
KGuiItem(i18nc("@action:button", "Start a New Game"))
) == KMessageBox::No
) {
m_coordinator->requestNewGame();
......@@ -162,7 +162,7 @@ void Killbots::MainWindow::onConfigDialogClosed()
void Killbots::MainWindow::createScoreDialog()
{
m_scoreDialog = new KScoreDialog(KScoreDialog::Name, this);
m_scoreDialog->addField(KScoreDialog::Level, i18n("Round"), QStringLiteral("round"));
m_scoreDialog->addField(KScoreDialog::Level, i18nc("@title:column round of the game", "Round"), QStringLiteral("round"));
m_scoreDialog->setModal(false);
QStringList fileList;
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("killbots/ruleset"), QStandardPaths::LocateDirectory);
......@@ -246,94 +246,94 @@ void Killbots::MainWindow::setupActions()
createMappedAction(TeleportSafely,
QStringLiteral("teleport_safely"),
i18n("Teleport Safely"),
i18nc("@action", "Teleport Safely"),
i18nc("Shortcut for teleport safely. See https://quickgit.kde.org/?p=killbots.git&a=blob&f=README.translators&o=plain", "T"),
Qt::Key_Plus,
i18n("Teleport to a safe location"),
i18nc("@info:tooltip", "Teleport to a safe location"),
QStringLiteral("games-solve")
);
createMappedAction(Teleport,
QStringLiteral("teleport"),
i18n("Teleport"),
i18nc("@action", "Teleport"),
i18nc("Shortcut for teleport. See https://quickgit.kde.org/?p=killbots.git&a=blob&f=README.translators&o=plain", "R"),
Qt::Key_Minus,
i18n("Teleport to a random location"),
i18nc("@info:tooltip", "Teleport to a random location"),
QStringLiteral("roll")
);
createMappedAction(TeleportSafelyIfPossible,
QStringLiteral("teleport_sip"),
i18n("Teleport, Safely If Possible"),
i18nc("@action", "Teleport (Safely If Possible)"),
i18nc("Shortcut for teleport safely if possible. See https://quickgit.kde.org/?p=killbots.git&a=blob&f=README.translators&o=plain", "Space"),
Qt::Key_0,
i18n("Teleport safely if that action is enabled, otherwise teleport randomly")
i18nc("@info:tooltip", "Teleport safely if that action is enabled, otherwise teleport randomly")
);
createMappedAction(Vaporizer,
QStringLiteral("vaporizer"),
i18n("Vaporizer"),
i18nc("@action", "Vaporizer"),
i18nc("Shortcut for vaporizer. See https://quickgit.kde.org/?p=killbots.git&a=blob&f=README.translators&o=plain", "F"),
Qt::Key_Period,
i18n("Destroy all enemies in neighboring cells"),
i18nc("@info:tooltip", "Destroy all enemies in neighboring cells"),
QStringLiteral("edit-bomb")
);
createMappedAction(WaitOutRound,
QStringLiteral("wait_out_round"),
i18n("Wait Out Round"),
i18nc("@action", "Wait Out Round"),
i18nc("Shortcut for wait out round. See https://quickgit.kde.org/?p=killbots.git&a=blob&f=README.translators&o=plain", "V"),
Qt::Key_Asterisk,
i18n("Risk remaining in place until the end of the round for bonuses"),
i18nc("@info:tooltip", "Risk remaining in place until the end of the round for bonuses"),
QStringLiteral("process-stop")
);
createMappedAction(UpLeft,
QStringLiteral("move_up_left"),
i18n("Move Up and Left"),
i18nc("@action", "Move Up and Left"),
i18nc("Shortcut for move up and left. https://quickgit.kde.org/?p=killbots.git&a=blob&f=README.translators&o=plain", "Q"),
Qt::Key_7
);
createMappedAction(Up,
QStringLiteral("move_up"),
i18n("Move Up"),
i18nc("@action", "Move Up"),
i18nc("Shortcut for move up. See https://quickgit.kde.org/?p=killbots.git&a=blob&f=README.translators&o=plain", "W"),
Qt::Key_8
);
createMappedAction(UpRight,
QStringLiteral("move_up_right"),
i18n("Move Up and Right"),
i18nc("@action", "Move Up and Right"),
i18nc("Shortcut for move up and right. https://quickgit.kde.org/?p=killbots.git&a=blob&f=README.translators&o=plain", "E"),
Qt::Key_9
);
createMappedAction(Left,
QStringLiteral("move_left"),
i18n("Move Left"),
i18nc("@action", "Move Left"),
i18nc("Shortcut for move left. See https://quickgit.kde.org/?p=killbots.git&a=blob&f=README.translators&o=plain", "A"),
Qt::Key_4
);
createMappedAction(Hold,
QStringLiteral("stand_still"),
i18n("Stand Still"),
i18nc("@action", "Stand Still"),
i18nc("Shortcut for stand still. See https://quickgit.kde.org/?p=killbots.git&a=blob&f=README.translators&o=plain", "S"),
Qt::Key_5
);
createMappedAction(Right,
QStringLiteral("move_right"),
i18n("Move Right"),
i18nc("@action", "Move Right"),
i18nc("Shortcut for move right. See https://quickgit.kde.org/?p=killbots.git&a=blob&f=README.translators&o=plain", "D"),
Qt::Key_6
);
createMappedAction(DownLeft,
QStringLiteral("move_down_left"),
i18n("Move Down and Left"),
i18nc("@action", "Move Down and Left"),
i18nc("Shortcut for move down and left. See https://quickgit.kde.org/?p=killbots.git&a=blob&f=README.translators&o=plain", "Z"),
Qt::Key_1
);
createMappedAction(Down,
QStringLiteral("move_down"),
i18n("Move Down"),
i18nc("@action", "Move Down"),
i18nc("Shortcut for move down. See https://quickgit.kde.org/?p=killbots.git&a=blob&f=README.translators&o=plain", "X"),
Qt::Key_2
);
createMappedAction(DownRight,
QStringLiteral("move_down_right"),
i18n("Move Down and Right"),
i18nc("@action", "Move Down and Right"),
i18nc("Shortcut for move down and right. https://quickgit.kde.org/?p=killbots.git&a=blob&f=README.translators&o=plain", "C"),
Qt::Key_3
);
......
......@@ -31,14 +31,15 @@
Killbots::OptionsPage::OptionsPage(QWidget *parent)
: QWidget(parent)
{
QStringList clickActionList;
clickActionList << i18n("Nothing");
clickActionList << i18n("Step");
clickActionList << i18n("Repeated Step");
clickActionList << i18n("Teleport");
clickActionList << i18n("Teleport Safely");
clickActionList << i18n("Teleport (Safely If Possible)");
clickActionList << i18n("Wait Out Round");
const QStringList clickActionList {
i18nc("@item:inlistbox No action on click", "Nothing"),
i18nc("@action", "Step"),
i18nc("@action", "Repeated Step"),
i18nc("@action", "Teleport"),
i18nc("@action", "Teleport Safely"),
i18nc("@action", "Teleport (Safely If Possible)"),
i18nc("@action", "Wait Out Round"),
};
kcfg_MiddleClickAction = new KComboBox();
kcfg_MiddleClickAction->setObjectName(QStringLiteral("kcfg_MiddleClickAction"));
......@@ -52,11 +53,11 @@ Killbots::OptionsPage::OptionsPage(QWidget *parent)
kcfg_AnimationSpeed->setObjectName(QStringLiteral("kcfg_AnimationSpeed"));
kcfg_AnimationSpeed->setSingleStep(1);
kcfg_AnimationSpeed->setMinimumWidth(200);
QLabel *slowLabel = new QLabel(i18n("Slow"));
QLabel *slowLabel = new QLabel(i18nc("@item:inrange", "Slow"));
slowLabel->setAlignment(Qt::AlignLeft);
QLabel *fastLabel = new QLabel(i18n("Fast"));
QLabel *fastLabel = new QLabel(i18nc("@item:inrange", "Fast"));
fastLabel->setAlignment(Qt::AlignCenter);
QLabel *instantLabel = new QLabel(i18n("Instant"));
QLabel *instantLabel = new QLabel(i18nc("@item:inrange", "Instant"));
instantLabel->setAlignment(Qt::AlignRight);
QGridLayout *speedLayout = new QGridLayout();
......@@ -67,16 +68,16 @@ Killbots::OptionsPage::OptionsPage(QWidget *parent)
speedLayout->addWidget(fastLabel, 1, 1);
speedLayout->addWidget(instantLabel, 1, 2);
QLabel *speedLabel = new QLabel(i18n("Animation &speed:"));
QLabel *speedLabel = new QLabel(i18nc("@label:slider", "Animation &speed:"));
speedLabel->setBuddy(kcfg_AnimationSpeed);
kcfg_PreventUnsafeMoves = new QCheckBox(i18n("Prevent &unsafe moves"));
kcfg_PreventUnsafeMoves = new QCheckBox(i18nc("@option:check", "Prevent &unsafe moves"));
kcfg_PreventUnsafeMoves->setObjectName(QStringLiteral("kcfg_PreventUnsafeMoves"));
QFormLayout *formLayout = new QFormLayout(this);
formLayout->setContentsMargins(0, 0, 0, 0);
formLayout->addRow(i18n("&Middle-click action:"), kcfg_MiddleClickAction);
formLayout->addRow(i18n("&Right-click action:"), kcfg_RightClickAction);
formLayout->addRow(i18nc("@label:listbox", "&Middle-click action:"), kcfg_MiddleClickAction);
formLayout->addRow(i18nc("@label:listbox", "&Right-click action:"), kcfg_RightClickAction);
formLayout->addItem(new QSpacerItem(0, 16, QSizePolicy::Minimum, QSizePolicy::Fixed));
formLayout->addRow(speedLabel, speedLayout);
formLayout->addItem(new QSpacerItem(0, 16, QSizePolicy::Minimum, QSizePolicy::Fixed));
......
......@@ -45,10 +45,11 @@ Killbots::RulesetDetailsDialog::RulesetDetailsDialog(QWidget *parent)
void Killbots::RulesetDetailsDialog::loadRuleset(const Ruleset *ruleset)
{
static QStringList maskedItems = QStringList() << QStringLiteral("Name") << QStringLiteral("Author") << QStringLiteral("AuthorContact") << QStringLiteral("Description");
static QStringList junkheapEnumText = QStringList()
<< i18nc("Quantity of junkheaps that can be pushed", "None")
<< i18nc("Quantity of junkheaps that can be pushed", "One")
<< i18nc("Quantity of junkheaps that can be pushed", "Many");
const QStringList junkheapEnumText {
i18nc("@item Quantity of junkheaps that can be pushed", "None"),
i18nc("@item Quantity of junkheaps that can be pushed", "One"),
i18nc("@item Quantity of junkheaps that can be pushed", "Many"),
};
// If the dialog hasn't been setup already, do so.
if (m_labels.size() == 0) {
......@@ -75,7 +76,7 @@ void Killbots::RulesetDetailsDialog::loadRuleset(const Ruleset *ruleset)
QString valueText;
if (dynamic_cast<const KCoreConfigSkeleton::ItemBool *>(item)) {
valueText = item->property().toBool() ? i18n("Yes") : i18n("No");
valueText = item->property().toBool() ? i18nc("@item", "Yes") : i18nc("@item", "No");
} else if (it.key() == QLatin1String("PushableJunkheaps")) {
valueText = junkheapEnumText.at(item->property().toInt());
} else {
......@@ -85,6 +86,6 @@ void Killbots::RulesetDetailsDialog::loadRuleset(const Ruleset *ruleset)
it.value()->setText(valueText);
}
setWindowTitle(i18n("Details of %1 Game Type", ruleset->name()));
setWindowTitle(i18nc("@title:window", "Details of %1 Game Type", ruleset->name()));
}
......@@ -45,19 +45,19 @@ Killbots::RulesetSelector::RulesetSelector(QWidget *parent)
kcfg_Ruleset->hide();
m_listWidget = new QListWidget();
m_listWidget->setWhatsThis(i18n("A list of the Killbots rulesets installed on this computer."));
m_listWidget->setWhatsThis(i18nc("@info:whatsthis", "A list of the Killbots rulesets installed on this computer."));
QGroupBox *groupBox = new QGroupBox(i18n("Game Type Details"));
groupBox->setWhatsThis(i18n("Lists information on the currently selected game type."));
QGroupBox *groupBox = new QGroupBox(i18nc("title:group", "Game Type Details"));
groupBox->setWhatsThis(i18nc("@info:whatsthis", "Lists information on the currently selected game type."));
QLabel *authorLabel = new QLabel(i18n("Author:"));
QLabel *authorLabel = new QLabel(i18nc("@label", "Author:"));
authorLabel->setAlignment(Qt::AlignRight | Qt::AlignTop);
m_author = new QLabel();
m_author->setAlignment(Qt::AlignLeft | Qt::AlignTop);
m_author->setWordWrap(true);
QLabel *contactLabel = new QLabel(i18n("Contact:"));
QLabel *contactLabel = new QLabel(i18nc("@label", "Contact:"));
contactLabel->setAlignment(Qt::AlignRight | Qt::AlignTop);
m_authorContact = new QLabel();
......@@ -65,16 +65,16 @@ Killbots::RulesetSelector::RulesetSelector(QWidget *parent)
m_authorContact->setWordWrap(true);
m_authorContact->setOpenExternalLinks(true);
QLabel *descriptionLabel = new QLabel(i18n("Description:"));
QLabel *descriptionLabel = new QLabel(i18nc("@label", "Description:"));
descriptionLabel->setAlignment(Qt::AlignRight | Qt::AlignTop);
m_description = new QLabel();
m_description->setAlignment(Qt::AlignLeft | Qt::AlignTop);
m_description->setWordWrap(true);
QPushButton *detailsButton = new QPushButton(i18n("Details..."));
detailsButton->setToolTip(i18n("Show the detailed parameters of the selected game type"));
detailsButton->setWhatsThis(i18n("Opens a dialog listing the values of all internal parameters for the selected game type."));
QPushButton *detailsButton = new QPushButton(i18nc("@action:button", "Details..."));
detailsButton->setToolTip(i18nc("@info:tooltip", "Show the detailed parameters of the selected game type"));
detailsButton->setWhatsThis(i18nc("@info:whatsthisp", "Opens a dialog listing the values of all internal parameters for the selected game type."));
QGridLayout *boxLayout = new QGridLayout(groupBox);
boxLayout->addWidget(authorLabel, 1, 0);
......
Markdown is supported
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