medic / cht-conf

A command-line interface for configuring Community Health Toolkit applications
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
22 stars 25 forks source link

Task priority labels are not internationalized with old array style #571

Open dianabarsan opened 1 year ago

dianabarsan commented 1 year ago

Describe the bug According to our documentation, task priority labels can be arrays to support translations for multiple languages. However, cht-conf schema validation requires the label to be a string.

To Reproduce

  1. Create a task according to documentation.
  2. Compile app settings
  3. See error
    ERROR tasks.js invalid schema: 
    ERROR Invalid schema at tasks[3].priority.label
    "priority" should be an object with optional fields "level" and "label" or a function which returns the same
    Current value of tasks[3].priority.label is [{"locale":"en","content":"Home Birth"}]

Additional context This was reported on the forum: https://forum.communityhealthtoolkit.org/t/tasks-with-medium-priority/2978

dianabarsan commented 1 year ago

It looks like webapp has been updated to allow for translation keys for task priority labels, with the old array format style still being supported.

garethbowen commented 1 year ago

We're generally moving away from arrays for labels - it makes the config complex and the translations not able to be reused. Consider just updating the documentation.