GenderDysphoria/GenderDysphoria.fyi

Tweet translation

gjvnq opened this issue · 2 comments

gjvnq commented

I figured out a pretty cool way to allow for translations for the tweets: I set up another JSON file (twitter-i18n.json) that contains the translations and adapted the JS files to properly consider this new data source.

See the code I made in the following two commits:

gjvnq@ef0511f
gjvnq@b5a7b54

So a couple notes on the way this is built...
twitter-backup exists to be a raw archive of the tweet data as it arrived from the API. The only time I ever make modifications to it manually is if a tweet is deleted and I want to fix some bad urls. So that's not the right place to be putting language updates. Secondly, my goal with the structure is to have everything language related exist inside that language's directory, so the tweet translations for pt need to exist inside public/pt.

To that end, the approach I was planning to do was have a twitter.json file which be merged onto the twitter-cache data file for that language.

What I think may need to happen is create an actual tweet helper instead of just importing a template. Then the helper can handle both the loading of the tweet info and the language processing, and I can eliminate the tweets metadata import need.

gjvnq commented

Closed because of #96 was merged.