kas-catholic / confessit-web

Source code for https://confessit.app
MIT License
18 stars 7 forks source link

Some Translated Links are Broken #39

Closed kas-catholic closed 1 year ago

kas-catholic commented 1 year ago

Some translated links are broken. For example, compare this:

https://github.com/kas-catholic/confessit-web/blob/757929d70ae7bd913ee007238f6666861a0692ed/src/About.js#L17-L22

To the page at https://confessit.app/about.

The link is being set to the empty string.

It took some trial and error to debug this, but I figured out what's happening. Our translations use indexes to nest elements inside the string.

https://github.com/kas-catholic/confessit-web/blob/757929d70ae7bd913ee007238f6666861a0692ed/public/locales/en/translation.json#L46

Some of these indexes changed when I ran prettier. Prettier injected some {" "} elements to allow newlines in the source (which does make it look nice) while preserving spacing around elements. Because these are also nested elements, it changed the indexing. (https://github.com/kas-catholic/confessit-web/pull/28) So the <1> in our translated strings is no longer being injected inside the <a> tag because the <a> tag is no longer index 1.

kas-catholic commented 1 year ago

@JohnRDOrazio I have a solution for this - see https://github.com/kas-catholic/confessit-web/pull/40 as a proposed solution. (I'll have to do a similar thing in a few more places.) Wanted to give you a heads up since this will affect some translations. Based on translation systems I'm familiar with, I'd assume we can commit the new strings in the en (source) translation, but will need to fix the others using weblate? (I can commit fixes in weblate too, just want to make sure I understand the workflow correctly.)

kas-catholic commented 1 year ago

Fixed by #40