Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Wrap majority of textProperty labels in i18n function.

Wolthera van Hövell tot Westerflier5ce10886f85f
diff --git a/plugins/dockers/textproperties/TextPropertiesDock.cpp b/plugins/dockers/textproperties/TextPropertiesDock.cpp
index 1c72e942a6..1e18df6e75 100644
--- a/plugins/dockers/textproperties/TextPropertiesDock.cpp
+++ b/plugins/dockers/textproperties/TextPropertiesDock.cpp
@@ -19,6 +19,8 @@
#include <kis_canvas_resource_provider.h>
#include <KisStaticInitializer.h>
+#include <KLocalizedContext>
+
#include <KoResourcePaths.h>
#include <KoCanvasResourcesIds.h>
#include <KoSvgTextPropertyData.h>
@@ -48,6 +50,7 @@ TextPropertiesDock::TextPropertiesDock()
setEnabled(true);
m_quickWidget->engine()->rootContext()->setContextProperty("mainWindow", this);
+ m_quickWidget->engine()->rootContext()->setContextObject(new KLocalizedContext(this));
m_quickWidget->engine()->addImportPath(KoResourcePaths::getApplicationRoot() + "/lib/qml/");
m_quickWidget->engine()->addImportPath(KoResourcePaths::getApplicationRoot() + "/lib64/qml/");
diff --git a/plugins/dockers/textproperties/qml/AlignmentBaseline.qml b/plugins/dockers/textproperties/qml/AlignmentBaseline.qml
index f8ba0749e4..62a86aea04 100644
--- a/plugins/dockers/textproperties/qml/AlignmentBaseline.qml
+++ b/plugins/dockers/textproperties/qml/AlignmentBaseline.qml
@@ -8,6 +8,8 @@ import QtQuick.Controls 2.0
import QtQuick.Layouts 1.12
TextPropertyBase {
+ property int baselineSelection;
+ onBaselineSelectionChanged: baselineCmb.currentIndex = baselineCmb.indexOfValue(baselineSelection);
GridLayout {
columns: 2;
columnSpacing: columnSpacing;
@@ -26,7 +28,7 @@ TextPropertyBase {
}
Label {
- text: "Alignment Baseline:"
+ text: i18nc("@label:listbox", "Alignment Baseline:")
}
@@ -35,9 +37,22 @@ TextPropertyBase {
height: 1;
}
ComboBox {
- model: ["Baseline", "Alphabetic", "Ideographic", "Central", "Hanging", "Middle", "Mathematical", "Text-Top", "Text-Bottom"]
+ model: [
+ {text: i18nc("@label:inlistbox", "Baseline"), value: 0},
+ {text: i18nc("@label:inlistbox", "Alphabetic"), value: 6},
+ {text: i18nc("@label:inlistbox", "Ideographic"), value: 5},
+ {text: i18nc("@label:inlistbox", "Central"), value: 9},
+ {text: i18nc("@label:inlistbox", "Hanging"), value: 7},
+ {text: i18nc("@label:inlistbox", "Middle"), value: 10},
+ {text: i18nc("@label:inlistbox", "Mathematical"), value: 8},
+ {text: i18nc("@label:inlistbox", "Text-Top"), value: 11},
+ {text: i18nc("@label:inlistbox", "Text-Bottom"), value: 12}
+ ]
Layout.fillWidth: true;
id: baselineCmb;
+ textRole: "text";
+ valueRole: "value";
+ onActivated: baselineSelection = currentValue;
}
}
}
diff --git a/plugins/dockers/textproperties/qml/BaselineShift.qml b/plugins/dockers/textproperties/qml/BaselineShift.qml
index 76839d2313..5f5b0cf1be 100644
--- a/plugins/dockers/textproperties/qml/BaselineShift.qml
+++ b/plugins/dockers/textproperties/qml/BaselineShift.qml
@@ -26,7 +26,7 @@ TextPropertyBase {
}
Label {
- text: "Baseline-Shift:"
+ text: i18nc("@label", "Baseline-Shift:")
Layout.columnSpan: 2;
}
@@ -38,7 +38,9 @@ TextPropertyBase {
ComboBox {
Layout.columnSpan: 2;
- model: ["Number", "Super", "Sub"]
+ model: [i18nc("@label:inlistbox", "Number"),
+ i18nc("@label:inlistbox", "Super"),
+ i18nc("@label:inlistbox", "Sub")]
id: baselineShiftCmb;
}
diff --git a/plugins/dockers/textproperties/qml/Direction.qml b/plugins/dockers/textproperties/qml/Direction.qml
index 2151e6d549..3210a7a13f 100644
--- a/plugins/dockers/textproperties/qml/Direction.qml
+++ b/plugins/dockers/textproperties/qml/Direction.qml
@@ -8,6 +8,9 @@ import QtQuick.Controls 2.0
import QtQuick.Layouts 1.12
TextPropertyBase {
+ property int direction;
+ onDirectionChanged: directionCmb.currentIndex = directionCmb.indexOfValue(direction)
+
RowLayout {
id: row
spacing: columnSpacing;
@@ -26,13 +29,19 @@ TextPropertyBase {
}
Label {
- text: "Direction:";
+ text: i18nc("@label:listbox", "Direction:");
}
ComboBox {
id: directionCmb
Layout.fillWidth: true;
- model: ["Left to Right", "Right to Left"]
+ model: [
+ {text: i18nc("@label:inlistbox", "Left to Right"), value: 0},
+ {text: i18nc("@label:inlistbox", "Right to Left"), value: 1}
+ ]
+ textRole: "text";
+ valueRole: "value";
+ onActivated: direction = currentValue;
}
}
}
diff --git a/plugins/dockers/textproperties/qml/DominantBaseline.qml b/plugins/dockers/textproperties/qml/DominantBaseline.qml
index 7a372f2a65..58e86ed590 100644
--- a/plugins/dockers/textproperties/qml/DominantBaseline.qml
+++ b/plugins/dockers/textproperties/qml/DominantBaseline.qml
@@ -8,6 +8,8 @@ import QtQuick.Controls 2.0
import QtQuick.Layouts 1.12
TextPropertyBase {
+ property int baselineSelection
+ onBaselineSelectionChanged: baselineCmb.currentIndex = baselineCmb.indexOfValue(baselineSelection);
GridLayout {
columns: 2;
columnSpacing: columnSpacing;
@@ -26,7 +28,7 @@ TextPropertyBase {
}
Label {
- text: "Dominant Baseline:"
+ text: i18nc("@label:listbox", "Dominant Baseline:")
}
@@ -35,9 +37,22 @@ TextPropertyBase {
height: 1;
}
ComboBox {
- model: ["Alphabetic", "Ideographic", "Central", "Hanging", "Middle", "Mathematical", "Text-Top", "Text-Bottom"]
+ model: [
+ {text: i18nc("@label:inlistbox", "Baseline"), value: 0},
+ {text: i18nc("@label:inlistbox", "Alphabetic"), value: 6},
+ {text: i18nc("@label:inlistbox", "Ideographic"), value: 5},
+ {text: i18nc("@label:inlistbox", "Central"), value: 9},
+ {text: i18nc("@label:inlistbox", "Hanging"), value: 7},
+ {text: i18nc("@label:inlistbox", "Middle"), value: 10},
+ {text: i18nc("@label:inlistbox", "Mathematical"), value: 8},
+ {text: i18nc("@label:inlistbox", "Text-Top"), value: 11},
+ {text: i18nc("@label:inlistbox", "Text-Bottom"), value: 12}
+ ]
Layout.fillWidth: true;
id: baselineCmb;
+ textRole: "text";
+ valueRole: "value";
+ onActivated: baselineSelection = currentValue;
}
}
}
diff --git a/plugins/dockers/textproperties/qml/FontFamily.qml b/plugins/dockers/textproperties/qml/FontFamily.qml
index 066a88b8bb..a03ead54ce 100644
--- a/plugins/dockers/textproperties/qml/FontFamily.qml
+++ b/plugins/dockers/textproperties/qml/FontFamily.qml
@@ -8,7 +8,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.12
CollapsibleGroupProperty {
- propertyName: "Font Family:";
+ propertyName: i18nc("@label", "Font Family:");
property var fontFamilies: [];
property var fontFamilyModel : [];
diff --git a/plugins/dockers/textproperties/qml/FontSize.qml b/plugins/dockers/textproperties/qml/FontSize.qml
index ed09f90087..2a95d00812 100644
--- a/plugins/dockers/textproperties/qml/FontSize.qml
+++ b/plugins/dockers/textproperties/qml/FontSize.qml
@@ -28,7 +28,7 @@ TextPropertyBase {
}
Label {
- text: "Font Size:"
+ text: i18nc("@label:spinbox", "Font Size:")
}
SpinBox {
@@ -37,7 +37,14 @@ TextPropertyBase {
}
ComboBox {
- model: ["Pt", "Em", "Ex"]
+ model: [
+ {text: i18nc("@label:inlistbox", "Pt"), value: 0},
+ {text: i18nc("@label:inlistbox", "Em"), value: 1},
+ {text: i18nc("@label:inlistbox", "Ex"), value: 2},
+ {text: i18nc("@label:inlistbox", "%"), value: 3}
+ ]
+ textRole: "text";
+ valueRole: "value";
}
}
}
diff --git a/plugins/dockers/textproperties/qml/FontStyle.qml b/plugins/dockers/textproperties/qml/FontStyle.qml
index 5f28acbb68..88c8f13a24 100644
--- a/plugins/dockers/textproperties/qml/FontStyle.qml
+++ b/plugins/dockers/textproperties/qml/FontStyle.qml
@@ -8,11 +8,12 @@ import QtQuick.Controls 2.0
import QtQuick.Layouts 1.12
CollapsibleGroupProperty {
- propertyName: "Font Style";
+ propertyName: i18nc("@label", "Font Style");
property alias fontWeight: fontWeightSpn.value;
property alias fontWidth: fontStretchSpn.value;
- property alias fontSlant: fontSlantCmb.currentIndex;
+ property var fontSlant;
+ onFontSlantChanged: fontSlantCmb.currentIndex = fontSlantCmb.indexOfValue(fontSlant)
property alias fontOptical: opticalSizeCbx.checked;
titleItem: ComboBox {
@@ -33,7 +34,7 @@ CollapsibleGroupProperty {
icon.source: "qrc:///light_view-refresh.svg"
}
Label {
- text: "Weight:"
+ text: i18nc("@label:spinbox", "Weight:")
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
horizontalAlignment: Text.AlignRight;
}
@@ -53,7 +54,7 @@ CollapsibleGroupProperty {
icon.source: "qrc:///light_view-refresh.svg"
}
Label {
- text: "Width:"
+ text: i18nc("@label:spinbox", "Width:")
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
horizontalAlignment: Text.AlignRight;
}
@@ -72,15 +73,22 @@ CollapsibleGroupProperty {
icon.source: "qrc:///light_view-refresh.svg"
}
Label {
- text: "Slant:"
+ text: i18nc("@label:listbox", "Slant:")
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
horizontalAlignment: Text.AlignRight;
}
ComboBox {
id: fontSlantCmb
- model: ["Normal", "Italic", "Oblique"]
+ model: [
+ {text: i18nc("@label:inlistbox", "Normal"), value: 0},
+ {text: i18nc("@label:inlistbox", "Italic"), value: 1},
+ {text: i18nc("@label:inlistbox", "Oblique"), value: 2}
+ ]
Layout.fillWidth: true
+ textRole: "text";
+ valueRole: "value";
+ onActivated: fontSlant = currentValue;
}
ToolButton {
@@ -94,7 +102,7 @@ CollapsibleGroupProperty {
height: 1;}
CheckBox {
id: opticalSizeCbx
- text: "Optical Size"
+ text: i18nc("@option:check", "Optical Size")
Layout.fillWidth: true
}
diff --git a/plugins/dockers/textproperties/qml/HangingPunctuation.qml b/plugins/dockers/textproperties/qml/HangingPunctuation.qml
index a850896ace..3b5a85e1f2 100644
--- a/plugins/dockers/textproperties/qml/HangingPunctuation.qml
+++ b/plugins/dockers/textproperties/qml/HangingPunctuation.qml
@@ -26,7 +26,7 @@ TextPropertyBase {
}
Label {
- text: "Hanging-punctuation:"
+ text: i18nc("@label", "Hanging-punctuation:")
}
Item {
@@ -34,7 +34,7 @@ TextPropertyBase {
height: 1;
}
CheckBox {
- text: "Hang First"
+ text: i18nc("@option:check", "Hang First")
id: paragraphStartCbx;
}
@@ -43,14 +43,17 @@ TextPropertyBase {
height: 1;
}
Label {
- text: "Line End:"
+ text: i18nc("@label:listbox", "Line End:")
}
Item {
width: firstColumnWidth;
height: 1;
}
ComboBox {
- model: ["No Hanging", "Allow hanging commas", "Force hanging commas"]
+ model: [
+ i18nc("@label:inlistbox", "No Hanging"),
+ i18nc("@label:inlistbox", "Allow hanging commas"),
+ i18nc("@label:inlistbox", "Force hanging commas")]
Layout.fillWidth: true;
id: lineEndCmb;
}
@@ -61,7 +64,7 @@ TextPropertyBase {
}
CheckBox {
- text: "Hang Last"
+ text: i18nc("@option:check", "Hang Last")
id: paragraphEndCbx;
}
diff --git a/plugins/dockers/textproperties/qml/LetterSpacing.qml b/plugins/dockers/textproperties/qml/LetterSpacing.qml
index a53c7a3a31..a140b2d3aa 100644
--- a/plugins/dockers/textproperties/qml/LetterSpacing.qml
+++ b/plugins/dockers/textproperties/qml/LetterSpacing.qml
@@ -25,7 +25,7 @@ TextPropertyBase {
}
Label {
- text: "Letter Spacing:"
+ text: i18nc("@label:spinbox", "Letter Spacing:")
}
SpinBox {
diff --git a/plugins/dockers/textproperties/qml/LineBreak.qml b/plugins/dockers/textproperties/qml/LineBreak.qml
index 950255953c..a75cc14b45 100644
--- a/plugins/dockers/textproperties/qml/LineBreak.qml
+++ b/plugins/dockers/textproperties/qml/LineBreak.qml
@@ -25,12 +25,18 @@ TextPropertyBase {
}
Label {
- text: "Line Break:"
+ text: i18nc("@label:listbox", "Line Break:")
}
ComboBox {
id: lineBreakCmb
- model: ["Auto", "Loose", "Normal", "Strict", "Anywhere"]
+ model: [
+ i18nc("@label:inlistbox", "Auto"),
+ i18nc("@label:inlistbox", "Loose"),
+ i18nc("@label:inlistbox", "Normal"),
+ i18nc("@label:inlistbox", "Strict"),
+ i18nc("@label:inlistbox", "Anywhere")
+ ]
Layout.fillWidth: true;
}
}
diff --git a/plugins/dockers/textproperties/qml/LineHeight.qml b/plugins/dockers/textproperties/qml/LineHeight.qml
index 73fa260b09..5e210a6777 100644
--- a/plugins/dockers/textproperties/qml/LineHeight.qml
+++ b/plugins/dockers/textproperties/qml/LineHeight.qml
@@ -32,7 +32,7 @@ TextPropertyBase {
}
Label {
- text: "Line Height:"
+ text: i18nc("@label", "Line Height:")
Layout.columnSpan: 2;
}
@@ -44,7 +44,7 @@ TextPropertyBase {
CheckBox {
Layout.columnSpan: 2;
- text: "Normal"
+ text: i18nc("@option:check", "Normal")
id: lineHeightNormalCbx;
onCheckedChanged: {
lineHeightSpn.enabled = !checked;
@@ -64,11 +64,11 @@ TextPropertyBase {
ComboBox {
id: lineHeightUnitCmb
model: [
- { text: "Pt", value: LineHeightModel.Pt},
- { text: "Em", value: LineHeightModel.Em},
- { text: "Ex", value: LineHeightModel.Ex},
- { text: "%", value: LineHeightModel.Percentage},
- { text: "Lines", value: LineHeightModel.Lines},
+ { text: i18nc("@label:inlistbox", "Pt"), value: LineHeightModel.Pt},
+ { text: i18nc("@label:inlistbox", "Em"), value: LineHeightModel.Em},
+ { text: i18nc("@label:inlistbox", "Ex"), value: LineHeightModel.Ex},
+ { text: i18nc("@label:inlistbox", "%"), value: LineHeightModel.Percentage},
+ { text: i18nc("@label:inlistbox", "Lines"), value: LineHeightModel.Lines},
]
textRole: "text";
valueRole: "value";
diff --git a/plugins/dockers/textproperties/qml/OTCaps.qml b/plugins/dockers/textproperties/qml/OTCaps.qml
index 23c0256da5..c6e1567856 100644
--- a/plugins/dockers/textproperties/qml/OTCaps.qml
+++ b/plugins/dockers/textproperties/qml/OTCaps.qml
@@ -26,7 +26,7 @@ TextPropertyBase {
}
Label {
- text: "Glyphs: Capitals:"
+ text: i18nc("@label:listbox", "Glyphs: Capitals:")
}
Item {
@@ -34,7 +34,14 @@ TextPropertyBase {
height: 1;
}
ComboBox {
- model: ["Normal", "Small Caps", "All Small Caps", "Petite Caps", "All Petite Caps", "Unicase", "Titling Caps"]
+ model: [
+ i18nc("@label:inlistbox", "Normal"),
+ i18nc("@label:inlistbox", "Small Caps"),
+ i18nc("@label:inlistbox", "All Small Caps"),
+ i18nc("@label:inlistbox", "Petite Caps"),
+ i18nc("@label:inlistbox", "All Petite Caps"),
+ i18nc("@label:inlistbox", "Unicase"),
+ i18nc("@label:inlistbox", "Titling Caps")]
Layout.fillWidth: true;
id: positionCmb;
}
diff --git a/plugins/dockers/textproperties/qml/OTEastAsian.qml b/plugins/dockers/textproperties/qml/OTEastAsian.qml
index 2358e15fa2..9418442191 100644
--- a/plugins/dockers/textproperties/qml/OTEastAsian.qml
+++ b/plugins/dockers/textproperties/qml/OTEastAsian.qml
@@ -26,7 +26,7 @@ TextPropertyBase {
}
Label {
- text: "Glyphs: East-Asian:"
+ text: i18nc("@title:group", "Glyphs: East-Asian:")
Layout.columnSpan: 2;
}
@@ -36,10 +36,18 @@ TextPropertyBase {
height: 1;
}
Label {
- text: "Variant:"
+ text: i18nc("@label:listbox", "Variant:")
}
ComboBox {
- model: ["Normal", "JIS78", "JIS83", "JIS90", "JIS04", "Simplified", "Traditional"]
+ model: [
+ i18nc("@label:inlistbox", "Normal"),
+ i18nc("@label:inlistbox", "JIS78"),
+ i18nc("@label:inlistbox", "JIS83"),
+ i18nc("@label:inlistbox", "JIS90"),
+ i18nc("@label:inlistbox", "JIS04"),
+ i18nc("@label:inlistbox", "Simplified"),
+ i18nc("@label:inlistbox", "Traditional")
+ ]
Layout.fillWidth: true;
id: variantCmb;
}
@@ -49,10 +57,14 @@ TextPropertyBase {
height: 1;
}
Label {
- text: "Width:"
+ text: i18nc("@label:listbox", "Width:")
}
ComboBox {
- model: ["Normal", "Full width", "Proportional"]
+ model: [
+ i18nc("@label:inlistbox", "Normal"),
+ i18nc("@label:inlistbox", "Full width"),
+ i18nc("@label:inlistbox", "Proportional")
+ ]
Layout.fillWidth: true;
id: widthCmb;
}
@@ -63,7 +75,7 @@ TextPropertyBase {
Layout.columnSpan: 2;
}
CheckBox {
- text: "Ruby"
+ text: i18nc("@option:check", "Ruby")
id: rubyCbx;
}
diff --git a/plugins/dockers/textproperties/qml/OTLigatures.qml b/plugins/dockers/textproperties/qml/OTLigatures.qml
index 49f5e33e89..279f604ea4 100644
--- a/plugins/dockers/textproperties/qml/OTLigatures.qml
+++ b/plugins/dockers/textproperties/qml/OTLigatures.qml
@@ -26,7 +26,7 @@ TextPropertyBase {
}
Label {
- text: "Glyphs: Ligatures:"
+ text: i18nc("@title:group", "Glyphs: Ligatures:")
Layout.fillWidth: true;
}
@@ -36,7 +36,7 @@ TextPropertyBase {
height: 1;
}
CheckBox {
- text: "Common"
+ text: i18nc("@option:check", "Common")
id: commonLigaCbx;
}
Item {
@@ -44,7 +44,7 @@ TextPropertyBase {
height: 1;
}
CheckBox {
- text: "Discretionary"
+ text: i18nc("@option:check", "Discretionary")
id: discretionaryLigaCbx;
}
Item {
@@ -52,7 +52,7 @@ TextPropertyBase {
height: 1;
}
CheckBox {
- text: "Historical"
+ text: i18nc("@option:check", "Historical")
id: historicalLigaCbx;
}
Item {
@@ -60,7 +60,7 @@ TextPropertyBase {
height: 1;
}
CheckBox {
- text: "Contextual"
+ text: i18nc("@option:check", "Contextual")
id: contextualLigaCbx;
}
diff --git a/plugins/dockers/textproperties/qml/OTNumeric.qml b/plugins/dockers/textproperties/qml/OTNumeric.qml
index 7f9702fa44..356b446238 100644
--- a/plugins/dockers/textproperties/qml/OTNumeric.qml
+++ b/plugins/dockers/textproperties/qml/OTNumeric.qml
@@ -26,7 +26,7 @@ TextPropertyBase {
}
Label {
- text: "Glyphs: Numeric:"
+ text: i18nc("@title:group", "Glyphs: Numeric:")
Layout.columnSpan: 2;
}
@@ -36,10 +36,14 @@ TextPropertyBase {
height: 1;
}
Label {
- text: "Style:"
+ text: i18nc("@label:listbox", "Style:")
}
ComboBox {
- model: ["Normal", "Lining", "Oldstyle"]
+ model: [
+ i18nc("@label:inlistbox", "Normal"),
+ i18nc("@label:inlistbox", "Lining"),
+ i18nc("@label:inlistbox", "Oldstyle")
+ ]
Layout.fillWidth: true;
id: styleCmb;
}
@@ -49,10 +53,14 @@ TextPropertyBase {
height: 1;
}
Label {
- text: "Spacing:"
+ text: i18nc("@label:listbox", "Spacing:")
}
ComboBox {
- model: ["Normal", "Proportional", "Tabular"]
+ model: [
+ i18nc("@label:inlistbox", "Normal"),
+ i18nc("@label:inlistbox", "Proportional"),
+ i18nc("@label:inlistbox", "Tabular")
+ ]
Layout.fillWidth: true;
id: spacingCmb;
}
@@ -62,10 +70,14 @@ TextPropertyBase {
height: 1;
}
Label {
- text: "Fractions:"
+ text: i18nc("@label:listbox", "Fractions:")
}
ComboBox {
- model: ["Normal", "Diagonal", "Stacked"]
+ model: [
+ i18nc("@label:inlistbox", "Normal"),
+ i18nc("@label:inlistbox", "Diagonal"),
+ i18nc("@label:inlistbox", "Stacked")
+ ]
Layout.fillWidth: true;
id: fractionCmb;
}
@@ -77,7 +89,7 @@ TextPropertyBase {
}
CheckBox {
- text: "Ordinals"
+ text: i18nc("@option:check", "Ordinals")
id: ordinalsCbx;
}
Item {
@@ -87,7 +99,7 @@ TextPropertyBase {
}
CheckBox {
- text: "Slashed Zero"
+ text: i18nc("@option:check", "Slashed Zero")
id: slashZeroCbx;
}
diff --git a/plugins/dockers/textproperties/qml/OTPosition.qml b/plugins/dockers/textproperties/qml/OTPosition.qml
index 440705e485..2f65205f74 100644
--- a/plugins/dockers/textproperties/qml/OTPosition.qml
+++ b/plugins/dockers/textproperties/qml/OTPosition.qml
@@ -26,7 +26,7 @@ TextPropertyBase {
}
Label {
- text: "Glyphs: Position:"
+ text: i18nc("@label:listbox", "Glyphs: Position:")
}
@@ -35,7 +35,11 @@ TextPropertyBase {
height: 1;
}
ComboBox {
- model: ["Normal", "Super", "Sub"]
+ model: [
+ i18nc("@label:inlistbox", "Normal"),
+ i18nc("@label:inlistbox", "Super"),
+ i18nc("@label:inlistbox", "Sub")
+ ]
Layout.fillWidth: true;
id: positionCmb;
}
diff --git a/plugins/dockers/textproperties/qml/OverflowWrap.qml b/plugins/dockers/textproperties/qml/OverflowWrap.qml
index 32f4069d0d..9d63ca1ff5 100644
--- a/plugins/dockers/textproperties/qml/OverflowWrap.qml
+++ b/plugins/dockers/textproperties/qml/OverflowWrap.qml
@@ -25,7 +25,7 @@ TextPropertyBase {
}
Label {
- text: "Writing Mode:"
+ text: i18nc("@title:group", "Overflow Wrap:")
}
diff --git a/plugins/dockers/textproperties/qml/TabSize.qml b/plugins/dockers/textproperties/qml/TabSize.qml
index 3c09e6754e..a2e5c89b5b 100644
--- a/plugins/dockers/textproperties/qml/TabSize.qml
+++ b/plugins/dockers/textproperties/qml/TabSize.qml
@@ -21,7 +21,7 @@ TextPropertyBase {
icon.source: "qrc:///light_view-refresh.svg"
}
Label {
- text: "Tab Size:"
+ text: i18nc("@title:group", "Tab Size:")
Layout.columnSpan: 2;
Layout.fillWidth: true;
}
@@ -36,7 +36,12 @@ TextPropertyBase {
Layout.fillWidth: true;
}
ComboBox {
- model: ["Spaces", "Pt", "Em", "Ex"]
+ model: [
+ i18nc("@label:inlistbox", "Spaces"),
+ i18nc("@label:inlistbox", "Pt"),
+ i18nc("@label:inlistbox", "Em"),
+ i18nc("@label:inlistbox", "Ex")
+ ]
}
}
diff --git a/plugins/dockers/textproperties/qml/TextAlign.qml b/plugins/dockers/textproperties/qml/TextAlign.qml
index 285f3337e1..52a95f2bec 100644
--- a/plugins/dockers/textproperties/qml/TextAlign.qml
+++ b/plugins/dockers/textproperties/qml/TextAlign.qml
@@ -23,13 +23,20 @@ CollapsibleGroupProperty {
icon.source: "qrc:///light_view-refresh.svg"
}
Label {
- text: "Text Align:"
+ text: i18nc("@label:listbox", "Text Align:")
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
}
ComboBox {
id: textAlignAllCmb;
- model: ["Left", "Start", "Center", "End", "Right", "Justified"]
+ model: [
+ {text: i18nc("@label:inlistbox", "Left")},
+ {text: i18nc("@label:inlistbox", "Start")},
+ {text: i18nc("@label:inlistbox", "Center")},
+ {text: i18nc("@label:inlistbox", "End")},
+ {text: i18nc("@label:inlistbox", "Right")},
+ {text: i18nc("@label:inlistbox", "Justified")}
+ ]
Layout.fillWidth: true
}
@@ -41,13 +48,16 @@ CollapsibleGroupProperty {
icon.source: "qrc:///light_view-refresh.svg"
}
Label {
- text: "Text Anchor:"
+ text: i18nc("@label:listbox", "Text Anchor:")
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
}
ComboBox {
id: textAnchorCmb;
- model: ["Start", "Middle", "End"]
+ model: [
+ {text: i18nc("@label:inlistbox", "Start")},
+ {text: i18nc("@label:inlistbox", "Middle")},
+ {text: i18nc("@label:inlistbox", "End")}]
Layout.fillWidth: true
}
diff --git a/plugins/dockers/textproperties/qml/TextDecoration.qml b/plugins/dockers/textproperties/qml/TextDecoration.qml
index ae26bae057..05f3524eb9 100644
--- a/plugins/dockers/textproperties/qml/TextDecoration.qml
+++ b/plugins/dockers/textproperties/qml/TextDecoration.qml
@@ -26,7 +26,7 @@ TextPropertyBase {
}
Label {
- text: "Text Decoration:"
+ text: i18nc("@title:group", "Text Decoration:")
Layout.columnSpan: 2;
}
@@ -36,7 +36,7 @@ TextPropertyBase {
height: 1;
}
Label {
- text: "Line:"
+ text: i18nc("@title:group", "Line:")
Layout.columnSpan: 2;
}
@@ -46,7 +46,7 @@ TextPropertyBase {
}
CheckBox {
Layout.columnSpan: 2;
- text: "Underline"
+ text: i18nc("@option:check", "Underline")
id: underlineCbx;
}
Item {
@@ -55,7 +55,7 @@ TextPropertyBase {
}
CheckBox {
Layout.columnSpan: 2;
- text: "Overline"
+ text: i18nc("@option:check", "Overline")
id: overlineCbx;
}
Item {
@@ -64,7 +64,7 @@ TextPropertyBase {
}
CheckBox {
Layout.columnSpan: 2;
- text: "Line-through"
+ text: i18nc("@option:check", "Line-through")
id: linethoughCbx;
}
@@ -75,7 +75,7 @@ TextPropertyBase {
}
CheckBox {
- text: "Color"
+ text: i18nc("@label:chooser", "Color")
id: colorCbx;
}
Rectangle {
@@ -89,11 +89,17 @@ TextPropertyBase {
height: 1;
}
Label {
- text: "Style:"
+ text: i18nc("@label:listbox", "Style:")
}
ComboBox {
- model: ["Solid", "Dotted", "Dashed", "Double", "Wavy"]
+ model: [
+ i18nc("@label:inlistbox", "Solid"),
+ i18nc("@label:inlistbox", "Dotted"),
+ i18nc("@label:inlistbox", "Dashed"),
+ i18nc("@label:inlistbox", "Double"),
+ i18nc("@label:inlistbox", "Wavy")
+ ]
Layout.fillWidth: true;
}
}
diff --git a/plugins/dockers/textproperties/qml/TextIndent.qml b/plugins/dockers/textproperties/qml/TextIndent.qml
index 9c1cc8abb9..58833d4657 100644
--- a/plugins/dockers/textproperties/qml/TextIndent.qml
+++ b/plugins/dockers/textproperties/qml/TextIndent.qml
@@ -8,7 +8,7 @@ import QtQuick.Controls 2.0
import QtQuick.Layouts 1.12
CollapsibleGroupProperty {
- propertyName: "Text Indent:";
+ propertyName: i18nc("@title:group", "Text Indent:");
titleItem: RowLayout {
spacing: columnSpacing;
@@ -38,7 +38,7 @@ CollapsibleGroupProperty {
CheckBox {
id: indentHangingCkb;
- text: "Hanging indentation"
+ text: i18nc("@option:check", "Hanging indentation")
Layout.fillWidth: true
}
@@ -50,7 +50,7 @@ CollapsibleGroupProperty {
CheckBox {
id: eachLineCkb;
- text: "Indent after hardbreaks"
+ text: i18nc("@option:check", "Indent after hardbreaks")
Layout.fillWidth: true
}
diff --git a/plugins/dockers/textproperties/qml/TextProperties.qml b/plugins/dockers/textproperties/qml/TextProperties.qml
index bc3c5e5c2c..47fdd6d699 100644
--- a/plugins/dockers/textproperties/qml/TextProperties.qml
+++ b/plugins/dockers/textproperties/qml/TextProperties.qml
@@ -26,10 +26,10 @@ Rectangle {
anchors.left: parent.left;
anchors.top: parent.top;
TabButton {
- text: "Character"
+ text: i18nc("@title:tab", "Character")
}
TabButton {
- text: "Paragraph"
+ text: i18nc("@title:tab", "Paragraph")
}
}
@@ -142,6 +142,8 @@ Rectangle {
}
Direction{
width: parent.width;
+ direction: textPropertiesModel.direction;
+ onDirectionChanged: textPropertiesModel.direction = direction;
}
TextIndent{
width: parent.width;
diff --git a/plugins/dockers/textproperties/qml/TextTransform.qml b/plugins/dockers/textproperties/qml/TextTransform.qml
index 467cb547a1..ed6a0ad000 100644
--- a/plugins/dockers/textproperties/qml/TextTransform.qml
+++ b/plugins/dockers/textproperties/qml/TextTransform.qml
@@ -26,7 +26,7 @@ TextPropertyBase {
}
Label {
- text: "Text Transform:"
+ text: i18nc("@title:group", "Text Transform:")
Layout.columnSpan: 2;
}
@@ -37,12 +37,17 @@ TextPropertyBase {
}
Label {
- text: "Case:"
+ text: i18nc("@label:listbox", "Case:")
}
ComboBox {
id: textTransformCaseCmb;
- model: ["None", "Capitalize", "UpperCase", "Lowercase"]
+ model: [
+ i18nc("@label:inlistbox", "None"),
+ i18nc("@label:inlistbox", "Capitalize"),
+ i18nc("@label:inlistbox", "UpperCase"),
+ i18nc("@label:inlistbox", "Lowercase")
+ ]
Layout.fillWidth: true
}
@@ -53,7 +58,7 @@ TextPropertyBase {
}
CheckBox {
id: fullWidthChk;
- text: "Full-width"
+ text: i18nc("@option:check", "Full-width")
Layout.fillWidth: true;
}
@@ -64,7 +69,7 @@ TextPropertyBase {
}
CheckBox {
id: fullSizeKanaChk;
- text: "Full-size Kana"
+ text: i18nc("@option:check", "Full-size Kana")
Layout.fillWidth: true;
}
}
diff --git a/plugins/dockers/textproperties/qml/UnderlinePosition.qml b/plugins/dockers/textproperties/qml/UnderlinePosition.qml
index 0e0327497c..db45ff0306 100644
--- a/plugins/dockers/textproperties/qml/UnderlinePosition.qml
+++ b/plugins/dockers/textproperties/qml/UnderlinePosition.qml
@@ -26,7 +26,7 @@ TextPropertyBase {
}
Label {
- text: "Underline Position:"
+ text: i18nc("@label:listbox", "Underline Position:")
}
@@ -35,7 +35,10 @@ TextPropertyBase {
height: 1;
}
ComboBox {
- model: ["Vertical Left", "Vertical Right"]
+ model: [
+ i18nc("@label:inlistbox", "Vertical Left"),
+ i18nc("@label:inlistbox", "Vertical Right")
+ ]
Layout.fillWidth: true;
id: verticalPositionCmb;
}
@@ -45,7 +48,7 @@ TextPropertyBase {
height: 1;
}
CheckBox {
- text: "Horizontal Auto";
+ text: i18nc("@option:check", "Horizontal Auto");
}
}
}
diff --git a/plugins/dockers/textproperties/qml/WhiteSpace.qml b/plugins/dockers/textproperties/qml/WhiteSpace.qml
index 6b8e69e953..c53b801ed9 100644
--- a/plugins/dockers/textproperties/qml/WhiteSpace.qml
+++ b/plugins/dockers/textproperties/qml/WhiteSpace.qml
@@ -25,13 +25,20 @@ TextPropertyBase {
}
Label {
- text: "White Space:"
+ text: i18nc("@label:listbox", "White Space:")
}
ComboBox {
id: wordBreakCmb
- model: ["Normal", "Pre", "No Wrap", "Pre Wrap", "Break Spaces", "Pre Line"]
+ model: [
+ i18nc("@label:inlistbox", "Normal"),
+ i18nc("@label:inlistbox", "Pre"),
+ i18nc("@label:inlistbox", "No Wrap"),
+ i18nc("@label:inlistbox", "Pre Wrap"),
+ i18nc("@label:inlistbox", "Break Spaces"),
+ i18nc("@label:inlistbox", "Pre Line")
+ ]
Layout.fillWidth: true;
}
}
diff --git a/plugins/dockers/textproperties/qml/WordBreak.qml b/plugins/dockers/textproperties/qml/WordBreak.qml
index 3cebb8935a..f3847e7346 100644
--- a/plugins/dockers/textproperties/qml/WordBreak.qml
+++ b/plugins/dockers/textproperties/qml/WordBreak.qml
@@ -25,13 +25,17 @@ TextPropertyBase {
}
Label {
- text: "Word Break:"
+ text: i18nc("@label:listbox", "Word Break:")
}
ComboBox {
id: wordBreakCmb
- model: ["Normal", "Keep-all", "Break-all"]
+ model: [
+ i18nc("@label:inlistbox", "Normal"),
+ i18nc("@label:inlistbox", "Keep-all"),
+ i18nc("@label:inlistbox", "Break-all")
+ ]
Layout.fillWidth: true;
}
}
diff --git a/plugins/dockers/textproperties/qml/WordSpacing.qml b/plugins/dockers/textproperties/qml/WordSpacing.qml
index 01b59f59c6..f884cc96fb 100644
--- a/plugins/dockers/textproperties/qml/WordSpacing.qml
+++ b/plugins/dockers/textproperties/qml/WordSpacing.qml
@@ -25,7 +25,7 @@ TextPropertyBase {
}
Label {
- text: "Word Spacing:"
+ text: i18nc("@title:group", "Word Spacing:")
}
SpinBox {
diff --git a/plugins/dockers/textproperties/qml/WritingMode.qml b/plugins/dockers/textproperties/qml/WritingMode.qml
index 734b5ab569..e6e811d631 100644
--- a/plugins/dockers/textproperties/qml/WritingMode.qml
+++ b/plugins/dockers/textproperties/qml/WritingMode.qml
@@ -8,7 +8,8 @@ import QtQuick.Controls 2.0
import QtQuick.Layouts 1.12
TextPropertyBase {
- property alias writingMode: writingModeCmb.currentIndex;
+ property int writingMode;
+ onWritingModeChanged: writingModeCmb.currentIndex = writingModeCmb.indexOfValue(writingMode);
RowLayout {
spacing: columnSpacing;
@@ -27,14 +28,21 @@ TextPropertyBase {
}
Label {
- text: "Writing Mode:"
+ text: i18nc("@label:listbox", "Writing Mode:")
}
ComboBox {
id: writingModeCmb
- model: ["Horizontal", "Vertical, Right to Left", "Vertical, Left To Right"]
+ model: [
+ {text: i18nc("@label:inlistbox", "Horizontal"), value: 0},
+ {text: i18nc("@label:inlistbox", "Vertical, Right to Left"), value: 1},
+ {text: i18nc("@label:inlistbox", "Vertical, Left To Right"), value: 2}
+ ]
Layout.fillWidth: true;
+ textRole: "text";
+ valueRole: "value";
+ onActivated: writingMode = currentValue;
}
}
}