Skip to content

Commit

Permalink
ftools i18n update
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12655 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Dec 31, 2009
1 parent 2bef345 commit 052387e
Show file tree
Hide file tree
Showing 20 changed files with 189 additions and 218 deletions.
75 changes: 33 additions & 42 deletions python/plugins/fTools/doAbout.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,51 +36,42 @@ def __init__(self, iface):
self.textEdit.setText(self.getText())

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

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

def openHelp(self):
webbrowser.open(currentPath + "/ftools_help.xml")

25 changes: 12 additions & 13 deletions python/plugins/fTools/tools/doDefineProj.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, iface):
self.outShape.setVisible(False)
self.label_2.setVisible(False)
self.label_2.setEnabled(False)
self.setWindowTitle("Define current projection")
self.setWindowTitle(self.tr("Define current projection"))
QObject.connect(self.btnProjection, SIGNAL("clicked()"), self.outProjFile)
QObject.connect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.updateProj1)
QObject.connect(self.cmbLayer, SIGNAL("currentIndexChanged(QString)"), self.updateProj2)
Expand All @@ -42,19 +42,19 @@ def updateProj2(self, layerName):

def accept(self):
if self.inShape.currentText() == "":
QMessageBox.information(self, "Define current projection", "No input shapefile specified")
QMessageBox.information(self, self.tr("Define current projection"), self.tr("No input shapefile specified"))
elif self.txtProjection.text() == "" and self.rdoProjection.isChecked():
QMessageBox.information(self, "Define current projection", "Please specify spatial reference system")
QMessageBox.information(self, self.tr("Define current projection"), self.tr("Please specify spatial reference system"))
elif self.cmbLayer.currentText() == "" and self.rdoLayer.isChecked():
QMessageBox.information(self, "Define current projection", "Please specify spatial reference system")
QMessageBox.information(self, self.tr("Define current projection"), self.tr("Please specify spatial reference system"))
else:
self.progressBar.setValue(5)
inName = self.inShape.currentText()
self.progressBar.setValue(10)
vLayer = self.getVectorLayerByName(inName)
self.progressBar.setValue(30)
if vLayer == "Error":
QMessageBox.information(self, "Define current projection", "Cannot define projection for PostGIS data...yet!")
QMessageBox.information(self, self.tr("Define current projection"), self.tr("Cannot define projection for PostGIS data...yet!"))
else:
srsDefine = QgsCoordinateReferenceSystem()
if self.rdoProjection.isChecked():
Expand All @@ -64,7 +64,7 @@ def accept(self):
destLayer = self.getVectorLayerByName(self.cmbLayer.currentText())
srsDefine = destLayer.srs()
if srsDefine == vLayer.srs():
QMessageBox.information(self, "Define current projection", "Identical output spatial reference system chosen")
QMessageBox.information(self, self.tr("Define current projection"), self.tr("Identical output spatial reference system chosen"))
else:
provider = vLayer.dataProvider()
self.progressBar.setValue(35)
Expand All @@ -74,7 +74,7 @@ def accept(self):
inPath = inPath.left(inPath.length() - 4)
self.progressBar.setValue(55)
if not srsDefine.isValid():
QMessageBox.information(self, "Define current projection", "Output spatial reference system is not valid")
QMessageBox.information(self, self.tr("Define current projection"), self.tr("Output spatial reference system is not valid"))
else:
self.progressBar.setValue(60)
outputWkt = srsDefine.toWkt()
Expand All @@ -87,26 +87,25 @@ def accept(self):
mLayer = self.getMapLayerByName(inName)
self.progressBar.setValue(90)
if not mLayer.isValid():
QMessageBox.information(self, "Define current projection", "Unable to dynamically define projection.\n"
+ "Please reload layer manually for projection definition to take effect.")
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."))
else:
self.progressBar.setValue(95)
mLayer.setCrs(srsDefine)
self.progressBar.setValue(100)
QMessageBox.information(self, "Define current projection", "Defined Projection For:\n" + inPath + ".shp")
QMessageBox.information(self, self.tr("Define current projection"), self.tr("Defined Projection For:\n%1.shp").arg( inPath ) )
self.progressBar.setValue(0)

def outProjFile(self):
format = QString( "<h2>%1</h2>%2 <br/> %3" )
header = QString( "Define layer CRS:" )
sentence1 = QString( "Please select the projection system that defines the current layer." )
sentence2 = QString( "Layer CRS information will be updated to the selected CRS." )
sentence1 = self.tr( "Please select the projection system that defines the current layer." )
sentence2 = self.tr( "Layer CRS information will be updated to the selected CRS." )
self.projSelect = QgsGenericProjectionSelector(self, Qt.Widget)
self.projSelect.setMessage( format.arg( header ).arg( sentence1 ).arg( sentence2 ))
if self.projSelect.exec_():
projString = self.projSelect.selectedProj4String()
if projString == "":
QMessageBox.information(self, "Export to new projection", "No Valid CRS selected")
QMessageBox.information(self, self.tr("Export to new projection"), self.tr("No Valid CRS selected"))
return
else:
self.txtProjection.clear()
Expand Down
33 changes: 15 additions & 18 deletions python/plugins/fTools/tools/doGeometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ def update(self):

def accept(self):
if self.inShape.currentText() == "":
QMessageBox.information(self, "Geometry", self.tr( "Please specify input vector layer" ) )
QMessageBox.information(self, self.tr("Geometry"), self.tr( "Please specify input vector layer" ) )
elif self.outShape.text() == "":
QMessageBox.information(self, "Geometry", self.tr( "Please specify output shapefile" ) )
QMessageBox.information(self, self.tr("Geometry"), self.tr( "Please specify output shapefile" ) )
elif self.lineEdit.isVisible() and self.lineEdit.value() <= 0.00:
QMessageBox.information(self, "Geometry", self.tr( "Please specify valid tolerance value" ) )
QMessageBox.information(self, self.tr("Geometry"), self.tr( "Please specify valid tolerance value" ) )
elif self.cmbField.isVisible() and self.cmbField.currentText() == "":
QMessageBox.information(self, "Geometry", self.tr( "Please specify valid UID field" ) )
QMessageBox.information(self, self.tr("Geometry"), self.tr( "Please specify valid UID field" ) )
else:
self.outShape.clear()
self.geometry( self.inShape.currentText(), self.lineEdit.value(), self.cmbField.currentText() )
Expand Down Expand Up @@ -148,14 +148,14 @@ def geometry( self, myLayer, myParam, myField ):
check = QFile( self.shapefileName )
if check.exists():
if not QgsVectorFileWriter.deleteShapeFile( self.shapefileName ):
QMessageBox.warning( self, "Geoprocessing", self.tr( "Unable to delete existing shapefile." ) )
QMessageBox.warning( self, self.tr("Geoprocessing"), self.tr( "Unable to delete existing shapefile." ) )
return
self.testThread = geometryThread( self.iface.mainWindow(), self, self.myFunction, vlayer, myParam,
myField, self.shapefileName, self.encoding )
QObject.connect( self.testThread, SIGNAL( "runFinished(PyQt_PyObject)" ), self.runFinishedFromThread )
QObject.connect( self.testThread, SIGNAL( "runStatus(PyQt_PyObject)" ), self.runStatusFromThread )
QObject.connect( self.testThread, SIGNAL( "runRange(PyQt_PyObject)" ), self.runRangeFromThread )
self.cancel_close.setText( "Cancel" )
self.cancel_close.setText( self.tr("Cancel") )
QObject.connect( self.cancel_close, SIGNAL( "clicked()" ), self.cancelThread )
self.testThread.start()

Expand All @@ -165,21 +165,18 @@ def cancelThread( self ):
def runFinishedFromThread( self, success ):
self.testThread.stop()
if success == "math_error":
QMessageBox.warning( self, "Geometry", self.tr( "Error processing specified tolerance!" ) + "\n"
+ self.tr( "Please choose larger tolerance..." ) )
QMessageBox.warning( self, self.tr("Geometry"), self.tr("Error processing specified tolerance!\nPlease choose larger tolerance...") )
if not QgsVectorFileWriter.deleteShapeFile( self.shapefileName ):
QMessageBox.warning( self, "Geometry", self.tr( "Unable to delete incomplete shapefile." ) )
QMessageBox.warning( self, self.tr("Geometry"), self.tr( "Unable to delete incomplete shapefile." ) )
else:
self.cancel_close.setText( "Close" )
QObject.disconnect( self.cancel_close, SIGNAL( "clicked()" ), self.cancelThread )
if success:
addToTOC = QMessageBox.question( self, "Geometry", self.tr( "Created output shapefile:" ) + "\n" +
unicode( self.shapefileName ) + "\n\n" + self.tr( "Would you like to add the new layer to the TOC?" ),
QMessageBox.Yes, QMessageBox.No, QMessageBox.NoButton )
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 )
if addToTOC == QMessageBox.Yes:
ftools_utils.addShapeToCanvas( unicode( self.shapefileName ) )
else:
QMessageBox.warning( self, "Geometry", self.tr( "Error writing output shapefile." ) )
QMessageBox.warning( self, self.tr("Geometry"), self.tr( "Error writing output shapefile." ) )

def runStatusFromThread( self, status ):
self.progressBar.setValue( status )
Expand Down Expand Up @@ -755,33 +752,33 @@ def checkGeometryFields( self, vlayer ):
plp = "Poly"
( found, index1 ) = self.checkForField( nameList, "AREA" )
if not found:
field = QgsField( "AREA", QVariant.Double, "double", 10, 6, "Polygon area" )
field = QgsField( "AREA", QVariant.Double, "double", 10, 6, self.tr("Polygon area") )
index1 = len( fieldList.keys() )
fieldList[ index1 ] = field
( found, index2 ) = self.checkForField( nameList, "PERIMETER" )

if not found:
field = QgsField( "PERIMETER", QVariant.Double, "double", 10, 6, "Polygon perimeter" )
field = QgsField( "PERIMETER", QVariant.Double, "double", 10, 6, self.tr("Polygon perimeter") )
index2 = len( fieldList.keys() )
fieldList[ index2 ] = field
elif geomType == QGis.Line:
plp = "Line"
(found, index1) = self.checkForField(nameList, "LENGTH")
if not found:
field = QgsField("LENGTH", QVariant.Double, "double", 10, 6, "Line length")
field = QgsField("LENGTH", QVariant.Double, "double", 10, 6, self.tr("Line length") )
index1 = len(fieldList.keys())
fieldList[index1] = field
index2 = index1
else:
plp = "Point"
(found, index1) = self.checkForField(nameList, "XCOORD")
if not found:
field = QgsField("XCOORD", QVariant.Double, "double", 10, 6, "Point x coordinate")
field = QgsField("XCOORD", QVariant.Double, "double", 10, 6, self.tr("Point x coordinate") )
index1 = len(fieldList.keys())
fieldList[index1] = field
(found, index2) = self.checkForField(nameList, "YCOORD")
if not found:
field = QgsField("YCOORD", QVariant.Double, "double", 10, 6, "Point y coordinate")
field = QgsField("YCOORD", QVariant.Double, "double", 10, 6, self.tr("Point y coordinate") )
index2 = len(fieldList.keys())
fieldList[index2] = field
return (fieldList, index1, index2)
Expand Down
Loading

0 comments on commit 052387e

Please sign in to comment.