Admin Notice is only localized when displaying the “Plugins” Backend Page

Note: Revised because that ‘__FILE__’ as in dirname(plugin_basename(‘__FILE__’)), was just a typo in the post/question. But one thing you did not include in your post, is about how are you loading the Bootstrapping class, and where is the file located? Is it in a subfolder like includes, i.e. your-plugin/ includes/ class-bootstraping.php languages/ your-plugin.pot your-plugin.php (main … Read more

React Plugin Settings Page Localization

adds an admin menu page with a div that React replaces, but the localization inside this React doesn’t work Actually, since you are enqueueing the same script (build/index.js), which is automatically registered by register_block_type(), then in your my_enqueue_admin_scripts() function, just do wp_enqueue_script( ‘my-block-local-editor-script’ ) to enqueue/load the script on your admin menu page. And secondly, … Read more

Localising a Block

There are 2 main issues in your code: As stated in my answer, the script handle format is <block name with slashes replaced with hypens>-editor-script, so because your block name is my-block/local, then the script handle is my-block-local-editor-script and not my-block-local-edit-script. The correct action name is wp_enqueue_scripts (note the “s”) and not wp_enqueue_script. However, wp_enqueue_scripts … Read more