`wp_set_script_translations` with `wp.i18n` does not return translated strings in simple plugin

I have no words 🤦‍♂️

A simple change

  • dirname(plugin_basename(__FILE__)) . '/languages/' inside wp_set_script_translations() function (3rd argument)

to

  • plugin_dir_path(__FILE__) . 'languages/'

fixed the problem

Leave a Comment