[wp-trac] [WordPress Trac] #62462: Reconsider _doing_it_wrong warning when loading translations early

WordPress Trac noreply at wordpress.org
Tue Dec 17 19:38:02 UTC 2024


#62462: Reconsider _doing_it_wrong warning when loading translations early
-------------------------------+---------------------
 Reporter:  TimothyBlynJacobs  |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  6.7.2
Component:  I18N               |     Version:  6.7
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:
-------------------------------+---------------------

Comment (by brianhogg):

 > And to clarify, this change doesn't "break translations". It's just a
 notice. Translations still continue to be loaded, even if you do it too
 early.

 This isn't true, from numerous support tickets and fixes I've been making
 since WP 6.7. When the notice is shown, the translations for that text
 domain no longer load. This is even more problematic when other plugins
 try to use a translation string from another plugin's text domain causing
 the translations to fail.

 As an example, you can see this by installing and activating LifterLMS
 7.8.6 on a Spanish site, and the translations for the entire setup wizard
 do not load due to loading a couple strings early in the constructor of
 the setup wizard class. With the latest version 7.8.7 this is
 [https://github.com/gocodebox/lifterlms/blob/b612d6410b2977041b548a29fac307041e96eab8/includes/admin/class.llms.admin.setup.wizard.php#L252-L255
 delayed until `init`] and the translations load once again. If it was just
 a notice that'd be great, it's the breaking of translations with no
 previous `_doing_it_wrong` notices in prior versions of WP that's the
 issue.

 Could we look into making this a warning only then as a first step?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62462#comment:30>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list