[Qgis-developer] [Processing] translate parameter selection dropdown contents

Victor Olaya volayaf at gmail.com
Thu Aug 27 12:22:47 PDT 2015


Arnaud

In my opinion, is much better to translate at runtime. Don't forget
that providers can be loaded and unloaded, and also updated (as it
happens with the SAGA one when the path to the SAGA executables is
changed), so that is a better option.

Thanks for this works!

2015-08-27 18:17 GMT+02:00 Arnaud Morvan <arnaud.morvan at camptocamp.com>:
>
> 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
>>
>


More information about the Qgis-developer mailing list