SidewalkWebpage icon indicating copy to clipboard operation
SidewalkWebpage copied to clipboard

Centralize our translations

Open misaugstad opened this issue 2 years ago • 0 comments

Brief description of problem/feature

There are three issues here:

  1. The front end and back end have different internationalization methods, and don't share translations. So some translations are straight up duplicates.
  2. Translations on the front end are split across multiple files, and this makes it more difficult for our partners to create/edit translations. It's good for modular code and such, but harder for our partners to provide translations.
  3. Key phrases can also be duplicated because they occur within a larger sentence or paragraph that we use elsewhere. The obvious example is that we use the phrase "curb ramp" in a lot of locations, so we ultimately end up having our partners translate "curb ramp" 10 times if they translate everything.
Potential solution(s)
  1. I have not spent enough time looking into whether we can import the same format from our back end translations in JavaScript. Unfortunately I also don't think that we even have access to those translations on the front end by default? But I haven't played around with either of these. We might also find some way to pass those translations to the front end on page load, but that feels messy. There are also potentially complete overhauls to how we do translations that sit outside of the Play Framework that are more "all in one" solutions (I assume).
  2. I haven't looked into possible solutions on this end either... But one easy-ish thing to do would be to just have a script in the build process that combines all the translations into a single file. That way, we could point our partners to that one file, even though I would have to separate things out into their own files when actually incorporating into the code. There might also be some out of the box solutions that I don't know about here.
  3. This one is pretty hard to fix. You can include translations inside of other ones, so I've done a bit of this in English and Spanish. I just don't feel comfortable doing that in other languages, since I don't know grammar rules. In addition, doing this means fewer copies of the same words, but it also make it more confusing for translators if they aren't very technical. Ultimately, I'm hoping that addressing (2) will be good enough :)

misaugstad avatar Aug 18 '23 18:08 misaugstad