Skip to content

Commit 90fe583

Browse files
author
jef
committed
ftools i18n update
git-svn-id: http://svn.osgeo.org/qgis/trunk@12655 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent d5066cc commit 90fe583

20 files changed

+189
-218
lines changed

python/plugins/fTools/doAbout.py

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -36,51 +36,42 @@ def __init__(self, iface):
3636
self.textEdit.setText(self.getText())
3737

3838
def getText(self):
39-
aboutText = QString("The goal of fTools is to provide a one-stop resource for many common vector-based GIS tasks, ")
40-
aboutText.append("without the need for additional software, libraries, or complex workarounds.\n\n")
41-
aboutText.append("fTools is designed to extend the functionality of Quantum GIS using only core QGIS and python ")
42-
aboutText.append("libraries. It provides a growing suite of spatial data management and analysis functions that are ")
43-
aboutText.append("both quick and functional. In addition, the geoprocessing functions of Dr. Horst Duester and ")
44-
aboutText.append("Stefan Ziegler have been incorporated to futher facilitate and streamline GIS based research and analysis.\n\n")
45-
aboutText.append("If you would like to report a bug, make suggestions for improving fTools, or have a question about ")
46-
aboutText.append("the tools, please email me: carson.farmer@gmail.com\n\n")
47-
licenceString = QString("LICENSING INFORMATION:\n")
48-
licenceString.append("fTools is copyright (C) 2009 Carson J.Q. Farmer\n")
49-
licenceString.append("Geoprocessing functions adapted from 'Geoprocessing Plugin',\n")
50-
licenceString.append("(C) 2008 by Dr. Horst Duester, Stefan Ziegler\n\n")
51-
licenceString.append("licensed under the terms of GNU GPL 2\n")
52-
licenceString.append("This program is free software; you can redistribute it and/or modify")
53-
licenceString.append("it under the terms of the GNU General Public License as published by")
54-
licenceString.append("the Free Software Foundation; either version 2 of the License, or")
55-
licenceString.append("(at your option) any later version.\n")
56-
licenceString.append("This program is distributed in the hope that it will be useful,")
57-
licenceString.append("but WITHOUT ANY WARRANTY; without even the implied warranty of")
58-
licenceString.append("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the")
59-
licenceString.append("GNU General Public License for more details.\n")
60-
licenceString.append("You should have received a copy of the GNU General Public License along")
61-
licenceString.append("with this program; if not, write to the Free Software Foundation, Inc.,")
62-
licenceString.append("51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\n")
63-
aknowledgeString = QString("AKNOWLEDGEMENTS:\n")
64-
aknowledgeString.append("The following individuals (whether they know it or not) have contributed ")
65-
aknowledgeString.append("ideas, help, testing, code, and guidence towards this project, and I thank them.\n")
66-
aknowledgeString.append("Hawthorn Beyer\n")
67-
aknowledgeString.append("Borys Jurgiel\n")
68-
aknowledgeString.append("Tim Sutton\n")
69-
aknowledgeString.append("Barry Rowlingson\n")
70-
aknowledgeString.append("Horst Duester and Stefan Ziegler\n")
71-
aknowledgeString.append("Paolo Cavallini\n")
72-
aknowledgeString.append("Aaron Racicot\n")
73-
aknowledgeString.append("Colin Robertson\n")
74-
aknowledgeString.append("Agustin Lobo\n")
75-
aknowledgeString.append("Jurgen E. Fischer\n")
76-
aknowledgeString.append("QGis developer and user communities\n")
77-
aknowledgeString.append("Folks on #qgis at freenode.net\n")
78-
aknowledgeString.append("All those who have reported bugs/fixes/suggestions/comments/etc.")
79-
return QString(aboutText.append(licenceString.append(aknowledgeString)))
39+
return self.tr("""
40+
The goal of fTools is to provide a one-stop resource for many common vector-based GIS tasks, without the need for additional software, libraries, or complex workarounds.
41+
42+
fTools is designed to extend the functionality of Quantum GIS using only core QGIS and python libraries. It provides a growing suite of spatial data management and analysis functions that are both quick and functional. In addition, the geoprocessing functions of Dr. Horst Duester and Stefan Ziegler have been incorporated to futher facilitate and streamline GIS based research and analysis.
43+
44+
If you would like to report a bug, make suggestions for improving fTools, or have a question about the tools, please email me: carson.farmer@gmail.com
45+
46+
LICENSING INFORMATION:
47+
fTools is copyright (C) 2009 Carson J.Q. Farmer
48+
Geoprocessing functions adapted from 'Geoprocessing Plugin',
49+
(C) 2008 by Dr. Horst Duester, Stefan Ziegler
50+
51+
licensed under the terms of GNU GPL 2
52+
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
53+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
54+
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
55+
56+
ACKNOWLEDGEMENTS:
57+
The following individuals (whether they know it or not) have contributed ideas, help, testing, code, and guidence towards this project, and I thank them.
58+
Hawthorn Beyer
59+
Borys Jurgiel
60+
Tim Sutton
61+
Barry Rowlingson
62+
Horst Duester and Stefan Ziegler
63+
Paolo Cavallini
64+
Aaron Racicot
65+
Colin Robertson
66+
Agustin Lobo
67+
Jurgen E. Fischer
68+
QGis developer and user communities
69+
Folks on #qgis at freenode.net
70+
All those who have reported bugs/fixes/suggestions/comments/etc.
71+
""")
8072

8173
def openWeb(self):
8274
webbrowser.open("http://www.ftools.ca/")
8375

8476
def openHelp(self):
8577
webbrowser.open(currentPath + "/ftools_help.xml")
86-

python/plugins/fTools/tools/doDefineProj.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, iface):
1717
self.outShape.setVisible(False)
1818
self.label_2.setVisible(False)
1919
self.label_2.setEnabled(False)
20-
self.setWindowTitle("Define current projection")
20+
self.setWindowTitle(self.tr("Define current projection"))
2121
QObject.connect(self.btnProjection, SIGNAL("clicked()"), self.outProjFile)
2222
QObject.connect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.updateProj1)
2323
QObject.connect(self.cmbLayer, SIGNAL("currentIndexChanged(QString)"), self.updateProj2)
@@ -42,19 +42,19 @@ def updateProj2(self, layerName):
4242

4343
def accept(self):
4444
if self.inShape.currentText() == "":
45-
QMessageBox.information(self, "Define current projection", "No input shapefile specified")
45+
QMessageBox.information(self, self.tr("Define current projection"), self.tr("No input shapefile specified"))
4646
elif self.txtProjection.text() == "" and self.rdoProjection.isChecked():
47-
QMessageBox.information(self, "Define current projection", "Please specify spatial reference system")
47+
QMessageBox.information(self, self.tr("Define current projection"), self.tr("Please specify spatial reference system"))
4848
elif self.cmbLayer.currentText() == "" and self.rdoLayer.isChecked():
49-
QMessageBox.information(self, "Define current projection", "Please specify spatial reference system")
49+
QMessageBox.information(self, self.tr("Define current projection"), self.tr("Please specify spatial reference system"))
5050
else:
5151
self.progressBar.setValue(5)
5252
inName = self.inShape.currentText()
5353
self.progressBar.setValue(10)
5454
vLayer = self.getVectorLayerByName(inName)
5555
self.progressBar.setValue(30)
5656
if vLayer == "Error":
57-
QMessageBox.information(self, "Define current projection", "Cannot define projection for PostGIS data...yet!")
57+
QMessageBox.information(self, self.tr("Define current projection"), self.tr("Cannot define projection for PostGIS data...yet!"))
5858
else:
5959
srsDefine = QgsCoordinateReferenceSystem()
6060
if self.rdoProjection.isChecked():
@@ -64,7 +64,7 @@ def accept(self):
6464
destLayer = self.getVectorLayerByName(self.cmbLayer.currentText())
6565
srsDefine = destLayer.srs()
6666
if srsDefine == vLayer.srs():
67-
QMessageBox.information(self, "Define current projection", "Identical output spatial reference system chosen")
67+
QMessageBox.information(self, self.tr("Define current projection"), self.tr("Identical output spatial reference system chosen"))
6868
else:
6969
provider = vLayer.dataProvider()
7070
self.progressBar.setValue(35)
@@ -74,7 +74,7 @@ def accept(self):
7474
inPath = inPath.left(inPath.length() - 4)
7575
self.progressBar.setValue(55)
7676
if not srsDefine.isValid():
77-
QMessageBox.information(self, "Define current projection", "Output spatial reference system is not valid")
77+
QMessageBox.information(self, self.tr("Define current projection"), self.tr("Output spatial reference system is not valid"))
7878
else:
7979
self.progressBar.setValue(60)
8080
outputWkt = srsDefine.toWkt()
@@ -87,26 +87,25 @@ def accept(self):
8787
mLayer = self.getMapLayerByName(inName)
8888
self.progressBar.setValue(90)
8989
if not mLayer.isValid():
90-
QMessageBox.information(self, "Define current projection", "Unable to dynamically define projection.\n"
91-
+ "Please reload layer manually for projection definition to take effect.")
90+
QMessageBox.information(self, self.tr("Define current projection"), self.tr("Unable to dynamically define projection.\nPlease reload layer manually for projection definition to take effect."))
9291
else:
9392
self.progressBar.setValue(95)
9493
mLayer.setCrs(srsDefine)
9594
self.progressBar.setValue(100)
96-
QMessageBox.information(self, "Define current projection", "Defined Projection For:\n" + inPath + ".shp")
95+
QMessageBox.information(self, self.tr("Define current projection"), self.tr("Defined Projection For:\n%1.shp").arg( inPath ) )
9796
self.progressBar.setValue(0)
9897

9998
def outProjFile(self):
10099
format = QString( "<h2>%1</h2>%2 <br/> %3" )
101100
header = QString( "Define layer CRS:" )
102-
sentence1 = QString( "Please select the projection system that defines the current layer." )
103-
sentence2 = QString( "Layer CRS information will be updated to the selected CRS." )
101+
sentence1 = self.tr( "Please select the projection system that defines the current layer." )
102+
sentence2 = self.tr( "Layer CRS information will be updated to the selected CRS." )
104103
self.projSelect = QgsGenericProjectionSelector(self, Qt.Widget)
105104
self.projSelect.setMessage( format.arg( header ).arg( sentence1 ).arg( sentence2 ))
106105
if self.projSelect.exec_():
107106
projString = self.projSelect.selectedProj4String()
108107
if projString == "":
109-
QMessageBox.information(self, "Export to new projection", "No Valid CRS selected")
108+
QMessageBox.information(self, self.tr("Export to new projection"), self.tr("No Valid CRS selected"))
110109
return
111110
else:
112111
self.txtProjection.clear()

python/plugins/fTools/tools/doGeometry.py

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ def update(self):
3333

3434
def accept(self):
3535
if self.inShape.currentText() == "":
36-
QMessageBox.information(self, "Geometry", self.tr( "Please specify input vector layer" ) )
36+
QMessageBox.information(self, self.tr("Geometry"), self.tr( "Please specify input vector layer" ) )
3737
elif self.outShape.text() == "":
38-
QMessageBox.information(self, "Geometry", self.tr( "Please specify output shapefile" ) )
38+
QMessageBox.information(self, self.tr("Geometry"), self.tr( "Please specify output shapefile" ) )
3939
elif self.lineEdit.isVisible() and self.lineEdit.value() <= 0.00:
40-
QMessageBox.information(self, "Geometry", self.tr( "Please specify valid tolerance value" ) )
40+
QMessageBox.information(self, self.tr("Geometry"), self.tr( "Please specify valid tolerance value" ) )
4141
elif self.cmbField.isVisible() and self.cmbField.currentText() == "":
42-
QMessageBox.information(self, "Geometry", self.tr( "Please specify valid UID field" ) )
42+
QMessageBox.information(self, self.tr("Geometry"), self.tr( "Please specify valid UID field" ) )
4343
else:
4444
self.outShape.clear()
4545
self.geometry( self.inShape.currentText(), self.lineEdit.value(), self.cmbField.currentText() )
@@ -148,14 +148,14 @@ def geometry( self, myLayer, myParam, myField ):
148148
check = QFile( self.shapefileName )
149149
if check.exists():
150150
if not QgsVectorFileWriter.deleteShapeFile( self.shapefileName ):
151-
QMessageBox.warning( self, "Geoprocessing", self.tr( "Unable to delete existing shapefile." ) )
151+
QMessageBox.warning( self, self.tr("Geoprocessing"), self.tr( "Unable to delete existing shapefile." ) )
152152
return
153153
self.testThread = geometryThread( self.iface.mainWindow(), self, self.myFunction, vlayer, myParam,
154154
myField, self.shapefileName, self.encoding )
155155
QObject.connect( self.testThread, SIGNAL( "runFinished(PyQt_PyObject)" ), self.runFinishedFromThread )
156156
QObject.connect( self.testThread, SIGNAL( "runStatus(PyQt_PyObject)" ), self.runStatusFromThread )
157157
QObject.connect( self.testThread, SIGNAL( "runRange(PyQt_PyObject)" ), self.runRangeFromThread )
158-
self.cancel_close.setText( "Cancel" )
158+
self.cancel_close.setText( self.tr("Cancel") )
159159
QObject.connect( self.cancel_close, SIGNAL( "clicked()" ), self.cancelThread )
160160
self.testThread.start()
161161

@@ -165,21 +165,18 @@ def cancelThread( self ):
165165
def runFinishedFromThread( self, success ):
166166
self.testThread.stop()
167167
if success == "math_error":
168-
QMessageBox.warning( self, "Geometry", self.tr( "Error processing specified tolerance!" ) + "\n"
169-
+ self.tr( "Please choose larger tolerance..." ) )
168+
QMessageBox.warning( self, self.tr("Geometry"), self.tr("Error processing specified tolerance!\nPlease choose larger tolerance...") )
170169
if not QgsVectorFileWriter.deleteShapeFile( self.shapefileName ):
171-
QMessageBox.warning( self, "Geometry", self.tr( "Unable to delete incomplete shapefile." ) )
170+
QMessageBox.warning( self, self.tr("Geometry"), self.tr( "Unable to delete incomplete shapefile." ) )
172171
else:
173172
self.cancel_close.setText( "Close" )
174173
QObject.disconnect( self.cancel_close, SIGNAL( "clicked()" ), self.cancelThread )
175174
if success:
176-
addToTOC = QMessageBox.question( self, "Geometry", self.tr( "Created output shapefile:" ) + "\n" +
177-
unicode( self.shapefileName ) + "\n\n" + self.tr( "Would you like to add the new layer to the TOC?" ),
178-
QMessageBox.Yes, QMessageBox.No, QMessageBox.NoButton )
175+
addToTOC = QMessageBox.question( self, self.tr("Geometry"), self.tr( "Created output shapefile:\n%1\n\nWould you like to add the new layer to the TOC?" ).arg( unicode( self.shapefileName ) ), QMessageBox.Yes, QMessageBox.No, QMessageBox.NoButton )
179176
if addToTOC == QMessageBox.Yes:
180177
ftools_utils.addShapeToCanvas( unicode( self.shapefileName ) )
181178
else:
182-
QMessageBox.warning( self, "Geometry", self.tr( "Error writing output shapefile." ) )
179+
QMessageBox.warning( self, self.tr("Geometry"), self.tr( "Error writing output shapefile." ) )
183180

184181
def runStatusFromThread( self, status ):
185182
self.progressBar.setValue( status )
@@ -755,33 +752,33 @@ def checkGeometryFields( self, vlayer ):
755752
plp = "Poly"
756753
( found, index1 ) = self.checkForField( nameList, "AREA" )
757754
if not found:
758-
field = QgsField( "AREA", QVariant.Double, "double", 10, 6, "Polygon area" )
755+
field = QgsField( "AREA", QVariant.Double, "double", 10, 6, self.tr("Polygon area") )
759756
index1 = len( fieldList.keys() )
760757
fieldList[ index1 ] = field
761758
( found, index2 ) = self.checkForField( nameList, "PERIMETER" )
762759

763760
if not found:
764-
field = QgsField( "PERIMETER", QVariant.Double, "double", 10, 6, "Polygon perimeter" )
761+
field = QgsField( "PERIMETER", QVariant.Double, "double", 10, 6, self.tr("Polygon perimeter") )
765762
index2 = len( fieldList.keys() )
766763
fieldList[ index2 ] = field
767764
elif geomType == QGis.Line:
768765
plp = "Line"
769766
(found, index1) = self.checkForField(nameList, "LENGTH")
770767
if not found:
771-
field = QgsField("LENGTH", QVariant.Double, "double", 10, 6, "Line length")
768+
field = QgsField("LENGTH", QVariant.Double, "double", 10, 6, self.tr("Line length") )
772769
index1 = len(fieldList.keys())
773770
fieldList[index1] = field
774771
index2 = index1
775772
else:
776773
plp = "Point"
777774
(found, index1) = self.checkForField(nameList, "XCOORD")
778775
if not found:
779-
field = QgsField("XCOORD", QVariant.Double, "double", 10, 6, "Point x coordinate")
776+
field = QgsField("XCOORD", QVariant.Double, "double", 10, 6, self.tr("Point x coordinate") )
780777
index1 = len(fieldList.keys())
781778
fieldList[index1] = field
782779
(found, index2) = self.checkForField(nameList, "YCOORD")
783780
if not found:
784-
field = QgsField("YCOORD", QVariant.Double, "double", 10, 6, "Point y coordinate")
781+
field = QgsField("YCOORD", QVariant.Double, "double", 10, 6, self.tr("Point y coordinate") )
785782
index2 = len(fieldList.keys())
786783
fieldList[index2] = field
787784
return (fieldList, index1, index2)

0 commit comments

Comments
 (0)