Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling missing choice labels #307

Open
jnm opened this issue Nov 10, 2022 · 0 comments
Open

Handling missing choice labels #307

jnm opened this issue Nov 10, 2022 · 0 comments

Comments

@jnm
Copy link
Member

jnm commented Nov 10, 2022

[edit] This is not a regression, but kpi inconsistently sends us both None and the empty string to represent a label that lacks a translation, e.g. either 'label': ['choose jif', None], or 'label': ['choose jif', ''], might be sent.

Question: should formpack treat these identically? It would then fall back to the choice name if the label is an empty string. That's what happens already if the label is None.

Abbreviated schema for context:

{
    'content': {
        'schema': '1',
            {
                'name': 'choosey_moms',
                'type': 'select_one',
                '$kuid': 'nBTaqfqN3',
                'label': ['choosey moms', 'las madres exigentes'],
                '$qpath': 'choosey_moms',
                '$xpath': 'choosey_moms',
                'required': False,
                'select_from_list_name': 'vl8ap24',
            },
        ],
        'choices': [
            {
                'name': 'choose_jif',
                '$kuid': 'T06KYSoia',
                'label': ['choose jif', None],
                'list_name': 'vl8ap24',
            },
            {
                'name': 'choose_gif',
                '$kuid': '91CVcUFYb',
                'label': ['choose GIF', 'elige GIF'],
                'list_name': 'vl8ap24',
            },
        ],
        'translated': ['label'],
        'translations': ['English (en)', 'Español (es)'],
    },
}

Internal discussion: https://chat.kobotoolbox.org/#narrow/stream/4-Kobo-Dev/topic/formpack.20and.20missing.20labels/near/173165

@jnm jnm changed the title Regression in handling mising labels Handling missing choice labels Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant