From 9811e3b0c46618ac3a438ac923c934650bfc9b2b Mon Sep 17 00:00:00 2001 From: Lorenzo Iovino Date: Mon, 7 Sep 2026 10:55:00 +0200 Subject: [PATCH] fix: le traduzioni non finiscono piu' nel pacchetto, se le genera wordpress.org da translate.wordpress.org --- build.sh | 8 +- includes/block.php | 9 +- ...t_IT-56aefc5f6b9253f9c52d737716d1e4e8.json | 86 ------------------ ...-piazza-in-festa-eventi-editor-script.json | 86 ------------------ languages/piazza-in-festa-it_IT.mo | Bin 2744 -> 0 bytes piazza-in-festa.php | 9 +- 6 files changed, 14 insertions(+), 184 deletions(-) delete mode 100644 languages/piazza-in-festa-it_IT-56aefc5f6b9253f9c52d737716d1e4e8.json delete mode 100644 languages/piazza-in-festa-it_IT-piazza-in-festa-eventi-editor-script.json delete mode 100644 languages/piazza-in-festa-it_IT.mo diff --git a/build.sh b/build.sh index 50e00d8..45bccc0 100755 --- a/build.sh +++ b/build.sh @@ -22,10 +22,12 @@ mkdir -p "$STAGE" # Elenco esplicito invece di una lista di esclusioni: se domani si aggiunge un # file di sviluppo, non finisce nello zip per distrazione. cp piazza-in-festa.php uninstall.php readme.txt LICENSE "$STAGE/" -cp -R includes blocks assets languages "$STAGE/" +cp -R includes blocks assets "$STAGE/" -# Le traduzioni sorgente (.po) non servono a chi installa, il .mo si'. -rm -f "$STAGE/languages/"*.po +# Niente cartella languages: i plugin ospitati su wordpress.org prendono le +# traduzioni da translate.wordpress.org, e la review rifiuta i .po/.mo/.json +# dentro al pacchetto. Il .po italiano resta nel repo solo come sorgente da +# importare li' una volta approvato il plugin. ( cd "$DIST" && zip -qr "$SLUG.zip" "$SLUG" ) rm -rf "$STAGE" diff --git a/includes/block.php b/includes/block.php index 73fcf23..32bb522 100644 --- a/includes/block.php +++ b/includes/block.php @@ -21,11 +21,14 @@ function pinfesta_register_block() { ); // The editor strings live in JavaScript, so they need their own JSON - // catalogue. The handle is read back from the registered block instead of - // being guessed: WordPress builds it from block.json and it can change. + // catalogue: wordpress.org builds it from translate.wordpress.org and drops + // it in the languages folder of the site, which is where WordPress looks + // when no path is passed. The handle is read back from the registered block + // instead of being guessed: WordPress builds it from block.json and it can + // change. if ( $type && ! empty( $type->editor_script_handles ) ) { foreach ( $type->editor_script_handles as $handle ) { - wp_set_script_translations( $handle, 'piazza-in-festa', PINFESTA_DIR . 'languages' ); + wp_set_script_translations( $handle, 'piazza-in-festa' ); } } } diff --git a/languages/piazza-in-festa-it_IT-56aefc5f6b9253f9c52d737716d1e4e8.json b/languages/piazza-in-festa-it_IT-56aefc5f6b9253f9c52d737716d1e4e8.json deleted file mode 100644 index 16fd409..0000000 --- a/languages/piazza-in-festa-it_IT-56aefc5f6b9253f9c52d737716d1e4e8.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "translation-revision-date": "2026-09-04 16:00+0000", - "generator": "manuale (nessun build step)", - "domain": "messages", - "locale_data": { - "messages": { - "": { - "domain": "messages", - "lang": "it_IT", - "plural-forms": "nplurals=2; plural=(n != 1);" - }, - "All categories": [ - "Tutte le categorie" - ], - "No region": [ - "Nessuna regione" - ], - "Events to show": [ - "Quali eventi mostrare" - ], - "Towns": [ - "Comuni" - ], - "Comma separated identifiers, for instance: alba, barolo, la-morra": [ - "Identificativi separati da virgola, per esempio: alba, barolo, la-morra" - ], - "Or a whole region": [ - "Oppure una regione intera" - ], - "Category": [ - "Categoria" - ], - "How many events": [ - "Quanti eventi" - ], - "From 1 to 20.": [ - "Da 1 a 20." - ], - "Look": [ - "Aspetto" - ], - "Theme": [ - "Tema" - ], - "Light": [ - "Chiaro" - ], - "Dark": [ - "Scuro" - ], - "Accent colour": [ - "Colore d'accento" - ], - "Hex code, for instance #b4315a.": [ - "Codice esadecimale, per esempio #b4315a." - ], - "Heading": [ - "Titolo" - ], - "Leave it empty for no heading.": [ - "Lascialo vuoto per non avere titolo." - ], - "Starting height (px)": [ - "Altezza iniziale (px)" - ], - "It adapts by itself once loaded.": [ - "Si adatta da sola appena carica." - ], - "Piazza in Festa: set at least one town or a region in the block settings.": [ - "Piazza in Festa: indica almeno un comune o una regione nelle impostazioni del blocco." - ], - "Layout": [ - "Aspetto" - ], - "List": [ - "Elenco" - ], - "Cards": [ - "Schede" - ], - "Carousel": [ - "Carosello" - ] - } - } -} diff --git a/languages/piazza-in-festa-it_IT-piazza-in-festa-eventi-editor-script.json b/languages/piazza-in-festa-it_IT-piazza-in-festa-eventi-editor-script.json deleted file mode 100644 index 16fd409..0000000 --- a/languages/piazza-in-festa-it_IT-piazza-in-festa-eventi-editor-script.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "translation-revision-date": "2026-09-04 16:00+0000", - "generator": "manuale (nessun build step)", - "domain": "messages", - "locale_data": { - "messages": { - "": { - "domain": "messages", - "lang": "it_IT", - "plural-forms": "nplurals=2; plural=(n != 1);" - }, - "All categories": [ - "Tutte le categorie" - ], - "No region": [ - "Nessuna regione" - ], - "Events to show": [ - "Quali eventi mostrare" - ], - "Towns": [ - "Comuni" - ], - "Comma separated identifiers, for instance: alba, barolo, la-morra": [ - "Identificativi separati da virgola, per esempio: alba, barolo, la-morra" - ], - "Or a whole region": [ - "Oppure una regione intera" - ], - "Category": [ - "Categoria" - ], - "How many events": [ - "Quanti eventi" - ], - "From 1 to 20.": [ - "Da 1 a 20." - ], - "Look": [ - "Aspetto" - ], - "Theme": [ - "Tema" - ], - "Light": [ - "Chiaro" - ], - "Dark": [ - "Scuro" - ], - "Accent colour": [ - "Colore d'accento" - ], - "Hex code, for instance #b4315a.": [ - "Codice esadecimale, per esempio #b4315a." - ], - "Heading": [ - "Titolo" - ], - "Leave it empty for no heading.": [ - "Lascialo vuoto per non avere titolo." - ], - "Starting height (px)": [ - "Altezza iniziale (px)" - ], - "It adapts by itself once loaded.": [ - "Si adatta da sola appena carica." - ], - "Piazza in Festa: set at least one town or a region in the block settings.": [ - "Piazza in Festa: indica almeno un comune o una regione nelle impostazioni del blocco." - ], - "Layout": [ - "Aspetto" - ], - "List": [ - "Elenco" - ], - "Cards": [ - "Schede" - ], - "Carousel": [ - "Carosello" - ] - } - } -} diff --git a/languages/piazza-in-festa-it_IT.mo b/languages/piazza-in-festa-it_IT.mo deleted file mode 100644 index c56739e99b4c224fd18cb32c9a606ce772fff0b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2744 zcmbW2&yO6%6~_x=z-$PP`Ar~DmW^UdJG1@)0*z&%W!ViY?P9}@QRF1DYP)M^D%;)F zuBx8(7)2cT1CSCS!6}F2kW0b=DMt=LToaC*a)tw^2m#84&+DFHH>*TKl&1UBHC^@U z)qAhL{jd9uysc;_xE|*^b(>O4aPf9-v`^uW;Ae0XehKe|t3Occ4mgBI;k6kvxJegmF| z_rW)y`1?C3{=7TmAK}mG{{@QOFQC}_4_tu9SzP8l4o}0AP~x)zHM|BHs$Peu;G0m! z|9QsuX7B$7WuG6wtMDK24R{J?9)*8`?R(h1htJA;oVXwU3f=>2DE|Ex5<>NRDC@lg zAAx^>grSYqPodO`G+9IPBzv4UnSZc}U9lzWi7)f^(Ck6hpEoHxTx{D3?vhK1voy{1 z6E3#c#!&JhH6-mZE{PXq)W-2)D0vp&rT)}%mf0%l%on~1YB|q!8e45A{2BG0OXIe` zUHEKQXQn7@uCF+A>z2{3(rY#*v#5QTk91MTu@5QpxgDtGqF_$4BOjcNYQ==Sz56EG zf^Pd}s#bhi8XawI0)OS&1({mqY^t8NvnQr# zY#ivPqPkosmM}$MA97D7NSbFx_I%ilSefpb>0*~k@==m)oduh-tHM<*)48|pQ}ShB zT@Kply|FLsd@qLzLmlc5$T8u>nl&*IM%!*n%E!!1NKuJnUA-|pk+j(V9+vuQ%Z7;~ zQ@eJ`b7x6yB@@IZfs>Tz)Ah|WYB;u~RYM7}x>{$xlmS${DduHxCHUXiEcMp&-fNU4 zQ5_sU2Krq8Z2#=StG1^8dz*3O^4<&0DE5YapvNiIaj>*hw@1fSJ92RPE-hugN(SE+ zHrF>-_ibZqVTD&5gx+vkQ~Al>OiOiPTy;@rV-twYrK`iW-gEoof~n$;4ZYQh3TF!g z{oJ-o3mc{yHD-hjm#(i57p@ddFhy_8hmta>>b4s%oxiBN$4jRxed3Zncjn^4FM2Qf zk|hVabG+xOUhDb-hqmyPUj8%F3W!&m5@J0nTo*G(MONAsZ7MT=I9iBCT}#=^s2db) zcWmd%F>F%ejPZIdA8IQb+uVwXcuryA=lbD{TAv99gWbfU!WPa4cbOd zrz0KzM@F`?CV2HqWA-;u`j~6b{b<5nMy|^DJiXvL?{bx;t?pPQ{&tJo60?}S7f)1V_nJIOdW1C z_%8b5(0q-&pysW-tQo!rn)6M#F5f5;TqB{X>UDrBSUdz zSZcp0JHE<21x{s2a0yZF5mpm$*x>MfeIY%Mg)iE@z0kjP5kBE;$&XM*bb diff --git a/piazza-in-festa.php b/piazza-in-festa.php index cc6322b..9f05909 100644 --- a/piazza-in-festa.php +++ b/piazza-in-festa.php @@ -11,7 +11,6 @@ * License: GPL-2.0-or-later * License URI: https://www.gnu.org/licenses/gpl-2.0.html * Text Domain: piazza-in-festa - * Domain Path: /languages * * @package PiazzaInFesta */ @@ -47,11 +46,9 @@ require_once PINFESTA_DIR . 'includes/shortcode.php'; require_once PINFESTA_DIR . 'includes/block.php'; require_once PINFESTA_DIR . 'includes/settings.php'; -// Translations are not loaded by hand: WordPress finds them on its own, both -// the ones from translate.wordpress.org and the bundled ones in /languages -// (Domain Path in the header above). Verified on WordPress 7.1 with an it_IT -// site: calling load_plugin_textdomain() changes nothing and Plugin Check -// flags it as discouraged since 4.6. +// Translations are neither loaded by hand nor shipped inside the plugin: +// wordpress.org builds them from translate.wordpress.org and WordPress picks +// them up on its own, since 4.6, without load_plugin_textdomain(). /** * Registers the front end assets.