Skip to content

Commit 8666e51

Browse files
committed
remove some hardcoded values
1 parent 2c23160 commit 8666e51

3 files changed

Lines changed: 31 additions & 13 deletions

File tree

screen-toolkit/RegionSelector.qml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,18 +300,18 @@ Variants {
300300
border.color: Qt.rgba(1,1,1,0.1); border.width: 1
301301
Row {
302302
id: _hintRow; anchors.centerIn: parent; spacing: 0
303-
NText { text: "Drag"; color: Qt.rgba(1,1,1,0.7); pointSize: Style.fontSizeXS; font.weight: Font.Bold }
304-
NText { text: " to select"; color: Qt.rgba(1,1,1,0.4); pointSize: Style.fontSizeXS }
303+
NText { text: pluginApi?.tr("regionSelector.drag"); color: Qt.rgba(1,1,1,0.7); pointSize: Style.fontSizeXS; font.weight: Font.Bold }
304+
NText { text: pluginApi?.tr("regionSelector.toSelect"); color: Qt.rgba(1,1,1,0.4); pointSize: Style.fontSizeXS }
305305
Item { width: 18; height: 1 }
306306
Rectangle { width: 1; height: 14; color: Qt.rgba(1,1,1,0.25); anchors.verticalCenter: parent.verticalCenter }
307307
Item { width: 18; height: 1 }
308-
NText { text: "Click window"; color: Qt.rgba(1,1,1,0.7); pointSize: Style.fontSizeXS; font.weight: Font.Bold }
309-
NText { text: " to snap"; color: Qt.rgba(1,1,1,0.4); pointSize: Style.fontSizeXS }
308+
NText { text: pluginApi?.tr("regionSelector.clickWindow"); color: Qt.rgba(1,1,1,0.7); pointSize: Style.fontSizeXS; font.weight: Font.Bold }
309+
NText { text: pluginApi?.tr("regionSelector.toSnap"); color: Qt.rgba(1,1,1,0.4); pointSize: Style.fontSizeXS }
310310
Item { width: 18; height: 1 }
311311
Rectangle { width: 1; height: 14; color: Qt.rgba(1,1,1,0.25); anchors.verticalCenter: parent.verticalCenter }
312312
Item { width: 18; height: 1 }
313-
NText { text: "Esc"; color: Qt.rgba(1,1,1,0.7); pointSize: Style.fontSizeXS; font.weight: Font.Bold }
314-
NText { text: " to cancel"; color: Qt.rgba(1,1,1,0.4); pointSize: Style.fontSizeXS }
313+
NText { text: pluginApi?.tr("regionSelector.esc"); color: Qt.rgba(1,1,1,0.7); pointSize: Style.fontSizeXS; font.weight: Font.Bold }
314+
NText { text: pluginApi?.tr("regionSelector.toCancel"); color: Qt.rgba(1,1,1,0.4); pointSize: Style.fontSizeXS }
315315
}
316316
}
317317
MouseArea {
@@ -395,3 +395,4 @@ Variants {
395395
}
396396
}
397397
}
398+

screen-toolkit/Settings.qml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ ColumnLayout {
104104
spacing: Style.marginS
105105

106106
readonly property var tokens: [
107-
{ label: "Year", value: "%Y" },
108-
{ label: "Month", value: "%m" },
109-
{ label: "Day", value: "%d" },
110-
{ label: "Hour", value: "%H" },
111-
{ label: "Minute", value: "%M" },
112-
{ label: "Second", value: "%S" },
107+
{ label: pluginApi?.tr("settings.filenameTokens.year"), value: "%Y" },
108+
{ label: pluginApi?.tr("settings.filenameTokens.month"), value: "%m" },
109+
{ label: pluginApi?.tr("settings.filenameTokens.day"), value: "%d" },
110+
{ label: pluginApi?.tr("settings.filenameTokens.hour"), value: "%H" },
111+
{ label: pluginApi?.tr("settings.filenameTokens.minute"), value: "%M" },
112+
{ label: pluginApi?.tr("settings.filenameTokens.second"), value: "%S" },
113113
]
114114

115115
Repeater {
@@ -209,3 +209,4 @@ ColumnLayout {
209209
}
210210
}
211211
}
212+

screen-toolkit/i18n/en.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,23 @@
110110
"videoPathDesc": "Where recordings are saved. Leave empty for ~/Videos.",
111111
"filenameFormat": "Filename Format",
112112
"filenameFormatDesc": "Template for generated filenames. Extension is added automatically.",
113-
"widgetSettings": "Widget Settings"
113+
"widgetSettings": "Widget Settings",
114+
"filenameTokens": {
115+
"year": "Year",
116+
"month": "Month",
117+
"day": "Day",
118+
"hour": "Hour",
119+
"minute": "Minute",
120+
"second": "Second"
121+
}
122+
},
123+
"regionSelector": {
124+
"drag": "Drag",
125+
"toSelect": "to select",
126+
"clickWindow": "Click window",
127+
"toSnap": "to snap",
128+
"esc": "Esc",
129+
"toCancel": "to cancel"
114130
},
115131
"annotate": {
116132
"copied": "Copied to clipboard",

0 commit comments

Comments
 (0)