Hello,
without further notice, I will work on processing dropdown parameter
translation next week, that is:
modify all algorithms in the QGIS group, like this :
https://github.com/arnaud-morvan/QGIS/commit/0286c3d95dffeee65ff7a6b7a69919d700815e4b
and make a Pull Request
Best Regards
Arnaud
Le 26/08/2015 14:50, Arnaud Morvan a écrit :
Hello,
In processing algorithms, I want to translate the ParameterSelection
dropdown contents.
I've tested two possibilities on SpatialJoin, which both operate,
and I want to get review before editing all algorithms :
First solution: use of QCoreApplication.translate('SpatialJoin', ...)
in the class header:
https://github.com/arnaud-morvan/QGIS/commit/0daefe838c2b02c8a1bbeffdec551f578424b592
With this form we have to specify context for each string.
Translation is effectively made at import time because language is
set before loading processing plugin.
Second solution: use self.tr method in the defineCharacteristics method :
https://github.com/arnaud-morvan/QGIS/commit/0286c3d95dffeee65ff7a6b7a69919d700815e4b
With this form, we use the self.tr method at runtime on each
defineCharacteristics call, like it is the case for name, group and
parameters names.
I think that it is better to make translations at runtime, that is, in
the defineCharacteristics method.
Does anyone have an opinion on this ?
Arnaud
_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer