Commit 744a872d authored by Nate Graham's avatar Nate Graham Committed by Fushan Wen
Browse files

Folder View: add translation context for short icon-related strings

A lot of these strings are very short and benefit from translation
context.

BUG: 451923
FIXED-IN: 5.25
parent 42480e30
Pipeline #155514 passed with stage
in 3 minutes and 42 seconds
......@@ -128,7 +128,8 @@ Item {
Kirigami.FormData.label: i18n("Arrangement:")
model: [i18n("Rows"), i18n("Columns")]
model: [i18nc("@item:inlistbox arrangement of icons", "Rows"),
i18nc("@item:inlistbox arrangement of icons", "Columns")]
}
ComboBox {
......@@ -136,7 +137,8 @@ Item {
Layout.fillWidth: true
visible: !isPopup || viewMode.currentIndex === 1 /* Icons mode */
model: [i18n("Align left"), i18n("Align right")]
model: [i18nc("@item:inlistbox alignment of icons", "Align left"),
i18nc("@item:inlistbox alignment of icons", "Align right")]
}
CheckBox {
......@@ -173,7 +175,11 @@ Item {
property variant indexToMode: [-1, 0, 1, 6, 2]
property variant modeToIndex: {'-1' : '0', '0' : '1', '1' : '2', '6' : '3', '2' : '4'}
model: [i18n("Manual"), i18n("Name"), i18n("Size"), i18n("Type"), i18n("Date")]
model: [i18nc("@item:inlistbox sort icons manually", "Manual"),
i18nc("@item:inlistbox sort icons by name", "Name"),
i18nc("@item:inlistbox sort icons by size", "Size"),
i18nc("@item:inlistbox sort icons by file type", "Type"),
i18nc("@item:inlistbox sort icons by date", "Date")]
Component.onCompleted: currentIndex = modeToIndex[mode]
onActivated: mode = indexToMode[index]
......@@ -184,7 +190,7 @@ Item {
enabled: (sortMode.currentIndex != 0)
text: i18n("Descending")
text: i18nc("@option:check sort icons in descending order", "Descending")
}
CheckBox {
......@@ -192,7 +198,7 @@ Item {
enabled: (sortMode.currentIndex != 0)
text: i18n("Folders first")
text: i18nc("@option:check sort icons with folders first", "Folders first")
}
Item {
......@@ -208,7 +214,8 @@ Item {
Kirigami.FormData.label: i18nc("whether to use icon or list view", "View mode:")
model: [i18n("List"), i18n("Icons")]
model: [i18nc("@item:inlistbox show icons in a list", "List"),
i18nc("@item:inlistbox show icons in an icon grid", "Icons")]
}
......@@ -234,7 +241,7 @@ Item {
Layout.alignment: Qt.AlignLeft
visible: !isPopup || viewMode.currentIndex === 1 /* Icons mode */
text: i18n("Small")
text: i18nc("@label:slider smallest icon size", "Small")
}
Item {
Layout.fillWidth: true
......@@ -243,7 +250,7 @@ Item {
Layout.alignment: Qt.AlignRight
visible: !isPopup || viewMode.currentIndex === 1 /* Icons mode */
text: i18n("Large")
text: i18nc("@label:slider largest icon size", "Large")
}
}
......@@ -255,9 +262,9 @@ Item {
Kirigami.FormData.label: i18n("Label width:")
model: [
i18n("Narrow"),
i18n("Medium"),
i18n("Wide")
i18nc("@item:inlistbox how long a text label should be", "Narrow"),
i18nc("@item:inlistbox how long a text label should be", "Medium"),
i18nc("@item:inlistbox how long a text label should be", "Wide")
]
}
......
......@@ -19,36 +19,42 @@ ViewPropertiesMenu::ViewPropertiesMenu(QObject *parent)
QMenu *menu = m_menu->addMenu(QIcon::fromTheme(QStringLiteral("view-sort")), i18n("Sort By"));
m_sortMode = new QActionGroup(this);
connect(m_sortMode, &QActionGroup::triggered, this, &ViewPropertiesMenu::sortModeChanged);
QAction *action = menu->addAction(i18n("Unsorted"));
QAction *action = menu->addAction(i18nc("@item:inmenu Sort icons manually", "Unsorted"));
action->setCheckable(true);
action->setData(-1);
m_sortMode->addAction(action);
action = menu->addAction(i18n("Name"));
action = menu->addAction(i18nc("@item:inmenu Sort icons by name", "Name"));
action->setCheckable(true);
action->setData(int(KDirModel::Name));
m_sortMode->addAction(action);
action = menu->addAction(i18n("Size"));
action = menu->addAction(i18nc("@item:inmenu Sort icons by size", "Size"));
action->setCheckable(true);
action->setData(int(KDirModel::Size));
m_sortMode->addAction(action);
action = menu->addAction(i18n("Type"));
action = menu->addAction(i18nc("@item:inmenu Sort icons by file type", "Type"));
action->setCheckable(true);
action->setData(int(KDirModel::Type));
m_sortMode->addAction(action);
action = menu->addAction(i18n("Date"));
action = menu->addAction(i18nc("@item:inmenu Sort icons by date", "Date"));
action->setCheckable(true);
action->setData(int(KDirModel::ModifiedTime));
m_sortMode->addAction(action);
menu->addSeparator();
m_sortDesc = menu->addAction(i18n("Descending"), this, &ViewPropertiesMenu::sortDescChanged);
m_sortDesc = menu->addAction(i18nc("@item:inmenu Sort icons in descending order", "Descending"), this, &ViewPropertiesMenu::sortDescChanged);
m_sortDesc->setCheckable(true);
m_sortDirsFirst = menu->addAction(i18n("Folders First"), this, &ViewPropertiesMenu::sortDirsFirstChanged);
m_sortDirsFirst = menu->addAction(i18nc("@item:inmenu Sort icons with folders first", "Folders First"), this, &ViewPropertiesMenu::sortDirsFirstChanged);
m_sortDirsFirst->setCheckable(true);
m_iconSizeMenu = m_menu->addMenu(QIcon::fromTheme(QStringLiteral("transform-scale")), i18n("Icon Size"));
m_iconSize = new QActionGroup(this);
connect(m_iconSize, &QActionGroup::triggered, this, &ViewPropertiesMenu::iconSizeChanged);
const QStringList iconSizes{i18n("Tiny"), i18n("Very Small"), i18n("Small"), i18n("Small-Medium"), i18n("Medium"), i18n("Large"), i18n("Huge")};
const QStringList iconSizes{i18nc("@item:inmenu size of the icons", "Tiny"),
i18nc("@item:inmenu size of the icons", "Very Small"),
i18nc("@item:inmenu size of the icons", "Small"),
i18nc("@item:inmenu size of the icons", "Small-Medium"),
i18nc("@item:inmenu size of the icons", "Medium"),
i18nc("@item:inmenu size of the icons", "Large"),
i18nc("@item:inmenu size of the icons", "Huge")};
for (int i = 0; i < iconSizes.count(); ++i) {
action = m_iconSizeMenu->addAction(iconSizes.at(i));
action->setCheckable(true);
......@@ -59,11 +65,11 @@ ViewPropertiesMenu::ViewPropertiesMenu(QObject *parent)
m_arrangementMenu = m_menu->addMenu(QIcon::fromTheme(QStringLiteral("object-rows")), i18n("Arrange In"));
m_arrangement = new QActionGroup(this);
connect(m_arrangement, &QActionGroup::triggered, this, &ViewPropertiesMenu::arrangementChanged);
action = m_arrangementMenu->addAction(i18n("Rows"));
action = m_arrangementMenu->addAction(i18nc("@item:inmenu arrangement of icons", "Rows"));
action->setCheckable(true);
action->setData(0);
m_arrangement->addAction(action);
action = m_arrangementMenu->addAction(i18n("Columns"));
action = m_arrangementMenu->addAction(i18nc("@item:inmenu arrangement of icons", "Columns"));
action->setData(1);
action->setCheckable(true);
m_arrangement->addAction(action);
......@@ -71,11 +77,11 @@ ViewPropertiesMenu::ViewPropertiesMenu(QObject *parent)
m_alignmentMenu = m_menu->addMenu(QIcon::fromTheme(QStringLiteral("align-horizontal-left")), i18n("Align"));
m_alignment = new QActionGroup(this);
connect(m_alignment, &QActionGroup::triggered, this, &ViewPropertiesMenu::alignmentChanged);
action = m_alignmentMenu->addAction(i18n("Left"));
action = m_alignmentMenu->addAction(i18nc("@item:inmenu alignment of icons", "Left"));
action->setCheckable(true);
action->setData(0);
m_alignment->addAction(action);
action = m_alignmentMenu->addAction(i18n("Right"));
action = m_alignmentMenu->addAction(i18nc("@item:inmenu alignment of icons", "Right"));
action->setCheckable(true);
action->setData(1);
m_alignment->addAction(action);
......@@ -83,7 +89,10 @@ ViewPropertiesMenu::ViewPropertiesMenu(QObject *parent)
m_previews = m_menu->addAction(QIcon::fromTheme(QStringLiteral("view-preview")), i18n("Show Previews"), this, &ViewPropertiesMenu::previewsChanged);
m_previews->setCheckable(true);
m_locked = m_menu->addAction(QIcon::fromTheme(QStringLiteral("lock")), i18n("Locked"), this, &ViewPropertiesMenu::lockedChanged);
m_locked = m_menu->addAction(QIcon::fromTheme(QStringLiteral("lock")),
i18nc("@item:inmenu lock icon positions in place", "Locked"),
this,
&ViewPropertiesMenu::lockedChanged);
m_locked->setCheckable(true);
}
......
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