WordPress / wordcamp.org

WordCamps are casual, locally-organized conferences covering everything related to WordPress.
https://wordcamp.org
127 stars 69 forks source link

Blocks: JS is not translated in the frontend #1096

Open Soean opened 10 months ago

Soean commented 10 months ago

Describe the bug

We want to use the Live schedule block. We have a translation, but the string "View Full Schedule" is not translated in the frontend

Code: https://github.com/WordPress/wordcamp.org/blob/production/public_html/wp-content/mu-plugins/blocks/source/blocks/live-schedule/block.js#L69

German translation: https://translate.wordpress.org/projects/meta/wordcamp/de/default/?filters%5Bstatus%5D=either&filters%5Boriginal_id%5D=8790347&filters%5Btranslation_id%5D=71638046

To reproduce

Got to: https://germany.wordcamp.org/2023/

ryelle commented 1 month ago

I looked into this issue https://github.com/WordPress/wordcamp.org/issues/1346 — and I think they're the same cause. The translations are hooked up correctly, but it's trying to load files that doesn't exist:

wp-content/languages/mu-plugins/wordcamporg-[locale]-763eba5ec6581bd80f00a75e2e1999aa.json
wp-content/languages/mu-plugins/wordcamporg-[locale]-700c0ec139240c0b015f4cfb987d7f31.json

I'm not sure if this is an issue in how the translation files are generated or some other issue due to these blocks being in mu-plugins. I think we need to add a maybeUpdateJSON step to wordcamp's bin/bash/lang-update.sh to match dotorg's (in website/bin/language-update/lang-update.sh). the wporg-translate export-json command will need to be updated to process mu-plugins too.

I've removed "Good First Issue" since this will require a dotorg sandbox.

eduardozulian commented 3 weeks ago

@ryelle, can you confirm if https://github.com/WordPress/wordcamp.org/issues/1299 is the same issue? I think so, but I wanted to check with you first. Thanks!