Adopt string casings according to HIG

This commit also improve formatting and style in some places.
This commit is contained in:
Emir SARI 2023-07-19 01:29:36 +03:00 committed by Bart De Vries
parent c684cdc355
commit c4cb10b7aa
15 changed files with 47 additions and 47 deletions

View File

@ -17,7 +17,7 @@ import org.kde.kmediasession 1.0
Kirigami.ApplicationWindow { Kirigami.ApplicationWindow {
id: root id: root
title: i18n("Example player KMediaSession") title: i18n("Example KMediaSession Player")
KMediaSession { KMediaSession {
id: audio id: audio
@ -69,13 +69,13 @@ Kirigami.ApplicationWindow {
RowLayout { RowLayout {
Controls.Button { Controls.Button {
icon.name: "document-open-folder" icon.name: "document-open-folder"
text: i18n("Select file...") text: i18n("Select File…")
onClicked: filePathDialog.open() onClicked: filePathDialog.open()
} }
FileDialog { FileDialog {
id: filePathDialog id: filePathDialog
title: i18n("Select media file") title: i18n("Select Media File")
currentFile: audio.source currentFile: audio.source
onAccepted: { onAccepted: {
audio.source = filePathDialog.file; audio.source = filePathDialog.file;
@ -171,13 +171,13 @@ Kirigami.ApplicationWindow {
} }
ColumnLayout { ColumnLayout {
Controls.Label { Controls.Label {
text: i18n("title: %1", audio.metaData.title) text: i18n("Title: %1", audio.metaData.title)
} }
Controls.Label { Controls.Label {
text: i18n("artist: %1", audio.metaData.artist) text: i18n("Artist: %1", audio.metaData.artist)
} }
Controls.Label { Controls.Label {
text: i18n("album: %1", audio.metaData.album) text: i18n("Album: %1", audio.metaData.album)
} }
Image { Image {
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
@ -188,13 +188,13 @@ Kirigami.ApplicationWindow {
} }
ColumnLayout { ColumnLayout {
Controls.Label { Controls.Label {
text: i18n("mediaStatus: %1", audio.mediaStatus) text: i18n("Media status: %1", audio.mediaStatus)
} }
Controls.Label { Controls.Label {
text: i18n("playbackStatus: %1", audio.playbackState) text: i18n("Playback status: %1", audio.playbackState)
} }
Controls.Label { Controls.Label {
text: i18n("error: %1", audio.error) text: i18n("Error: %1", audio.error)
} }
} }
} }

View File

@ -122,7 +122,7 @@ int main(int argc, char *argv[])
QStringLiteral(KASTS_VERSION_STRING), QStringLiteral(KASTS_VERSION_STRING),
i18n("Podcast Player"), i18n("Podcast Player"),
KAboutLicense::GPL, KAboutLicense::GPL,
i18n("© 2020-2023 KDE Community")); i18n("© 20202023 KDE Community"));
about.addAuthor(i18n("Tobias Fella"), QString(), QStringLiteral("tobias.fella@kde.org"), QStringLiteral("https://tobiasfella.de")); about.addAuthor(i18n("Tobias Fella"), QString(), QStringLiteral("tobias.fella@kde.org"), QStringLiteral("https://tobiasfella.de"));
about.addAuthor(i18n("Bart De Vries"), QString(), QStringLiteral("bart@mogwai.be")); about.addAuthor(i18n("Bart De Vries"), QString(), QStringLiteral("bart@mogwai.be"));
about.setProgramLogo(QVariant(QIcon(QStringLiteral(":/logo.svg")))); about.setProgramLogo(QVariant(QIcon(QStringLiteral(":/logo.svg"))));

View File

@ -156,11 +156,11 @@ QString AbstractEpisodeProxyModel::getFilterName(FilterType type) const
{ {
switch (type) { switch (type) {
case FilterType::NoFilter: case FilterType::NoFilter:
return i18nc("@label:chooser Choice of filter for episode list", "No Filter"); return i18nc("@label:chooser Choice of filter for episode list", "No filter");
case FilterType::ReadFilter: case FilterType::ReadFilter:
return i18nc("@label:chooser Choice of filter for episode list", "Played Episodes"); return i18nc("@label:chooser Choice of filter for episode list", "Played episodes");
case FilterType::NotReadFilter: case FilterType::NotReadFilter:
return i18nc("@label:chooser Choice of filter for episode list", "Unplayed Episodes"); return i18nc("@label:chooser Choice of filter for episode list", "Unplayed episodes");
case FilterType::NewFilter: case FilterType::NewFilter:
return i18nc("@label:chooser Choice of filter for episode list", "Episodes marked as \"New\""); return i18nc("@label:chooser Choice of filter for episode list", "Episodes marked as \"New\"");
case FilterType::NotNewFilter: case FilterType::NotNewFilter:
@ -182,7 +182,7 @@ QString AbstractEpisodeProxyModel::getSearchFlagName(SearchFlag flag) const
case SearchFlag::ContentFlag: case SearchFlag::ContentFlag:
return i18nc("@label:chooser Choice of fields to search for string", "Description"); return i18nc("@label:chooser Choice of fields to search for string", "Description");
case SearchFlag::FeedNameFlag: case SearchFlag::FeedNameFlag:
return i18nc("@label:chooser Choice of fields to search for string", "Podcast Title"); return i18nc("@label:chooser Choice of fields to search for string", "Podcast title");
default: default:
return QString(); return QString();
} }

View File

@ -116,7 +116,7 @@ FocusScope {
Controls.ToolTip.visible: hovered Controls.ToolTip.visible: hovered
Controls.ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval Controls.ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
Controls.ToolTip.text: i18n("Seek Backward") Controls.ToolTip.text: i18n("Seek backward")
} }
Controls.ToolButton { Controls.ToolButton {
id: playButton id: playButton
@ -135,7 +135,7 @@ FocusScope {
Controls.ToolTip.visible: hovered Controls.ToolTip.visible: hovered
Controls.ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval Controls.ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
Controls.ToolTip.text: i18n("Seek Forward") Controls.ToolTip.text: i18n("Seek forward")
} }
Controls.ToolButton { Controls.ToolButton {
icon.name: "media-skip-forward" icon.name: "media-skip-forward"
@ -144,7 +144,7 @@ FocusScope {
Controls.ToolTip.visible: hovered Controls.ToolTip.visible: hovered
Controls.ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval Controls.ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
Controls.ToolTip.text: i18n("Skip Forward") Controls.ToolTip.text: i18n("Skip forward")
} }
Controls.ToolButton { Controls.ToolButton {
id: playbackRateButton id: playbackRateButton
@ -169,7 +169,7 @@ FocusScope {
Controls.ToolTip.visible: hovered Controls.ToolTip.visible: hovered
Controls.ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval Controls.ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
Controls.ToolTip.text: i18n("Playback Rate: ") + AudioManager.playbackRate.toFixed(2) + "x" Controls.ToolTip.text: i18n("Playback rate:") + " " + AudioManager.playbackRate.toFixed(2) + "x"
} }
} }
@ -228,7 +228,7 @@ FocusScope {
Controls.ToolTip { Controls.ToolTip {
visible: parent.hovered visible: parent.hovered
delay: Qt.styleHints.mousePressAndHoldInterval delay: Qt.styleHints.mousePressAndHoldInterval
text: i18nc("@action:button", "Show Chapter List") text: i18nc("@action:button", "Show chapter list")
} }
} }
@ -240,7 +240,7 @@ FocusScope {
Controls.ToolTip { Controls.ToolTip {
visible: parent.hovered visible: parent.hovered
delay: Qt.styleHints.mousePressAndHoldInterval delay: Qt.styleHints.mousePressAndHoldInterval
text: i18nc("@action:button", "Show Episode Info") text: i18nc("@action:button", "Show episode info")
} }
} }
@ -252,7 +252,7 @@ FocusScope {
Controls.ToolTip { Controls.ToolTip {
visible: parent.hovered visible: parent.hovered
delay: Qt.styleHints.mousePressAndHoldInterval delay: Qt.styleHints.mousePressAndHoldInterval
text: i18nc("@action:button", "Open Sleep Timer Settings") text: i18nc("@action:button", "Open sleep timer settings")
} }
} }
} }
@ -267,7 +267,7 @@ FocusScope {
Controls.ToolTip { Controls.ToolTip {
visible: parent.hovered visible: parent.hovered
delay: Qt.styleHints.mousePressAndHoldInterval delay: Qt.styleHints.mousePressAndHoldInterval
text: i18nc("@action:button", "Open Volume Settings") text: i18nc("@action:button", "Open volume settings")
} }
onClicked: { onClicked: {
if (volumePopup.visible) { if (volumePopup.visible) {
@ -311,7 +311,7 @@ FocusScope {
Controls.ToolTip { Controls.ToolTip {
visible: parent.hovered visible: parent.hovered
delay: Qt.styleHints.mousePressAndHoldInterval delay: Qt.styleHints.mousePressAndHoldInterval
text: i18nc("@action:button", "Toggle Mute") text: i18nc("@action:button", "Toggle mute")
} }
} }
} }
@ -328,7 +328,7 @@ FocusScope {
Controls.ToolTip { Controls.ToolTip {
visible: parent.hovered visible: parent.hovered
delay: Qt.styleHints.mousePressAndHoldInterval delay: Qt.styleHints.mousePressAndHoldInterval
text: i18nc("@action:button", "Show More") text: i18nc("@action:button", "Show more")
} }
onClicked: { onClicked: {
if (overflowMenu.visible) { if (overflowMenu.visible) {

View File

@ -27,7 +27,7 @@ ListView {
visible: errorList.count == 0 visible: errorList.count == 0
anchors.centerIn: parent anchors.centerIn: parent
text: i18n("No Errors Logged") text: i18n("No errors logged")
} }
Component { Component {
@ -63,7 +63,7 @@ ListView {
opacity: 1 opacity: 1
} }
Controls.Label { Controls.Label {
text: i18n("Error Code: ") + error.code + (error.message ? " · " + error.message : "") text: i18n("Error code:") + " " + error.code + (error.message ? " · " + error.message : "")
Layout.fillWidth: true Layout.fillWidth: true
elide: Text.ElideRight elide: Text.ElideRight
font: Kirigami.Theme.smallFont font: Kirigami.Theme.smallFont

View File

@ -329,7 +329,7 @@ Kirigami.ScrollablePage {
readOnly: true readOnly: true
selectByMouse: !Kirigami.Settings.isMobile selectByMouse: !Kirigami.Settings.isMobile
textFormat:TextEdit.RichText textFormat:TextEdit.RichText
text: isSubscribed ? i18n("Last Updated: %1", feed.lastUpdated.toLocaleString(Qt.locale(), Locale.ShortFormat)) : "" text: isSubscribed ? i18n("Last updated: %1", feed.lastUpdated.toLocaleString(Qt.locale(), Locale.ShortFormat)) : ""
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
color: Kirigami.Theme.textColor color: Kirigami.Theme.textColor
} }

View File

@ -51,7 +51,7 @@ Kirigami.ScrollablePage {
}, },
Kirigami.Action { Kirigami.Action {
id: addAction id: addAction
text: i18nc("@action:intoolbar", "Add Podcast...") text: i18nc("@action:intoolbar", "Add Podcast")
icon.name: "list-add" icon.name: "list-add"
onTriggered: { onTriggered: {
addSheet.open() addSheet.open()
@ -59,13 +59,13 @@ Kirigami.ScrollablePage {
}, },
Kirigami.Action { Kirigami.Action {
id: importAction id: importAction
text: i18nc("@action:intoolbar", "Import Podcasts...") text: i18nc("@action:intoolbar", "Import Podcasts")
icon.name: "document-import" icon.name: "document-import"
displayHint: Kirigami.DisplayHint.AlwaysHide displayHint: Kirigami.DisplayHint.AlwaysHide
onTriggered: importDialog.open() onTriggered: importDialog.open()
}, },
Kirigami.Action { Kirigami.Action {
text: i18nc("@action:intoolbar", "Export Podcasts...") text: i18nc("@action:intoolbar", "Export Podcasts")
icon.name: "document-export" icon.name: "document-export"
displayHint: Kirigami.DisplayHint.AlwaysHide displayHint: Kirigami.DisplayHint.AlwaysHide
onTriggered: exportDialog.open() onTriggered: exportDialog.open()

View File

@ -38,6 +38,6 @@ Kirigami.InlineMessage {
TextMetrics { TextMetrics {
id: textMetrics id: textMetrics
text: i18nc("@info:status Name of the filter which is active on the ListView", "Filter Active: %1", proxyModel.filterName) text: i18nc("@info:status Name of the filter which is active on the ListView", "Active filter: %1", proxyModel.filterName)
} }
} }

View File

@ -97,7 +97,7 @@ Kirigami.Dialog {
onClicked: rateSlider.value = Math.max(0.0, rateSlider.value - 0.05) onClicked: rateSlider.value = Math.max(0.0, rateSlider.value - 0.05)
Controls.ToolTip.visible: hovered Controls.ToolTip.visible: hovered
Controls.ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval Controls.ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
Controls.ToolTip.text: i18nc("@action:button", "Decrease Playback Rate") Controls.ToolTip.text: i18nc("@action:button", "Decrease playback rate")
} }
Controls.Slider { Controls.Slider {
@ -116,7 +116,7 @@ Kirigami.Dialog {
onClicked: rateSlider.value = Math.min(3.0, rateSlider.value + 0.05) onClicked: rateSlider.value = Math.min(3.0, rateSlider.value + 0.05)
Controls.ToolTip.visible: hovered Controls.ToolTip.visible: hovered
Controls.ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval Controls.ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
Controls.ToolTip.text: i18nc("@action:button", "Increase Playback Rate") Controls.ToolTip.text: i18nc("@action:button", "Increase playback rate")
} }
} }

View File

@ -38,7 +38,7 @@ Controls.Control {
Kirigami.SearchField { Kirigami.SearchField {
Layout.fillWidth: true Layout.fillWidth: true
id: searchField id: searchField
placeholderText: i18nc("@label:textbox Placeholder text for episode search field", "Search Episodes") placeholderText: i18nc("@label:textbox Placeholder text for episode search field", "Search episodes…")
focus: true focus: true
autoAccept: false autoAccept: false
onAccepted: { onAccepted: {
@ -88,7 +88,7 @@ Controls.Control {
Controls.ToolTip.visible: hovered Controls.ToolTip.visible: hovered
Controls.ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval Controls.ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
Controls.ToolTip.text: i18nc("@info:tooltip", "Filter Episodes by Status") Controls.ToolTip.text: i18nc("@info:tooltip", "Filter episodes by status")
onPressed: { onPressed: {
if (filterMenu.visible) { if (filterMenu.visible) {

View File

@ -109,7 +109,7 @@ Kirigami.ScrollablePage {
MobileForm.FormComboBoxDelegate { MobileForm.FormComboBoxDelegate {
id: selectAudioBackend id: selectAudioBackend
text: i18nc("Label for setting to select audio playback backend", "Select Audio Backend") text: i18nc("Label for setting to select audio playback backend", "Select audio backend")
textRole: "text" textRole: "text"
valueRole: "value" valueRole: "value"
@ -139,7 +139,7 @@ Kirigami.ScrollablePage {
MobileForm.FormCheckDelegate { MobileForm.FormCheckDelegate {
id: showTimeLeft id: showTimeLeft
Kirigami.FormData.label: i18nc("Label for settings related to the play time, e.g. whether the total track time is shown or a countdown of the remaining play time", "Play Time:") Kirigami.FormData.label: i18nc("Label for settings related to the play time, e.g. whether the total track time is shown or a countdown of the remaining play time", "Play time:")
checked: SettingsManager.toggleRemainingTime checked: SettingsManager.toggleRemainingTime
text: i18n("Show time left instead of total track time") text: i18n("Show time left instead of total track time")
onToggled: { onToggled: {
@ -277,9 +277,9 @@ Kirigami.ScrollablePage {
text: i18n("Played episode behavior") text: i18n("Played episode behavior")
textRole: "text" textRole: "text"
valueRole: "value" valueRole: "value"
model: [{"text": i18n("Do Not Delete"), "value": 0}, model: [{"text": i18n("Do not delete"), "value": 0},
{"text": i18n("Delete Immediately"), "value": 1}, {"text": i18n("Delete immediately"), "value": 1},
{"text": i18n("Delete at Next Startup"), "value": 2}] {"text": i18n("Delete at next startup"), "value": 2}]
Component.onCompleted: currentIndex = indexOfValue(SettingsManager.autoDeleteOnPlayed) Component.onCompleted: currentIndex = indexOfValue(SettingsManager.autoDeleteOnPlayed)
onActivated: { onActivated: {
SettingsManager.autoDeleteOnPlayed = currentValue; SettingsManager.autoDeleteOnPlayed = currentValue;

View File

@ -47,7 +47,7 @@ Kirigami.ScrollablePage {
trailing: Controls.Button { trailing: Controls.Button {
Layout.leftMargin: Kirigami.Units.largeSpacing Layout.leftMargin: Kirigami.Units.largeSpacing
icon.name: "document-open-folder" icon.name: "document-open-folder"
text: i18n("Select folder...") text: i18n("Select Folder…")
enabled: !defaultStoragePath.checked enabled: !defaultStoragePath.checked
onClicked: storagePathDialog.open() onClicked: storagePathDialog.open()
} }

View File

@ -56,7 +56,7 @@ Kirigami.Dialog {
Controls.Label { Controls.Label {
opacity: (timerActive) ? 1 : 0.5 opacity: (timerActive) ? 1 : 0.5
Layout.bottomMargin: Kirigami.Units.largeSpacing Layout.bottomMargin: Kirigami.Units.largeSpacing
text: i18n("Remaining Time: %1", AudioManager.formattedRemainingSleepTime) text: i18n("Remaining time: %1", AudioManager.formattedRemainingSleepTime)
} }
RowLayout { RowLayout {

View File

@ -17,7 +17,7 @@ import org.kde.kasts 1.0
Kirigami.ApplicationWindow { Kirigami.ApplicationWindow {
id: kastsMainWindow id: kastsMainWindow
title: "Kasts" title: i18n("Kasts")
width: Kirigami.Settings.isMobile ? 360 : 800 width: Kirigami.Settings.isMobile ? 360 : 800
height: Kirigami.Settings.isMobile ? 660 : 600 height: Kirigami.Settings.isMobile ? 660 : 600

View File

@ -480,8 +480,8 @@ void Sync::savePasswordToFile(const QString &username, const QString &password)
passwordFile.fileName(), passwordFile.fileName(),
QStringLiteral(""), QStringLiteral(""),
0, 0,
i18n("I/O Denied: Cannot save password."), i18n("I/O denied: Cannot save password."),
i18n("I/O Denied: Cannot save password.")); i18n("I/O denied: Cannot save password."));
Q_EMIT passwordSaveFinished(false); Q_EMIT passwordSaveFinished(false);
} else { } else {
passwordFile.write(password.toUtf8()); passwordFile.write(password.toUtf8());
@ -561,8 +561,8 @@ QString Sync::retrievePasswordFromFile(const QString &username)
passwordFile.fileName(), passwordFile.fileName(),
QStringLiteral(""), QStringLiteral(""),
0, 0,
i18n("I/O Denied: Cannot access password file."), i18n("I/O denied: Cannot access password file."),
i18n("I/O Denied: Cannot access password file.")); i18n("I/O denied: Cannot access password file."));
return QStringLiteral(""); return QStringLiteral("");
} }