[wp-trac] [WordPress Trac] #58848: `wp_set_script_translations` only sets translations for the default language

WordPress Trac noreply at wordpress.org
Fri Jul 28 16:16:08 UTC 2023


#58848: `wp_set_script_translations` only sets translations for the default
language
-------------------------------+------------------------------
 Reporter:  dathix             |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  I18N               |     Version:  6.2
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by swissspidy):

 > The function seems to only registers the German translations from the
 JSON files. As a test, I deleted the JSON files for the German translation
 and tried to only register the French ones but in this case, the function
 returns false and I am still getting the English strings. The default
 language of the site is set to German (de_CH) and the site uses WPML.

 Not sure I follow. When you use this function, WordPress just loads the
 translations for the currently active locale.
 If your locale is set to de_CH, WP does not load any French translations.
 That‘s by design.

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


More information about the wp-trac mailing list