Skip to content

Extract the languages available in the XLSForm, and provide a dropdown for the user to select #11

@spwoodcock

Description

@spwoodcock
  • Currently the user must provide a language string, e.g. english(en) before converting the XLSForm.
  • This is prone to typos / misremembering / etc - ideally the user can select from options.
  • This would mean loading the form in advance before the processing algo runs though!

We could extract all available translations easily:

fields = self.survey_layer.fields().names()
if fields[0] == "Field1":
self.survey_skip_first = True
fields = self.survey_layer.getFeature(1).attributes()
self.survey_type_index = fields.index("type") if "type" in fields else -1
self.survey_name_index = fields.index("name") if "name" in fields else -1
self.survey_label_index = fields.index("label") if "label" in fields else -1

# translation fields must have `::` between 'label' and the translation alias
translation_tags = sorted({f.split("::", 1)[1] for f in fields if "::" in f})

then display them in a dropdown for selection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions