kpi is the (frontend) server for KoboToolbox. It includes an API for users to access data and manage their forms, question library, sharing settings, create reports, and export data.
When adding languages in the kpi UI, the media::xxx columns/fields in the choices sheet are not being "translated" updated to include the new language, leading to previews to fail, form downloads to fail, and not allowing users to translate these file names in the UI.
Set default language to English en and then add a translation French fr
Edit the French translation (like so:
Click preview
Open formbuilder
Download XLSForm
Expected behavior
Step 3: File references salame.jpeg and cheese.jpeg appear in the translation list.
Step 5: Preview succeeds.
Step 6: Formbuilder opens.
Step 7: Download succeeds
Actual behavior
Step 3:. File references for the two choice list images are not included in the translation screen.
Step 5: Preview fails to open with error
{"status":"failure","error_type":"ValueError","error":"('Incorrect translation count: \"media::image\"', {'label': ['Salame', None], 'list_name': 'pizza', 'media::image': ['salame.jpeg'], 'name': 'Salame'})","warnings":[]}
Step 6: Formbuilder fails to open with error
Step 7: Download fails with 500 server response
Additional details
Tested on HHI,du.
When deleting the media::image column in the choices sheet this issue goes away, so it's definitely the case that the media in the choices sheet isn't being included in kpi's translation method.
Description
When adding languages in the kpi UI, the
media::xxx
columns/fields in thechoices
sheet are not being "translated" updated to include the new language, leading to previews to fail, form downloads to fail, and not allowing users to translate these file names in the UI.Steps to Reproduce
Upload this form mediacolumns.xlsx
Click on the Manage Translations (globe) button
Set default language to English en and then add a translation French fr
Edit the French translation (like so:
Click preview
Open formbuilder
Download XLSForm
Expected behavior
Step 3: File references
salame.jpeg
andcheese.jpeg
appear in the translation list. Step 5: Preview succeeds. Step 6: Formbuilder opens. Step 7: Download succeedsActual behavior
Step 3:. File references for the two choice list images are not included in the translation screen. Step 5: Preview fails to open with error
{"status":"failure","error_type":"ValueError","error":"('Incorrect translation count: \"media::image\"', {'label': ['Salame', None], 'list_name': 'pizza', 'media::image': ['salame.jpeg'], 'name': 'Salame'})","warnings":[]}
Step 6: Formbuilder fails to open with error Step 7: Download fails with 500 server responseAdditional details
Tested on HHI,
du
.When deleting the
media::image
column in thechoices
sheet this issue goes away, so it's definitely the case that the media in the choices sheet isn't being included in kpi's translation method.