[QGIS-Developer] language dependency qgis_process

Michael Hälsig mhc-qgis at haelsig.net
Thu Jan 19 02:38:11 PST 2023


Hi Richard & Raymond,
thank you for looking into this issue.

E.g. the algorithm (native:calculatevectoroverlaps) creates a new field in the 
output layer, which gives the percentage of the overlap ('Buffered_pc'). In the 
moment, calling this function in a model inside the QGIS client, the field is 
named 'Gepuffert_pc' (German translation). When I call the model standalone 
with qgis_process, the field is named 'Buffered_pc'. There are other algorithms 
which create fields in the output layer. 

But: qgis_process creates a file ~/.config/qgis_process.bin.conf with the 
content ''localized_data_paths=@Invalid()'. This is an indication for me that 
qgis_process expects somewhere a path for translations. 

Because qgis_process and QGIS client (3.28.3) run on the same installation/
environment (Linux/Debian), everything should be in place. There is also no 
language parameter für qgis_process like '--lang=de-DE'. 

==> I assume that I have to set an environment variable for qgis_process - any 
hints are welcome!

@Richard: I remember a long discussion, if Excel-functions should be 
translated - a college in England could not use my German Excel. Microsoft 
solved this over the years with switches, and finally came up with the function 
translator:  <https://support.microsoft.com/en-us/office/excel-functions-translator-f262d0c0-991c-485b-89b6-32cc8d326889>. For me, switches would be  
sufficient.

@Raymond: Renaming or other workarounds require to check the existence of a 
field. I have not found a clickable function for this, only some pyqgis 
scripts: <https://gis.stackexchange.com/questions/299263/qgis-3-0-2-check-if-a-field-exists-in-a-layer-in-python>

Thank you for your help.
Michael

-- 
Dr. Michael Hälsig
Diefenbachstr. 9
81479 München

Tel.: +49 89 79199563
Mob.:+49 171 333 7558
Am Donnerstag, 19. Januar 2023, 09:03:34 CET schrieb Raymond Nijssen via QGIS-
Developer:
> Hi Michael,
> 
> I agree with Richard that algorithm outputs should not be different when
> using other locales.
> 
> However, there's a Rename Field algorithm (native:renametablefield) that
> might be useful for you.
> 
> Kind regards,
> Raymond
> 
> On 19-01-2023 08:37, Richard Duivenvoorde via QGIS-Developer wrote:
> > Hi Michael,
> > 
> > I'm not 100% sure, but I would think that such fields should never be
> > translated?
> > Not in Desktop nor in scripts?
> > 
> > What do other think?
> > 
> > Or has processing some language aware dict with all languages in it?
> > 
> > Regards,
> > 
> > Richard Duivenvoorde
> > 
> > On 1/17/23 22:37, Dr. Michael Hälsig via QGIS-Developer wrote:
> >> Hi,
> >> I am using qgis_process stand alone (Linux desktop or Linux headless
> >> server)
> >> and run e.g. an overlap analysis, This algorithm adds a field
> >> 'Buffered_pc'.
> >> 
> >> When I use the processing inside the QGIS desktop, the overlap
> >> algorithm names
> >> the added field 'Gepuffert_pc', because I am using the German locale.
> >> 
> >> But I need for the further processing the German version of the field
> >> name.
> >> 
> >> Apparently qgis_process creates a file in ~/.config/Unknown Organization/
> >> qgis_process.bin.conf with the content
> >> 'localized_data_paths=@Invalid()'. It
> >> seems to be that qgis_process expects somewhere the path for the German
> >> localization.
> >> 
> >> How do I tell qgis_process to use the German locale?
> >> 
> >> Thank you for any hints.
> >> 
> >> Michael
> >> 
> >> 
> >> 
> >> _______________________________________________
> >> QGIS-Developer mailing list
> >> QGIS-Developer at lists.osgeo.org
> >> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> >> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > 
> > _______________________________________________
> > QGIS-Developer mailing list
> > QGIS-Developer at lists.osgeo.org
> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> 
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer






More information about the QGIS-Developer mailing list