JavaScript strings are never translated, as `wp_set_script_translations` is never called
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- php, typescript, wordpress
- Área
- frontend, internationalization
Línea de trabajo
Empieza inspeccionando las rutas de enqueue en class-editor-sidebar.php, class-dashboard-widget.php, class-post-list-stats.php, class-recommended-widget.php y el código del dashboard y de telemetría. Comprueba cada script handle encolado manualmente y verifica la reproducción en Post Editor con un locale del sitio traducido. Se considera terminado cuando las cadenas de JavaScript de esas superficies están traducidas y el bloque existente de Recommendations y las traducciones de PHP siguen funcionando.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
The plugin marks its JavaScript strings as translatable and declares Text Domain: wp-parsely, but never calls wp_set_script_translations() for any script it enqueues itself. That call is what loads the .json translation files WordPress delivers for JavaScript, so without it every one of those strings renders in English regardless of the site's language.
There are 359 __() and 7 _n() calls across 74 TypeScript files. By surface:
| Location | Calls | Translated? |
|---|---|---|
src/content-helper |
333 | No |
src/js |
4 | No |
src/blocks |
22 | Yes |
The Recommendations block is fine because it is registered through register_block_type() with a block.json carrying "textdomain": "wp-parsely", and WordPress wires up script translations automatically in that case. Every other surface is enqueued by hand:
class-editor-sidebar.php— the Content Intelligence Editor Sidebarclass-dashboard-widget.phpclass-post-list-stats.phpclass-recommended-widget.php- the dashboard page and telemetry scripts
None of them follow their wp_enqueue_script() with a wp_set_script_translations().
PHP strings are unaffected — those load normally.
To Reproduce
- Set the site language to any locale with a
wp-parselytranslation. - Open the Post Editor and expand the Parse.ly sidebar.
- Every label, button and message is in English, while the surrounding WordPress UI is translated.
Expected behavior
Strings marked translatable are translated. For a wp.org-distributed plugin this needs no build step and no .pot in the repository — WordPress downloads the JSON from translate.wordpress.org, and each enqueued handle needs:
wp_set_script_translations( static::get_script_id(), 'wp-parsely' );
If translating the JavaScript UI is deliberately not a goal, the opposite is worth doing: the __() wrappers are misleading as they stand, since they imply a translation path that does not exist.
Environment
- wp-parsely 3.23.7 and earlier
Additional context
This is the mechanism behind #4546. The tone and persona labels were always marked translatable, but lived in JavaScript where translation is inert, so they were always English in practice. #4492 makes PHP the source of that vocabulary, where translation does work — which is what turned Formal into Formell and made a long-dormant inconsistency suddenly depend on the site's locale.
- Lenguaje dominante
- PHP
- Estrellas
- 67
- Forks
- 38
- Merge medio
- 1 d 5 h
- PR fusionados (30 d)
- 79
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Parsely/wp-parsely
-
Bug Feature: Engagement Boost wp-parsely
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Parsely/wp-parsely#4856 ·
Los mantenedores suelen responder en 1 día
-
Bug Feature: Engagement Boost wp-parsely
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Parsely/wp-parsely#4855 ·
Los mantenedores suelen responder en 1 día
-
Bug Feature: Engagement Boost wp-parsely
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Parsely/wp-parsely#4854 ·
Los mantenedores suelen responder en 1 día
-
wp-parsely
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Parsely/wp-parsely#4753 ·
Los mantenedores suelen responder en 1 día
-
Bug wp-parsely
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
Parsely/wp-parsely#4663 ·
Los mantenedores suelen responder en 1 día
Todos los issues de Parsely/wp-parsely
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
-
area/import type/enhancement when/later
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
parime/glpi-iso27001-management#1165 ·
Los mantenedores suelen responder en 1 día
-
15.0
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
opnsense/plugins#5976 · 1 comentario ·
Los mantenedores suelen responder en 1 día