The first argument $handle of wp_set_script_translations() expects the script handle the text domain will be attached to. In your case it’s simpletoc and not simpletoc-js.
The correct call would be:
wp_set_script_translations( 'simpletoc', 'simpletoc' );
Another note: wp_set_script_translations() is available since WordPress 5.0 thus the function_exists() check isn’t necessary.
Related Posts:
- How should you internationalize javascript spread in multiple files but build in one?
- How to set the localization for a Gutenberg block?
- Using wp_set_script_translations without manually registering the script
- Issue with translation – Gutenberg
- Localising a Block
- Remove block styles in the Block Editor
- Are there ways to make the Gutenberg editor wider? And the HTML-block higher?
- Blocks: set a default value for a TextControl
- Is there a list / reference for all current native WordPress blocks?
- Setting default font family with theme.json
- (Gutenberg Block Editor) Using editor.BlockEdit filter, need to alter html/ CSS class of BlockEdit Component
- Required (mandatory) Gutenberg block
- Add classname to Gutenberg block wrapper in the editor?
- How to develop custom blocks without triggering validation errors
- get selected categories or tags (using javascript) in GutenBerg?
- Help with using getBlockIndex
- Gutenberg blocks – processing server data within a block
- Best practices for CPT without using an editor [closed]
- Custom Gutenberg block is not showing up in inserter dialog
- Gutenberg – Custom blocks onClick not working?
- Get blocks from other pages, from within current page
- Your site doesn’t include support for the block… after registering a block
- .editor-styles-wrapper overriding my block styles in Gutenberg
- Remove a component fill from a Block Editor panel
- How to wrap the Gutenberg editor in a custom React component?
- Proper way to reload or update getEntityRecords state
- Cannot embed YouTube video
- Add a button to the toolbar of an existing Gutenberg block
- JSON File in Gutenberg
- Show date post published in Gutenberg component
- Adding an html wrapper to a custom Block Pattern
- How to add a class to the element in a custom Gutenberg block
- Specify exact parent child relationship between two blocks
- Using custom Entities to retrieve external data in the Block Editor
- Insert SVG code (not img) in HTML block
- How to enable Block Editor on the Posts page
- React to a change of the block alignment
- Object type for block Attribute (Gutenberg)
- Custom Gutenberg Block: How to return plain HTML with save(), without escaping?
- Removing advanced section from brand new gutenberg block
- How to allow to add gradients to core/heading block?
- Gutenberg: How to update associated Terms of Custom Taxonomy to Current Post
- Gutenberg: How to float core table block in front-end of site?
- Guttenberg Implementation on Front Page
- Register multiple styles / scripts in register_block_type
- How to automatically remove noreferrer from targetd link rel attribute, on render?
- Should there be concern about breaking Gutenberg updates to extended core blocks?
- reload the gutenberg editer on taxonomy change
- Gutenberg Block Get Author Details
- Gutenberg Block Toolbar – remove button
- Is it possible (safe) to create custom blocks using ES Next format?
- How to prevent Block Editor from adding id to block markup in save function?
- How do I make sure the gutenberg block CSS is not disrupted by generic styles?
- Custom block Block Validation failure w/ deprecation declared
- Working with external library in gutenberg block
- Download Image from URL and Create a new Folder in wp-contents and save them there
- Detect selected block pattern from a specific Pattern category
- How to add a message when post category is empty (the category have no published posts)?
- Add javascript file to a block pattern
- Block editor not recognizing markdown
- Can’t add front end script file using block.json for a custom block
- How to get the Gutenberg image block to show new Media Library listing
- useSelect in event callback – not retrieving value on time
- How to Batch Convert Gutenberg post to Classic post?
- How to create pre-designed page layouts for Gutenberg?
- How can I display instagram block with parse_block?
- Do not wrap custom block in an additional DIV but instead use only the JSX I provide
- Line break in Gutenberg post title?
- Basic Block Usage Help on WordPress
- Can’t extend my custom gutenberg block
- How to Stop Gutenberg From Adding Classic Block
- How to increase width of code block in WordPress blog?
- Video, embed, html block usage out of the_content
- applyformat in gutenberg doesnt work and no errors
- Why does Gutenberg adds 4 around blocks? And how to change this?
- admin_notices not shown
- Layout Settings in the new Gutenberg editor
- How to get blocks with same heigh in columns?
- Gutenberg: Issue trying to commit locally
- Get postId in a wordpress pattern file?
- Remove placeholder from core/image in InnerBlocks template
- Gutenberg block not displaying prop values
- ACF InnerBlocks breaks css grid, How can we add classes to allowedblocks (WordPress Gutenberg)
- How to disable block directory?
- Adding custom link text to a URLInputButton
- Rearrange order of block into a block category gutenberg
- Gutenberg Block Deprecation – Handling old viewScript and styles
- Resaving posts to update static blocks
- How to dynamically add style tags to Gutenberg editor in react
- When to use the second parameter to useSelect?
- How to set autoload from “yes” to “no” _transient_wp_core_block_css_files
- Consistent inline styling in a Gutenberg-paragraph-block
- Add additional scripts and markup in the section of default Gutenberg theme
- How can i extend the existing Block Inspector Tabs in WordPress Gutenberg Editor?
- How can I lock innerblocks but not it’s content?
- Responsive rules with block themes and theme.json
- WordPress 6.4 – How to select a different menu I have created?
- Prevent block variation inside certain parent blocks
- how can I properly extend the gutenberg terms block?
- How to set background color of template part in Site Editor?