covid-alert-ny / covid-green-app

Covid Alert NY - React-Native App
Apache License 2.0
6 stars 1 forks source link

Make all text updatable from API, with slots for vaccine info #649

Closed AlanSl closed 3 years ago

AlanSl commented 3 years ago

This adds three slots for text on the dashboard, and by default in English shows vaccine info at the bottom:

This also makes all text updatable from the API by passing a textOverrides object with keys for language codes and then items following the same structure as the language .json files. For example, this would change English and Spanish "OK" label, disable the bottom dashboard vaccine info and add one in the middle of the dashboard:

"textOverrides": {
  "en": {
    "common": {
      "ok": {
        "label": "Okay"
      },
    "dashboard": {
      "text": {
        "middle": "Try our [Vaccine Tracker](https://covid19vaccine.health.ny.gov/covid-19-vaccine-tracker)",
        "bottom": ""
      }
   },
  "es": {
    "common": {
      "ok": {
        "label": "Vale"
      }
  }
}

There's also a couple of minor tweaks to line up charts better when values are zero and improve dropdown behaviour on android.