-
Notifications
You must be signed in to change notification settings - Fork 82
Bug: create short label for all translations #268
Comments
So far I haven't been able to populate the additional translations' short label, guidance hint et al. if added. Given that a user will want to provide translations for all user facing elements of a form, I'm not sure how much of a blocking issue this bug is. |
This isn’t unique to short labels. How does Build deal with this with regular labels and hints? I think it would make sense to match that. Pyxform adds a - for any missing translations. |
it just needs to generate the node on output always i assume. probably right now it's only dropping into whatever it sees. totally uneducated guessing here but it's not a complex export methodology. it's very 1980s if anything.. |
The current behaviour is indeed to create empty nodes for missing labels and hints (second nesting level). The third nesting level, alternative forms like "short", "image", "bigimage", "video", "audio", which I've added way after the translation plumbing was designed, get dropped.
The difficulty I'm seeing is that due to the way the data is nested, in order to create a node in a second translation, I would need to introspect the other translations and create each node (or fill it with "-") if it exists in any of the other translations. My play time is limited, but if I can find a way to generate this I'll test it. I fear creating empty nodes could create unwanted behaviour, e.g. while a given short label will replace the long form label in the hierarchy view, an empty short label could hide the long form label. The only result I want to see in a translated form is the form designer provides complete and consistent translated strings. |
i still haven't looked deeply at the code so i'm just another idiot with an opinion here, but i think if you preprocess what should always be there before things get going and then apply it on the fly your job will get easier. i hear you on the empty nodes but clearly xlsform is creating them and it's no problem. |
Hearing empty nodes are no problem is reassuring, thanks! |
* If an extra parameter or label or hint has at least one non-empty string, empty nodes are added for all missing translations * If an extra parameter is not filled in for any language, no nodes will be added * Noop: Add some comments in preparation for getodk#126
Thanks to Issa's push into the right direction, dbca-wa@c0aa062 adds empty nodes where needed and no nodes where no strings are given. Let the XML do the talking:
XML export and .odkbuild save file: Tested the form in Collect and changing languages does not crash the form any more. While this testing is not exhaustive, it indicates that the bug is fixed. |
Fix #268: create empty nodes for missing translations
https://forum.getodk.org/t/collect-crashes-when-switching-languages/36056/9
Repro:
Create form
Add short labels
Add language
Don't fill in short labels in new language
Deploy form to Central (no error)
Fill form in Android, switch lang, collect crashes.
The text was updated successfully, but these errors were encountered: