Translation loading for the riverbank domain is triggered too early (WordPress 6.7+)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 74/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- php
- Ambito
- internationalization
Direzione di ricerca
Inizia dalla classe Block_Patterns: il suo costruttore e il metodo run(), più la chiamata Core::get_instance() in functions.php che attiva il caricamento anticipato. Riproduci su WordPress 6.7+ con WP_DEBUG_LOG attivo e controlla wp-content/debug.log per l'avviso _load_textdomain_just_in_time. Completato quando una richiesta con un file di traduzione riverbank non registra alcun avviso.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
On WordPress 6.7 and later, every request on a site that has a Riverbank translation logs:
PHP Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the riverbank domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. (This message was added in version 6.7.0.)
Cause: functions.php calls Core::get_instance() while the theme loads. The Core constructor creates Block_Patterns, whose constructor calls setup_properties(), which runs __( 'Riverbank Patterns', 'riverbank' ) before after_setup_theme.
Fix: the same as Jaxon 1.0.9 (Codeinwp/jaxon commit c7f8818) and Neve FSE (Codeinwp/neve-fse#170): move $this->setup_properties(); from Block_Patterns::__construct() into run(), which runs on init.
Reproduce:
- WordPress 6.7 or later with
WP_DEBUGandWP_DEBUG_LOGon, Riverbank 1.0.18 active. - Put any translation file for the theme at
wp-content/languages/themes/riverbank-<locale>.moand use that locale (an emptyriverbank-en_US.moon an English site is enough). - Load any page.
Expect: no notice. Actual: the notice above in wp-content/debug.log on every request.
Found by the WordPress compatibility routine (Codeinwp/qa-compatibility): Riverbank 1.0.12 logs nothing on WordPress 6.6.12 and logs the notice on 6.7; 1.0.18 logs it on 7.0.8, 7.1.5 and 7.2-RC2.
- Lingua principale
- PHP
- Stelle
- 2
- Fork
- 0
- Merge medio
- 4h 59m
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Codeinwp/riverbank
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug customer report
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
customer report new feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Tutte le issue di Codeinwp/riverbank
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
sync-en
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
sync-en
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Перевод устарел
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nplhse/collaborative-ivena-statistics#1464 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno