aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikko Syrjä <mikko@3d-system.fi>2019-03-02 00:17:15 +0200
committerMikko Syrjä <mikko@3d-system.fi>2019-03-02 00:17:15 +0200
commit69b949c33bcaa3176aac37c99146900124798b79 (patch)
treef0cc9d4957579798d8db50fa05b7f07f4c746c19
parenta00e1b93ae146d94124c1a865c026857147b4fe7 (diff)
downloadsymedit-69b949c33bcaa3176aac37c99146900124798b79.tar.gz
symedit-69b949c33bcaa3176aac37c99146900124798b79.zip
Initial localization support.
-rw-r--r--.editorconfig2
-rw-r--r--Editor.qml31
-rw-r--r--ToolTip.qml2
-rw-r--r--TooltipCreator.js2
-rw-r--r--locale/symedit.en_GB.ts295
-rw-r--r--locale/symedit.fi_FI.ts295
-rw-r--r--locale/symedit.ts295
-rwxr-xr-xlrelease.sh5
-rwxr-xr-xlupdate.sh6
-rw-r--r--main.qml164
-rw-r--r--symedit.cpp6
-rw-r--r--symedit.h5
-rw-r--r--symedit.pro13
-rw-r--r--translations.qrc6
14 files changed, 1028 insertions, 99 deletions
diff --git a/.editorconfig b/.editorconfig
index a8cac73..49fac42 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -3,7 +3,7 @@ root = true
end_of_line = lf
insert_final_newline = true
-[*.{cpp,h,qml,js,md,pro}]
+[*.{cpp,h,qml,js,md,pro,sh}]
charset = utf-8
indent_style = tab
indent_size = 4
diff --git a/Editor.qml b/Editor.qml
index c33f89f..652ec0d 100644
--- a/Editor.qml
+++ b/Editor.qml
@@ -32,6 +32,11 @@ Rectangle
property int endx: 0
property int endy: 0
+ property string paintcolor: "black"
+ property string editcolor: "red"
+ property string gridcolor: "gray"
+ property string backcolor: "white"
+
anchors.fill: parent
MouseArea
@@ -161,7 +166,7 @@ Rectangle
size.width * scalexy, size.height * scalexy)
if ( fill )
{
- context.fillStyle = (fill === 2 ? "black" : "white")
+ context.fillStyle = (fill === 2 ? paintcolor : backcolor)
context.fill()
}
else
@@ -174,7 +179,7 @@ Rectangle
(max - center.y - radius + offset) * scalexy, radius * 2 * scalexy, radius * 2 * scalexy)
if ( fill )
{
- context.fillStyle = (fill === 2 ? "black" : "white")
+ context.fillStyle = (fill === 2 ? paintcolor : backcolor)
context.fill()
}
else
@@ -202,8 +207,8 @@ Rectangle
function painttext(context, string, point, active)
{
- context.lineWidth = textsize * zoomscale / 2
- var fontsize = 20 * textsize * zoomscale
+ context.lineWidth = (preview ? 1 : textsize * zoomscale / 2)
+ var fontsize = 20 * textsize * (preview ? 0.1 : zoomscale)
context.font = fontsize.toString() + "px sans-serif"
var position = Qt.point((point.x + max + offset) * scalexy, (max - point.y + offset) * scalexy)
context.fillText(string, position.x, position.y)
@@ -211,10 +216,10 @@ Rectangle
if ( !preview )
{
if ( active )
- context.fillStyle = "red"
+ context.fillStyle = editcolor
context.beginPath().ellipse(position.x - 5, position.y - 5, 10, 10).fill()
if ( active )
- context.fillStyle = "black"
+ context.fillStyle = paintcolor
}
context.lineWidth = linewidth
}
@@ -222,8 +227,8 @@ Rectangle
function paintgrid(context)
{
context.lineWidth = 0.2
- context.strokeStyle = "gray"
- context.fillStyle = "white"
+ context.strokeStyle = gridcolor
+ context.fillStyle = backcolor
paintrect(context, Qt.point(-max - offset, max + offset), Qt.size(total, total), true)
@@ -252,7 +257,7 @@ Rectangle
for ( index = 0; index < count; index++ )
{
if ( !preview )
- context.strokeStyle = (index === active ? "red" : "black")
+ context.strokeStyle = (index === active ? editcolor : paintcolor)
var operation = manager.getItemOperation(index)
var point, position = manager.getItemPosition(index)
@@ -292,15 +297,15 @@ Rectangle
paintgrid(context)
- context.strokeStyle = "black"
- context.fillStyle = "black"
+ context.strokeStyle = paintcolor
+ context.fillStyle = paintcolor
paintsymbol(context)
if ( down )
{
- context.strokeStyle = "red"
-// context.fillStyle = "red"
+ context.strokeStyle = editcolor
+// context.fillStyle = editcolor
var cornerx = (mousex < startx ? mousex : startx)
var cornery = (mousey > starty ? mousey : starty)
diff --git a/ToolTip.qml b/ToolTip.qml
index 94be0a5..b00e1f1 100644
--- a/ToolTip.qml
+++ b/ToolTip.qml
@@ -1,3 +1,5 @@
+// original code from https://wiki.qt.io/QtQuick_ToolTip_Component
+
import QtQuick 2.2
Rectangle
diff --git a/TooltipCreator.js b/TooltipCreator.js
index 6b21b13..a142fde 100644
--- a/TooltipCreator.js
+++ b/TooltipCreator.js
@@ -1,3 +1,5 @@
+// original code from https://wiki.qt.io/QtQuick_ToolTip_Component
+
var component = Qt.createComponent("ToolTip.qml");
function create(text, parent, properties)
diff --git a/locale/symedit.en_GB.ts b/locale/symedit.en_GB.ts
new file mode 100644
index 0000000..8f92358
--- /dev/null
+++ b/locale/symedit.en_GB.ts
@@ -0,0 +1,295 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="en_GB">
+<context>
+ <name></name>
+ <message id="Symbol editor">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_file">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_file_open">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_file_save">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_file_exit">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_undo">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_redo">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_cut">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_copy">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_paste">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_rotate_right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_rotate_left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_raise_item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_lower_item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_delete_item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view_zoom_in">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view_zoom_out">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view_zoom_all">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view_grid">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view_preview">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_tool">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Select">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Line">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Rectangle Corner">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Rectangle Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Circle Corner">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Circle Radius">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Circle Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Semicircle">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Quarter circle">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Text">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Help">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="About">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Undo Edit">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Redo Edit">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Cut Symbol">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Copy Symbol">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Paste symbol">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Rotate right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Rotate left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Raise item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Lower item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Delete item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Preview">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Select item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Straight Line">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Rectangle Corners">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Text String">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Snap">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Fill">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="0 No fill">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="1 Backgroud">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="2 Area fill">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Line width">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Text size">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Alignment">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="1 Top Right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="2 Top Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="3 Top Left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="4 Base Right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="5 Base Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="6 Base Left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="7 Bottom Right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="8 Bottom Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="9 Bottom Left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="10 Middle Right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="11 Middle Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="12 Middle Left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id-toolbar-text">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id-help-about-text">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/locale/symedit.fi_FI.ts b/locale/symedit.fi_FI.ts
new file mode 100644
index 0000000..fca4a94
--- /dev/null
+++ b/locale/symedit.fi_FI.ts
@@ -0,0 +1,295 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="fi_FI">
+<context>
+ <name></name>
+ <message id="Symbol editor">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_file">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_file_open">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_file_save">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_file_exit">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_undo">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_redo">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_cut">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_copy">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_paste">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_rotate_right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_rotate_left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_raise_item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_lower_item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_delete_item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view_zoom_in">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view_zoom_out">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view_zoom_all">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view_grid">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view_preview">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_tool">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Select">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Line">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Rectangle Corner">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Rectangle Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Circle Corner">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Circle Radius">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Circle Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Semicircle">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Quarter circle">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Text">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Help">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="About">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Undo Edit">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Redo Edit">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Cut Symbol">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Copy Symbol">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Paste symbol">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Rotate right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Rotate left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Raise item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Lower item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Delete item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Preview">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Select item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Straight Line">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Rectangle Corners">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Text String">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Snap">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Fill">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="0 No fill">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="1 Backgroud">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="2 Area fill">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Line width">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Text size">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Alignment">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="1 Top Right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="2 Top Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="3 Top Left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="4 Base Right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="5 Base Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="6 Base Left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="7 Bottom Right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="8 Bottom Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="9 Bottom Left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="10 Middle Right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="11 Middle Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="12 Middle Left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id-toolbar-text">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id-help-about-text">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/locale/symedit.ts b/locale/symedit.ts
new file mode 100644
index 0000000..a5e4e8c
--- /dev/null
+++ b/locale/symedit.ts
@@ -0,0 +1,295 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1">
+<context>
+ <name></name>
+ <message id="Symbol editor">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Preview">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Select">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Line">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Rectangle Corner">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Rectangle Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Circle Corner">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Circle Radius">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Circle Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Semicircle">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Quarter circle">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Text">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Help">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="About">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Undo Edit">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Redo Edit">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Cut Symbol">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Copy Symbol">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Paste symbol">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Rotate right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Rotate left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Raise item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Lower item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Delete item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Select item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Straight Line">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Rectangle Corners">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Text String">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Snap">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Fill">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="0 No fill">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="1 Backgroud">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="2 Area fill">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Line width">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Text size">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="Alignment">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="1 Top Right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="2 Top Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="3 Top Left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="4 Base Right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="5 Base Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="6 Base Left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="7 Bottom Right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="8 Bottom Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="9 Bottom Left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="10 Middle Right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="11 Middle Center">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="12 Middle Left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id-toolbar-text">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id-help-about-text">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_file">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_file_open">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_file_save">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_file_exit">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_undo">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_redo">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_cut">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_copy">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_paste">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_rotate_right">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_rotate_left">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_raise_item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_lower_item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_edit_delete_item">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view_zoom_in">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view_zoom_out">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view_zoom_all">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view_grid">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_view_preview">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message id="id_menu_tool">
+ <source></source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/lrelease.sh b/lrelease.sh
new file mode 100755
index 0000000..1659f58
--- /dev/null
+++ b/lrelease.sh
@@ -0,0 +1,5 @@
+/home/mikko/Code/Qt5.12.1/5.12.1/gcc_64/bin/lrelease -idbased locale/symedit.*.ts
+
+# if [ $? -ne 0 ]; then
+# lrelease-qt5 -idbased locale/mobile.*.ts
+# fi
diff --git a/lupdate.sh b/lupdate.sh
new file mode 100755
index 0000000..50f821f
--- /dev/null
+++ b/lupdate.sh
@@ -0,0 +1,6 @@
+/home/mikko/Code/Qt5.12.1/5.12.1/gcc_64/bin/lupdate -locations none . -ts locale/symedit.ts locale/symedit.en_GB.ts locale/symedit.fi_FI.ts
+
+# lupdate -locations none qml -ts locale/mobile.ts
+# if [ $? -ne 0 ]; then
+# lupdate-qt5 -locations none qml -ts locale/mobile.ts
+# fi
diff --git a/main.qml b/main.qml
index 96a4188..e2e8aea 100644
--- a/main.qml
+++ b/main.qml
@@ -26,82 +26,82 @@ ApplicationWindow
id: window
visible: false
- title: qsTr("Symbol editor") //%%
+ title: qsTrId("Symbol editor")
menuBar: MenuBar
{
Menu
{
- title: qsTr("File") //%%
- MenuItem { text: qsTr("Open"); shortcut: "Ctrl+O"; onTriggered: open() } //%%
- MenuItem { text: qsTr("Save"); shortcut: "Ctrl+S"; onTriggered: save() } //%%
+ title: qsTrId("id_menu_file")
+ MenuItem { text: qsTrId("id_menu_file_open"); shortcut: "Ctrl+O"; onTriggered: open() }
+ MenuItem { text: qsTrId("id_menu_file_save"); shortcut: "Ctrl+S"; onTriggered: save() }
MenuSeparator { }
- MenuItem { text: qsTr("Exit"); shortcut: "F4"; onTriggered: Qt.quit() } //%%
+ MenuItem { text: qsTrId("id_menu_file_exit"); shortcut: "F4"; onTriggered: Qt.quit() }
}
Menu
{
- title: qsTr("Edit") //%%
- MenuItem { text: qsTr("Undo"); shortcut: "Ctrl+Z"; onTriggered: undo(true) } //%%
- MenuItem { text: qsTr("Redo"); shortcut: "Ctrl+Y"; onTriggered: undo(false) } //%%
-// MenuItem { text: qsTr("Redo"); shortcut: "Ctrl+Y,Ctrl+Shift+Z"; onTriggered: undo(false) } //%%
+ title: qsTrId("id_menu_edit")
+ MenuItem { text: qsTrId("id_menu_edit_undo"); shortcut: "Ctrl+Z"; onTriggered: undo(true) }
+ MenuItem { text: qsTrId("id_menu_edit_redo"); shortcut: "Ctrl+Y"; onTriggered: undo(false) }
+// MenuItem { text: qsTrId("id_menu_edit_redo"); shortcut: "Ctrl+Y,Ctrl+Shift+Z"; onTriggered: undo(false) }
MenuSeparator { }
- MenuItem { text: qsTr("Cut"); shortcut: "Ctrl+X"; onTriggered: cutsymbol() } //%%
- MenuItem { text: qsTr("Copy"); shortcut: "Ctrl+C"; onTriggered: copysymbol() } //%%
- MenuItem { text: qsTr("Paste"); shortcut: "Ctrl+V"; onTriggered: pastesymbol() } //%%
+ MenuItem { text: qsTrId("id_menu_edit_cut"); shortcut: "Ctrl+X"; onTriggered: cutsymbol() }
+ MenuItem { text: qsTrId("id_menu_edit_copy"); shortcut: "Ctrl+C"; onTriggered: copysymbol() }
+ MenuItem { text: qsTrId("id_menu_edit_paste"); shortcut: "Ctrl+V"; onTriggered: pastesymbol() }
MenuSeparator { }
- MenuItem { text: qsTr("Rotate Right"); shortcut: "Alt+Right"; onTriggered: rotatesymbol(1) } //%%
- MenuItem { text: qsTr("Rotate Left"); shortcut: "Alt+Left"; onTriggered: rotatesymbol(-1) } //%%
+ MenuItem { text: qsTrId("id_menu_edit_rotate_right"); shortcut: "Alt+Right"; onTriggered: rotatesymbol(1) }
+ MenuItem { text: qsTrId("id_menu_edit_rotate_left"); shortcut: "Alt+Left"; onTriggered: rotatesymbol(-1) }
MenuSeparator { }
- MenuItem { text: qsTr("Raise Item"); shortcut: "Alt+Up"; onTriggered: raiseitem(1) } //%%
- MenuItem { text: qsTr("Lower Item"); shortcut: "Alt+Down"; onTriggered: raiseitem(-1) } //%%
+ MenuItem { text: qsTrId("id_menu_edit_raise_item"); shortcut: "Alt+Up"; onTriggered: raiseitem(1) }
+ MenuItem { text: qsTrId("id_menu_edit_lower_item"); shortcut: "Alt+Down"; onTriggered: raiseitem(-1) }
MenuSeparator { }
- MenuItem { text: qsTr("Delete"); shortcut: "Delete"; onTriggered: removeitem() } //%%
+ MenuItem { text: qsTrId("id_menu_edit_delete_item"); shortcut: "Delete"; onTriggered: removeitem() }
}
Menu
{
- title: qsTr("View") //%%
- MenuItem { text: qsTr("Zoom In"); shortcut: "Ctrl++"; onTriggered: zoom(1) } //%%
- MenuItem { text: qsTr("Zoom Out"); shortcut: "Ctrl+-"; onTriggered: zoom(-1) } //%%
- MenuItem { text: qsTr("Zoom All"); shortcut: "Ctrl+0"; onTriggered: zoom(0) } //%%
+ title: qsTrId("id_menu_view")
+ MenuItem { text: qsTrId("id_menu_view_zoom_in"); shortcut: "Ctrl++"; onTriggered: zoom(1) }
+ MenuItem { text: qsTrId("id_menu_view_zoom_out"); shortcut: "Ctrl+-"; onTriggered: zoom(-1) }
+ MenuItem { text: qsTrId("id_menu_view_zoom_all"); shortcut: "Ctrl+0"; onTriggered: zoom(0) }
MenuSeparator { }
MenuItem
{
- text: qsTr("Grid"); shortcut: "Ctrl+G" //%%
+ text: qsTrId("id_menu_view_grid"); shortcut: "Ctrl+G"
checkable : true; checked: viewgrid
onTriggered: grid()
}
MenuItem
{
- text: qsTr("Preview"); shortcut: "Ctrl+P" //%%
+ text: qsTrId("id_menu_view_preview"); shortcut: "Ctrl+P"
checkable : true; checked: preview
onTriggered: previewsymbol()
}
}
Menu
{
- title: qsTr("Tool") //%%
- MenuTool { text: qsTr("Select"); tool: Editor.Tool.Select } //%%
+ title: qsTrId("id_menu_tool")
+ MenuTool { text: qsTrId("Select"); tool: Editor.Tool.Select }
MenuSeparator { }
- MenuTool { text: qsTr("Line"); tool: Editor.Tool.Line } //%%
+ MenuTool { text: qsTrId("Line"); tool: Editor.Tool.Line }
MenuSeparator { }
- MenuTool { text: qsTr("Rectangle Corner"); tool: Editor.Tool.RectCorner } //%%
- MenuTool { text: qsTr("Rectangle Center"); tool: Editor.Tool.RectCenter } //%%
+ MenuTool { text: qsTrId("Rectangle Corner"); tool: Editor.Tool.RectCorner }
+ MenuTool { text: qsTrId("Rectangle Center"); tool: Editor.Tool.RectCenter }
MenuSeparator { }
- MenuTool { text: qsTr("Circle Corner"); tool: Editor.Tool.CircleCorner } //%%
- MenuTool { text: qsTr("Circle Radius"); tool: Editor.Tool.CircleRadius } //%%
- MenuTool { text: qsTr("Circle Center"); tool: Editor.Tool.CircleCenter } //%%
+ MenuTool { text: qsTrId("Circle Corner"); tool: Editor.Tool.CircleCorner }
+ MenuTool { text: qsTrId("Circle Radius"); tool: Editor.Tool.CircleRadius }
+ MenuTool { text: qsTrId("Circle Center"); tool: Editor.Tool.CircleCenter }
MenuSeparator { }
- MenuTool { text: qsTr("Semicircle"); tool: Editor.Tool.ArcSemi } //%%
- MenuTool { text: qsTr("Quarter circle"); tool: Editor.Tool.ArcQuarter } //%%
+ MenuTool { text: qsTrId("Semicircle"); tool: Editor.Tool.ArcSemi }
+ MenuTool { text: qsTrId("Quarter circle"); tool: Editor.Tool.ArcQuarter }
MenuSeparator { }
- MenuTool { text: qsTr("Text"); tool: Editor.Tool.Text } //%%
+ MenuTool { text: qsTrId("Text"); tool: Editor.Tool.Text }
}
Menu
{
- title: qsTr("Help") //%%
- MenuItem { text: qsTr("Help"); shortcut: "F1"; onTriggered: help() } //%%
+ title: qsTrId("Help")
+ MenuItem { text: qsTrId("Help"); shortcut: "F1"; onTriggered: help() }
MenuSeparator { }
- MenuItem { text: qsTr("About"); onTriggered: aboutDialog.open() } //%%
+ MenuItem { text: qsTrId("About"); onTriggered: aboutDialog.open() }
}
}
@@ -113,42 +113,42 @@ ApplicationWindow
{
height: 30
z: 10
-// BarTool { image: "image/open_icon&48.png"; tooltip: "Open File"; onClicked: open() } //%%
-// BarTool { image: "image/save_icon&48.png"; tooltip: "Save File"; onClicked: save() } //%%
+// BarTool { image: "image/open_icon&48.png"; tooltip: qsTrId("Open File"); onClicked: open() }
+// BarTool { image: "image/save_icon&48.png"; tooltip: qsTrId("Save File"); onClicked: save() }
// BarSeparator { }
- BarTool { image: "image/undo_icon&48.png"; tooltip: "Undo Edit"; onClicked: undo(true) } //%%
- BarTool { image: "image/redo_icon&48.png"; tooltip: "Redo Edit"; onClicked: undo(false) } //%%
- BarTool { image: "image/cut_icon&48.png"; tooltip: "Cut Symbol"; onClicked: cutsymbol() } //%%
- BarTool { image: "image/copy_icon&48.png"; tooltip: "Copy Symbol"; onClicked: copysymbol() } //%%
- BarTool { image: "image/paste_icon&48.png"; tooltip: "Paste symbol"; onClicked: pastesymbol() } //%%
+ BarTool { image: "image/undo_icon&48.png"; tooltip: qsTrId("Undo Edit"); onClicked: undo(true) }
+ BarTool { image: "image/redo_icon&48.png"; tooltip: qsTrId("Redo Edit"); onClicked: undo(false) }
+ BarTool { image: "image/cut_icon&48.png"; tooltip: qsTrId("Cut Symbol"); onClicked: cutsymbol() }
+ BarTool { image: "image/copy_icon&48.png"; tooltip: qsTrId("Copy Symbol"); onClicked: copysymbol() }
+ BarTool { image: "image/paste_icon&48.png"; tooltip: qsTrId("Paste symbol"); onClicked: pastesymbol() }
BarSeparator { }
- BarTool { image: "image/rotate_right.png"; tooltip: "Rotate right"; onClicked: rotatesymbol(1) } //%%
- BarTool { image: "image/rotate_left.png"; tooltip: "Rotate left"; onClicked: rotatesymbol(-1) } //%%
- BarTool { image: "image/up_icon&48.png"; tooltip: "Raise item"; onClicked: raiseitem(1) } //%%
- BarTool { image: "image/down_icon&48.png"; tooltip: "Lower item"; onClicked: raiseitem(-1) } //%%
- BarTool { image: "image/delete.png"; tooltip: "Delete item"; onClicked: removeitem() } //%%
+ BarTool { image: "image/rotate_right.png"; tooltip: qsTrId("Rotate right"); onClicked: rotatesymbol(1) }
+ BarTool { image: "image/rotate_left.png"; tooltip: qsTrId("Rotate left"); onClicked: rotatesymbol(-1) }
+ BarTool { image: "image/up_icon&48.png"; tooltip: qsTrId("Raise item"); onClicked: raiseitem(1) }
+ BarTool { image: "image/down_icon&48.png"; tooltip: qsTrId("Lower item"); onClicked: raiseitem(-1) }
+ BarTool { image: "image/delete.png"; tooltip: qsTrId("Delete item"); onClicked: removeitem() }
BarSeparator { }
-// BarTool { image: "image/plus_icon&48.png"; tooltip: "Zoom in"; onClicked: zoom(1) } //%%
-// BarTool { image: "image/minus_icon&48.png"; tooltip: "Zoom out"; onClicked: zoom(-1) } //%%
- BarTool { image: "image/eye_icon&48.png"; tooltip: "Preview"; onClicked: previewsymbol() } //%%
+// BarTool { image: "image/plus_icon&48.png"; tooltip: qsTrId("Zoom in"); onClicked: zoom(1) }
+// BarTool { image: "image/minus_icon&48.png"; tooltip: qsTrId("Zoom out"); onClicked: zoom(-1) }
+ BarTool { image: "image/eye_icon&48.png"; tooltip: qsTrId("Preview"); onClicked: previewsymbol() }
BarSeparator { }
- BarTool { image: "image/cursor_icon&48.png"; tooltip: "Select item"; tool: Editor.Tool.Select } //%%
+ BarTool { image: "image/cursor_icon&48.png"; tooltip: qsTrId("Select item"); tool: Editor.Tool.Select }
BarSeparator { }
- BarTool { image: "image/polyline.png"; tooltip: "Straight Line"; tool: Editor.Tool.Line } //%%
+ BarTool { image: "image/polyline.png"; tooltip: qsTrId("Straight Line"); tool: Editor.Tool.Line }
BarSeparator { }
- BarTool { image: "image/rectangle_corner.png"; tooltip: "Rectangle Corners"; tool: Editor.Tool.RectCorner } //%%
- BarTool { image: "image/rectangle_center.png"; tooltip: "Rectangle Center"; tool: Editor.Tool.RectCenter } //%%
+ BarTool { image: "image/rectangle_corner.png"; tooltip: qsTrId("Rectangle Corners"); tool: Editor.Tool.RectCorner }
+ BarTool { image: "image/rectangle_center.png"; tooltip: qsTrId("Rectangle Center"); tool: Editor.Tool.RectCenter }
BarSeparator { }
- BarTool { image: "image/circle_corner.png"; tooltip: "Circle Corner"; tool: Editor.Tool.CircleCorner } //%%
- BarTool { image: "image/circle_radius.png"; tooltip: "Circle Radius"; tool: Editor.Tool.CircleRadius } //%%
- BarTool { image: "image/circle_center.png"; tooltip: "Circle Center"; tool: Editor.Tool.CircleCenter } //%%
+ BarTool { image: "image/circle_corner.png"; tooltip: qsTrId("Circle Corner"); tool: Editor.Tool.CircleCorner }
+ BarTool { image: "image/circle_radius.png"; tooltip: qsTrId("Circle Radius"); tool: Editor.Tool.CircleRadius }
+ BarTool { image: "image/circle_center.png"; tooltip: qsTrId("Circle Center"); tool: Editor.Tool.CircleCenter }
BarSeparator { }
- BarTool { image: "image/text.png"; tooltip: "Text String"; tool: Editor.Tool.Text } //%%
+ BarTool { image: "image/text.png"; tooltip: qsTrId("Text String"); tool: Editor.Tool.Text }
}
RowLayout
{
height: 32
- Label { text: qsTr("Snap") } //%%
+ Label { text: qsTrId("Snap") }
ComboBox
{
id: snaplist
@@ -169,17 +169,17 @@ ApplicationWindow
}
BarSeparator { }
Item { Layout.fillWidth: true }
- Label { text: qsTr("Fill") } //%%
+ Label { text: qsTrId("Fill") }
ComboBox
{
id: filllist
implicitWidth: 50
- model: [ "0 No fill", "1 Backgroud", "2 Area fill" ] //%%
+ model: [ qsTrId("0 No fill"), qsTrId("1 Backgroud"), qsTrId("2 Area fill") ]
onCurrentIndexChanged: { fillitem = currentIndex; editor.update() }
function setFill() { currentIndex = fillitem }
}
BarSeparator { }
- Label { text: qsTr("Line width") } //%%
+ Label { text: qsTrId("Line width") }
ComboBox
{
id: widthlist
@@ -189,7 +189,7 @@ ApplicationWindow
function setWidth() { currentIndex = linewidth - 1 }
}
BarSeparator { }
- Label { text: qsTr("Text size") } //%%
+ Label { text: qsTrId("Text size") }
ComboBox
{
id: sizelist
@@ -199,31 +199,31 @@ ApplicationWindow
function setSize() { currentIndex = textsize - 1 }
}
BarSeparator { }
- Label { text: qsTr("Alignment") } //%%
+ Label { text: qsTrId("Alignment") }
ComboBox
{
id: alignlist
implicitWidth: 50
model:
[
- "1 Top Right", //%%
- "2 Top Center", //%%
- "3 Top Left", //%%
- "4 Base Right", //%%
- "5 Base Center", //%%
- "6 Base Left", //%%
- "7 Bottom Right", //%%
- "8 Bottom Center", //%%
- "9 Bottom Left", //%%
- "10 Middle Right", //%%
- "11 Middle Center", //%%
- "12 Middle Left" //%%
+ qsTrId("1 Top Right"),
+ qsTrId("2 Top Center"),
+ qsTrId("3 Top Left"),
+ qsTrId("4 Base Right"),
+ qsTrId("5 Base Center"),
+ qsTrId("6 Base Left"),
+ qsTrId("7 Bottom Right"),
+ qsTrId("8 Bottom Center"),
+ qsTrId("9 Bottom Left"),
+ qsTrId("10 Middle Right"),
+ qsTrId("11 Middle Center"),
+ qsTrId("12 Middle Left")
]
onCurrentIndexChanged: { alignment = currentIndex + 1 }
function setAlign() { currentIndex = alignment - 1 }
}
BarSeparator { }
- Label { text: qsTr("Text") } //%%
+ Label { text: qsTrId("id-toolbar-text") }
TextField
{
id: textfield
@@ -250,11 +250,11 @@ ApplicationWindow
Dialog
{
id: aboutDialog
- title: qsTr("About")
+ title: qsTrId("About")
Label
{
anchors.fill: parent
- text: qsTr("Symbol Editor for 3D-Win\n\nhttp://www.3d-system.fi\n") //%%
+ text: qsTrId("id-help-about-text")
horizontalAlignment: Text.AlignHCenter
}
@@ -317,7 +317,7 @@ ApplicationWindow
{
if ( dir === 0 ) // all
zoomscale = 1.0
- else if ( dir > 0 ) // in
+ else if ( dir > 0 ) // in
{
if ( (zoomscale *= zoomstep) > 1.0 )
zoomscale = 1.0
diff --git a/symedit.cpp b/symedit.cpp
index 06db2ce..200c14d 100644
--- a/symedit.cpp
+++ b/symedit.cpp
@@ -71,6 +71,12 @@ SymEditManager::SymEditManager(QObject* parent) : QObject(parent)
{
Settings.Load();
+ QLocale locale;
+ if ( BackupTranslator.load(":/locale/symedit.en_GB.qm") )
+ QGuiApplication::installTranslator(&BackupTranslator);
+ if ( LocaleTranslator.load(locale, ":/locale/symedit.") )
+ QGuiApplication::installTranslator(&LocaleTranslator);
+
Symbol.Load("U00,00;R50;U-35,-35;D35,35;U-35,35;D35,-35;"); //##
}
diff --git a/symedit.h b/symedit.h
index 3d9c6ab..c4da15d 100644
--- a/symedit.h
+++ b/symedit.h
@@ -5,6 +5,7 @@
#include <QString>
#include <QPoint>
#include <QSize>
+#include <QTranslator>
#include <deque>
@@ -89,6 +90,8 @@ private:
std::deque<QString> UndoStack; //!< Undo stack.
std::deque<QString> RedoStack; //!< Redo stack.
-};
+ QTranslator BackupTranslator; //!< UI backup translator.
+ QTranslator LocaleTranslator; //!< UI locale translator.
+};
#endif
diff --git a/symedit.pro b/symedit.pro
index e86d271..3514ea3 100644
--- a/symedit.pro
+++ b/symedit.pro
@@ -17,7 +17,9 @@ SOURCES += main.cpp \
symbol.cpp
RESOURCES += \
- qml.qrc
+ qml.qrc \
+ translations.qrc \
+ translations.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
@@ -45,4 +47,11 @@ DISTFILES += \
image/rectangle_corner.kra \
image/rotate_left.kra \
image/rotate_right.kra \
- image/text.kra
+ image/text.kra \
+ .editorconfig \
+ lrelease.sh \
+ lupdate.sh \
+ locale/symedit.ts \
+ locale/symedit.fi_FI.ts \
+ locale/symedit.en_GB.ts \
+ .gitignore
diff --git a/translations.qrc b/translations.qrc
new file mode 100644
index 0000000..cdbabdf
--- /dev/null
+++ b/translations.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/">
+ <file>locale/symedit.fi_FI.qm</file>
+ <file>locale/symedit.en_GB.qm</file>
+ </qresource>
+</RCC>