TigriWeb Components
AttributesControlsMetaPrimitivesIntegrations
  • Table of Contents
  • Attributes
    • Checkbox
    • Color
    • ColorGradient
    • DateTime
    • Icon
    • Media
    • Number
    • PostType
    • PostTypeMultiple
    • Radio
    • Range
    • Select
    • Taxonomy
    • TaxonomyMultiple
    • Text
    • Textarea
    • Toggle
    • ToolbarButton
    • ToolbarGroup
  • Controls
    • AppenderButton
    • Media
    • RichHeading
    • RichText
  • Meta
    • Checkbox
    • Color
    • DateTime
    • Icon
    • Media
    • Number
    • PostType
    • PostTypeMultiple
    • Radio
    • Range
    • Select
    • Taxonomy
    • TaxonomyMultiple
    • Text
    • Textarea
    • Toggle
  • Primitives
    • HTML
    • SVG
  • Integrations
    • Enqueue SVG icons
    • Enqueue I18n strings
Powered by GitBook
On this page

Was this helpful?

  1. Integrations

Enqueue I18n strings

Some of our components require translation for non-English sites.

You can add the following code in function.php file:

if ( ! function_exists( 'tweb_translate_components' ) ) :

	function tweb_translate_components() {
		wp_localize_script( 'wp-blocks', 'twebI18n', array(
			'searchIcon'       => _x( 'Search Icon', '@tigriweb/components', 'your-theme-name' ),
			'removeIcon'       => _x( 'Remove Icon', '@tigriweb/components', 'your-theme-name' ),
			'removeImage'      => _x( 'Remove Image', '@tigriweb/components', 'your-theme-name' ),
			'removeMedia'      => _x( 'Remove Media', '@tigriweb/components', 'your-theme-name' ),
			'toggleMedia'      => _x( 'Toggle Media', '@tigriweb/components', 'your-theme-name' ),
			'editLink'         => _x( 'Edit Link', '@tigriweb/components', 'your-theme-name' ),
			'openMediaLibrary' => _x( 'Open Media Library', '@tigriweb/components', 'your-theme-name' ),
			'heading'          => _x( 'Heading', '@tigriweb/components', 'your-theme-name' ),
			// translators: %s is replaced with the heading tag | H1-H6
			'headingTag'       => _x( 'Heading %s', '@tigriweb/components', 'your-theme-name' ),
		) );
	}

endif;

add_action( 'enqueue_block_editor_assets', 'tweb_translate_components' );
PreviousEnqueue SVG icons

Last updated 7 months ago

Was this helpful?