Thanks for your answer. However I am not I totally understand you: could you give me a code example?
···Sheel Shah wrote:
Instead of putting the logic to calculate a summary inside a hidden value, you could directly put the logic for this inside the label question.
So instead of your label being 'Summary: ', you could change it to Summary: .
Then you can slightly modify the logic in the different labels for English and Burmese to change the concatenated text as needed.
On Sun, Jun 22, 2014 at 3:47 AM, Charles Flèche firstname.lastname@example.org wrote:
We want to implement a summary of actions to do at the end of a form, something like :
"Consultation summary :
- Refer within 24H
- Give pain killers
We took example on the m4Change application. As such we have :
- a “Label” screen containing
- a hidden “action_summary” value that is a concatenation of other action strings : concat(/anc/action1, /anc/action2,…)
- action strings where the logic either return a null string (if it doesn’t need to be displayed) or a string : if(selected(/anc/fundus_height, “high_ftt”) or selected(/anc/fundus_height, “low_ftt”), "Abnormal fundus Refer for follow up ---- ", “”)
While hacky, it works well. But what would be the way to manage translations ? I see two ways :
- Putting the translation in the action strings
We would have someting like this :
How can the current language be queried in a hidden value calculate condition ?
- Create hidden values for each translation of each action string
Summary screen :
concat(/action1_en, /action2_en, …)
concat(/action1_mmr, /action2_mmr, …)
The solution 1 seems better as the need_to_display_action* don’t have to be duplicated for each language. We can think of extracting the condition on need_to_display_action* conditions in their own hidden values, but suddenly we triple the number of hidden values and it somewhat feels “wrong”.
What do you guys think ? Is there a better way ?
You received this message because you are subscribed to the Google Groups “commcare-users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
For more options, visit https://groups.google.com/d/optout.