poepublic / shareabouts-pbboston

GNU General Public License v3.0
0 stars 1 forks source link

Map visitors can translate static and user generated content into a language they're comfortable with #5

Closed mjumbewu closed 5 months ago

mjumbewu commented 11 months ago

User Story

As a non-english speaking Boston resident, I want to see a translate interface similar to other Boston pages, so that I can get the map content in a language I'm comfortable with in a manner that I am familiar with through Boston's other digital experiences (e.g., use the same top-right corner widget as at https://www.boston.gov/public-notices/16058551. Pull the same google translate library that they're using).

Acceptance Criteria

mjumbewu commented 8 months ago

Need to either:

  1. enable CORS for the google translate domains (https://participate--staging-boston-gov.translate.goog/): https://www.stackhawk.com/blog/django-cors-guide/#enabling-cors-in-django, or
  2. use the Google Translate API to translate page content. Note this would probably mean incorporating into both the Shareabouts Client and the Shareabouts API, as the API data would need to be translated as well. For the client, The JS templates are the trickiest bit. Maybe there's a way we can use the Translate API (or some other service) to pre-generate .po files. Then the integration would primarily be on the Shareabouts API side.
mjumbewu commented 5 months ago

Ended up removing the CSRF requirement for the API endpoints. Not my favorite solution, but it will work given that CORS is still in effect.