e-mission / nrel-openpath-deploy-configs

Configurations for current OpenPATH deployments, published for transparency
BSD 3-Clause "New" or "Revised" License
2 stars 9 forks source link

🔧🌐 Automated Config Issue Form - GitHub Actions doesn't fill in Translations correctly #65

Closed sebastianbarry closed 5 months ago

sebastianbarry commented 5 months ago

The automated config that was created (https://github.com/e-mission/nrel-openpath-deploy-configs/pull/64) from the issue form I filled out (https://github.com/e-mission/nrel-openpath-deploy-configs/issues/63) filled in the intro > translated text > en field with the es translations I put in. I filled in both sections for EN and ES in the issue form, but it only created one translated text field, en, and put the EN translations into it.

  "intro": {
    "program_or_study": "program",
    "start_month": "01",
    "start_year": "2024",
    "mode_studied": "e-bike",
    "program_admin_contact": "For questions about the program, please contact Robera Tasissa (robera.tasissa@dc.gov) or Laura Pimentel (laura.pimentel@dc.gov).",
    "deployment_partner_name": "Energy Administration at District of Columbia Department of Energy and Environment",
    "translated_text": {
      "en": {
        "deployment_partner_name": "Administración de Energía en el Departamento de Energía y Medio Ambiente del Distrito de Columbia",
        "deployment_name": "Proyecto de biblioteca de bicicletas eléctricas",
        "summary_line_1": "La EA en DOEE tiene como objetivo incentivar a los viajeros a adoptar modos de transporte no contaminantes y energéticamente eficientes y maximizar los beneficios de la calidad del aire.",
        "summary_line_2": "Este programa piloto proporciona bicicletas eléctricas a participantes del programa de bajos ingresos en el suroeste de DC.",
        "summary_line_3": "Si participa en el programa, esta aplicación puede ayudarle a registrar sus viajes y competir contra otros en beneficio de nuestro medio ambiente.",
        "short_textual_description": "El piloto permitirá a los residentes del distrito probar varios tipos de bicicletas eléctricas sin costo y fomentará un cambio de modo que reduzca las emisiones, aumente la movilidad de los residentes de bajos ingresos y demuestre un concepto de biblioteca de bicicletas eléctricas aplicable a la vida cotidiana. Al final del piloto, los datos rastreados mediante la aplicación NREL Openpath se utilizarán para comprender el comportamiento de uso de bicicletas eléctricas, el cambio de modo y cualquier barrera para la adopción.",
        "why_we_collect": "Los datos recopilados durante el programa se utilizarán para comprender: cómo se utilizan las bicicletas eléctricas, incluido cuándo y con qué frecuencia, la distancia recorrida y el tipo preferido de bicicletas eléctricas.",
        "research_questions": [
          "¿Comportamiento de viaje con bicicletas eléctricas?",
          "¿Barreras para el uso y la adopción de bicicletas eléctricas en el suroeste de DC?",
          ""
        ]
      }
    }
  },
sebastianbarry commented 5 months ago

@shankari @Abby-Wheelis I created an issue for my comments!

sebastianbarry commented 5 months ago

The other consideration I wanted to make sure - If someone fills out the form and they (1) include another language in the translations section, and (2) choose default demographics option, then will the labelTemplate field include the "Answered" translation for that language?

  "survey_info": {
    "surveys": {
      "UserProfileSurvey": {
        "formPath": "json/demo-survey-v2.json",
        "version": 1,
        "compatibleWith": 1,
        "dataKey": "manual/demographic_survey",
        "labelTemplate": {
          "en": "Answered",
          "es": "Contestada"
        }
      }
    },

It wasn't a problem on this issue but I just noticed this field as I was going through this PR #64

Abby-Wheelis commented 5 months ago

For the first problem you're having, it looks like in your issues that you did not select a second language in the dropdown, so both the "english" and the "spanish" sections say that they are EN -- we allow people to specify the language code, could you try editing the comment in the auto-generated issue to so it says 'es' under the heading "second language"

This might raise a broader question of if we should change the defaults...

Abby-Wheelis commented 5 months ago

For the second issue, that is going to be a problem - there's a place for people to input the translations in the languages, following a format, but I have managed to hardcode that those translations get slotted in as 'en' and 'es' no matter what the languages are, great catch, thank you! We'll have to re-work the way we handle that in the parsing and probably make those fields required since we need them no matter if it's the default or a custom survey.

shankari commented 5 months ago

@Abby-Wheelis @sebastianbarry I am not sure that we need to support languages beyond en and es in the config. If we have other languages (such as lo), we will need to translate all of the text in the app anyway, and we can just modify the config manually. If we can get this to work reliably for the common US case (en and es only), I think it is a win for now. Once we integrate the app text translation with locize and allow participants to potentially provide us automated translations, we can revisit that decision.

Abby-Wheelis commented 5 months ago

@shankari should I hardcode the two languages as en and es, then? Right now you could technically specify any two langauges from en, es, and lo if you wanted to. Or, should we just know that anything other than the common US case of en and es is going to take more manual review and editing?

shankari commented 5 months ago

@Abby-Wheelis I think we should hardcode en and es and get this rolling for now. We can then design new languages more carefully in a future round.

sebastianbarry commented 5 months ago

@shankari @Abby-Wheelis

Since the first issue I was having was my user error, and the second issue we decided to go with hardcoded values, then this issue is good to close.

I filed a new Issue Form (https://github.com/e-mission/nrel-openpath-deploy-configs/issues/66) and automatic PR (https://github.com/e-mission/nrel-openpath-deploy-configs/pull/67)