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

Importing Localized Assets from Library #4926

Open
rgraudin opened this issue May 2, 2024 · 0 comments
Open

Importing Localized Assets from Library #4926

rgraudin opened this issue May 2, 2024 · 0 comments

Comments

@rgraudin
Copy link

rgraudin commented May 2, 2024

Description

There seems to be a problem with the way Kobo Toolbox imports questions from the library into surveys when the library asset is localized. The use case is that we are loading questions into the question library for users to be able to import to their own surveys. Many of these have multiple reviewed translations which are useful for users to be able to access out-of-the-box. These translations are uploaded to question and choice labels by API as English (en), Spanish (es), etc. This same behavior can be reproduced by the attached XLSForm example.

Example XLSForm

Steps to Reproduce

  1. Load provided XLSForm into the question library as either a block or a template.
  2. Create a survey from scratch.
  3. Select Add from Library and select the block from the XLSForm example.
  4. See that the question name is visible instead of the label. Preview the form and see that a new default language has been added with the question name as the label and the English choices. Viewing English will show the English label and Spanish choices while viewing Spanish will show the Spanish label and empty choices.
  5. Save the form and see that you cannot edit the survey as is with this error: There is an unnamed translation in your form definition.
  6. Some of the proper functionality is attained if you set the languages before importing or if you set a new default and delete the unnamed language after importing. However, this seems to be inconsistent with occasionally disrupting translations. It is also not a desirable user experience.

Expected behavior

I expect the question to be added to the survey and to perform as it did in the library.

EDIT: The expected behavior is also attained by creating the library question block, downloading it as an XLSForm, and then uploading that form to create a survey.

Actual behavior

From Library

image

When Imported

image

Previewing English

image

Previewing Spanish

image

Additional details

I wasn't sure how to get the version of our self-hosted instance, but I have reproduced this issue on Kobo Cloud so I believe it would be a current issue with 2.024.09 (?).

Non-localized forms only have label, whereas once an asset is localized it cannot have label because that is taken as a null language. When you import from the library, the operation seems to expect non-localized assets and adds label if it doesn't exist, falling back to the name value. I believe the appropriate fix would involve the import from library operation accepting localized assets, even if questions do not include a label field. Thanks so much!!

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