geocom-gis / gpf

Geocom Python Framework for ArcGIS
Apache License 2.0
2 stars 3 forks source link

InsertCursor und UpdateCursor starten Edit Session nicht automatisch auf Nicht-Englischen Systemen #1

Open Astrolux opened 4 years ago

Astrolux commented 4 years ago

Die Init Funktion von Insert und Update Cursor prüft ob schon eine Edit Session gestartet ist, indem die Fehlermeldung auf das Vorkommen des Textes "edit session" geprüft wird. Fall der Fehler auftritt, wird dieser abgefangen und eine Edit Session automatisch geöffnet.

Codesnippet

        try:
            super(InsertCursor, self).__init__(datatable, field_names)
        except RuntimeError as e:
            if 'edit session' in str(e).lower() and kwargs.get('auto_edit', True):
                self._editor = Editor(datatable)
                self._editor.start()
                super(InsertCursor, self).__init__(datatable, field_names)
                return
            raise

Dies funktioniert nur, wenn die Fehlermeldung englisch ist, was nicht immer der Fall ist.

Muss auch in anderen Sprachen funktionieren.

GeoSander commented 4 years ago

This is a known issue. The current gpf version does not provide multi-language support (i18n) yet. This also means, that any errors thrown by the gpf will be displayed in English only. There are currently no plans to add support for it. This means that, for the time being, you could uninstall the current gpf, fork this repo, change the source code and then use pip to re-install it (in editable mode).