Make block translatable
-
Hi,
Currently rebuilding my block to support Block API version 3 and have a question about making the block translatable.
In
edit.jsI import support:import { __ } from '@wordpress/i18n';The dependency is added to my
index.assetfile:array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-server-side-render'), 'version' => '123456789');I add a translatable string like:
label={ __( 'Attributes', 'text-domain' ) }Should I do more, or does WP generate the proper language pack files now?
I normally include a POT file generated with Poedit (free version), but it does not index theedit.jsfile. So I’m in doubt.Guido
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.