Skip to content

Commit

Permalink
Merge pull request #80 from Brigggi/German_translation
Browse files Browse the repository at this point in the history
Add german translation
  • Loading branch information
nicogodet authored Mar 28, 2023
2 parents 43e4790 + 8cde79c commit ac194f3
Show file tree
Hide file tree
Showing 5 changed files with 271 additions and 5 deletions.
8 changes: 8 additions & 0 deletions i18n/profiletool.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FORMS = ../ui/profiletool.ui \
../ui/about.ui

SOURCES = ../profileplugin.py \
../ui/ptdockwidget.py \
../ui/dlgabout.py

TRANSLATIONS = profiletool_de.ts
Binary file added i18n/profiletool_de.qm
Binary file not shown.
243 changes: 243 additions & 0 deletions i18n/profiletool_de.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de">
<context>
<name>DlgAbout</name>
<message>
<location filename="../ui/about.ui" line="14"/>
<source>Dialog</source>
<translation>Dialog</translation>
</message>
<message>
<location filename="../ui/about.ui" line="34"/>
<source>Profile Tool</source>
<translation>Profil Werkzeug</translation>
</message>
<message>
<location filename="../ui/about.ui" line="52"/>
<source>$PLUGIN_DESCRIPTION$</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ui/about.ui" line="98"/>
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;DejaVu Sans&apos;; font-size:12pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8pt;&quot;&gt;Das Plugin Profil Werkzeug zeichnet Geländeprofile entlang interaktiver punktueller oder ausgewählter Polylinien.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8pt;&quot;&gt;Daten können aus einer Rasterebene oder einer Punktvektorebene mit Höhenfeld stammen.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8pt;&quot;&gt;Das Diagramm kann in das SVG- oder PNG-Format exportiert werden. Die verwendete Polylinie kann als 3D-Polylinie im dxf-Format exportiert werden.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8pt;&quot;&gt;Bitte senden Sie Ihre Überlegungen, Meinungen, Vorschläge und Wünsche (insbesondere in Bezug auf dieses Plugin) an &lt;/span&gt;&lt;a href=&quot;https://github.com/etiennesky/profiletool/issues&quot;&gt;&lt;span style=&quot; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/etiennesky/profiletool/issues&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8pt;&quot;&gt;Profile Tool Plugin - Lizenz GNU GPL 2&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8pt;&quot;&gt;Geschrieben 2008 von Borys Jurgiel&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8pt;&quot;&gt;Geschrieben 2012 von Borys Jurgiel, Patrice Verchere&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8pt;&quot;&gt;Anforderungen:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8pt;&quot;&gt;- Qwt5 (python-qwt5-qt4) und/oder python-matplotlib&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:&apos;MS Shell Dlg 2&apos;; font-size:8pt;&quot;&gt;- QT Version 4.1 zum Speichern in PDF und 4.3 zum Speichern in SVG&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>GroupBox</name>
<message>
<location filename="../ui/ptdockwidget.py" line="447"/>
<source>Copy to clipboard</source>
<translation>In die Zwischenablage kopieren</translation>
</message>
<message>
<location filename="../ui/ptdockwidget.py" line="462"/>
<source>Copy to clipboard (with coordinates)</source>
<translation>In die Zwischenablage kopieren (mit Koordinaten)</translation>
</message>
<message>
<location filename="../ui/ptdockwidget.py" line="475"/>
<source>Create Temporary layer</source>
<translation>Temporäre Layer erstellen</translation>
</message>
</context>
<context>
<name>PTDockWidget</name>
<message>
<location filename="../ui/ptdockwidget.py" line="95"/>
<source>Band/Field</source>
<translation>Band/Feld</translation>
</message>
<message>
<location filename="../ui/ptdockwidget.py" line="95"/>
<source>Search buffer</source>
<translation>Suchpuffer</translation>
</message>
<message>
<location filename="../ui/ptdockwidget.py" line="95"/>
<source>Layer</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProfilePlugin</name>
<message>
<location filename="../profileplugin.py" line="78"/>
<source>Terrain profile</source>
<translation>Geländeprofil</translation>
</message>
<message>
<location filename="../profileplugin.py" line="81"/>
<source>Plots terrain profiles</source>
<translation>Zeichnet Geländeprofile</translation>
</message>
</context>
<context>
<name>ProfileTool</name>
<message>
<location filename="../ui/profiletool.ui" line="14"/>
<source>Profile Tool</source>
<translation>Profil Werkzeug</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="52"/>
<source>&amp;Profile</source>
<translation>&amp;Profile</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="86"/>
<source>maximum</source>
<translation>Maximum</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="109"/>
<source>minimum</source>
<translation>Minimum</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="169"/>
<source>Reset view</source>
<translation>Ansicht zurücksetzen</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="192"/>
<source>When checked, profile is calculated along the polyline. Unchecked, only the values at polyline vertices are shown.</source>
<translation>Wenn diese Option aktiviert ist, wird das Profil entlang der Polylinie berechnet. Deaktiviert werden nur die Werte an Polylinienscheitelpunkten angezeigt.</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="195"/>
<source>Interpolated profile</source>
<translation>Interpoliertes Profil</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="229"/>
<source>PDF</source>
<translation>PDF</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="234"/>
<source>PNG</source>
<translation>PNG</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="239"/>
<source>SVG</source>
<translation>SVG</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="244"/>
<source>print (PS)</source>
<translation>Drucke PS</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="252"/>
<source>Save as</source>
<translation>Speichern als</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="311"/>
<source>Add Layer</source>
<translation>Layer hinzufügen</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="336"/>
<source>Remove Layer</source>
<translation>Layer entfernen</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="345"/>
<source>Options</source>
<translation>Optionen</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="354"/>
<source>Link mouse position
on graph with canvas</source>
<translation>Mausposition verknüpfen
auf Grafik mit Leinwand</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="365"/>
<source>Show cursor</source>
<translation>Cursor anzeigen</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="378"/>
<source>Selection</source>
<translation>Auswahl</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="395"/>
<source>Temporary polyline</source>
<translation>Temporäre Polylinie</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="400"/>
<source>Selected polyline</source>
<translation>Ausgewählte Polylinie</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="405"/>
<source>Selected layer</source>
<translation>Ausgewählter Layer</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="413"/>
<source>Always keep the same scale for X and Y axis. &lt;br/&gt;&lt;br/&gt;&lt;i&gt;Only available with PyQtGraph plot library&lt;/i&gt;</source>
<translation>Behalten Sie immer den gleichen Maßstab für die X- und Y-Achse bei. &lt;br/&gt;&lt;br/&gt;&lt;i&gt;Nur verfügbar mit PyQtGraph-Plot-Bibliothek&lt;/i&gt;</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="416"/>
<source>Same axis scale</source>
<translation>Gleiche Achsenskalierung</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="431"/>
<source>Table</source>
<translation>Tabelle</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="455"/>
<source>Settings</source>
<translation>Einstellungen</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="461"/>
<source>Plot library</source>
<translation>Plot-Bibliothek</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="473"/>
<source>Full Resolution</source>
<translation>Volle Auflösung</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="485"/>
<source>Unchecked, each polyline segment is profiled with a max of 1000 points. When checked, each segment is profiled with the map&apos;s full resolution.</source>
<translation>Deaktiviert wird jedes Polyliniensegment mit maximal 1000 Punkten profiliert. Wenn diese Option aktiviert ist, wird jedes Segment mit der vollen Auflösung der Karte profiliert.</translation>
</message>
<message>
<location filename="../ui/profiletool.ui" line="488"/>
<source>Full resolution enabled</source>
<translation>Volle Auflösung aktiviert</translation>
</message>
</context>
</TS>
23 changes: 19 additions & 4 deletions profileplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,27 @@
except:
pass


from . import resources
from .tools.profiletool_core import ProfileToolCore

from os import path

class ProfilePlugin:
def __init__(self, iface):
self.iface = iface
self.canvas = iface.mapCanvas()

# translation
# initialize plugin directory
self.plugin_dir = path.dirname(__file__)
# initialize locale
locale = QgsSettings().value("locale/userLocale", "en_US")[0:2]
locale_path = path.join(self.plugin_dir, "i18n", f"profiletool_{locale}.qm")

if path.exists(locale_path):
self.translator = QTranslator()
self.translator.load(locale_path)
QCoreApplication.installTranslator(self.translator)

self.profiletool = None
self.dockOpened = False # remember for not reopening dock if there's already one opened
# self.wdg = None
Expand All @@ -55,9 +67,9 @@ def __init__(self, iface):
def initGui(self):
# create action
self.action = QAction(
QIcon(":/plugins/profiletool/icons/profileIcon.png"), "Terrain profile", self.iface.mainWindow()
QIcon(":/plugins/profiletool/icons/profileIcon.png"), self.tr("Terrain profile"), self.iface.mainWindow()
)
self.action.setWhatsThis("Plots terrain profiles")
self.action.setWhatsThis(self.tr("Plots terrain profiles"))
self.action.triggered.connect(self.run)
self.aboutAction = QAction("About", self.iface.mainWindow())
self.aboutAction.triggered.connect(self.about)
Expand All @@ -81,6 +93,9 @@ def unload(self):
self.iface.removePluginMenu("&Profile Tool", self.action)
self.iface.removePluginMenu("&Profile Tool", self.aboutAction)

def tr(self, message):
return QCoreApplication.translate("ProfilePlugin", message)

def run(self):

if not self.dockOpened:
Expand Down
2 changes: 1 addition & 1 deletion ui/ptdockwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(self, iface1, profiletoolcore, parent=None):
hh = self.tableView.horizontalHeader()
hh.setStretchLastSection(True)
self.tableView.setColumnHidden(5, True)
self.mdl.setHorizontalHeaderLabels(["", "", "Layer", "Band/Field", "Search buffer"])
self.mdl.setHorizontalHeaderLabels(["", "", self.tr("Layer"), self.tr("Band/Field"), self.tr("Search buffer")])
self.tableViewTool = TableViewTool()

# other
Expand Down

0 comments on commit ac194f3

Please sign in to comment.