Allow translation for default header text

[ad_1]

In wp-content/plugins/advanced-gutenberg/assets/blocks/blocks.js:6410
You used Header Text as default text, this text in english appears even if we used another language in back office.
For no english webmaster is not great.
Can you allow to translate this default text ( and others)

I find how to use my proper text in fallback, but it’s not ideal.
I used this javascript code call in gutenberg to override the registerBlockType Settings for my french webmaster:

function alterHeaderDefaultText( settings, name ) {
    if ( name !== 'advgb/accordion-item') {
        return settings;
    }

    
        return lodash.assign( {}, settings, {
            attributes: lodash.assign( {}, settings.attributes, {
                header: {
                    type: 'string',
                    default: 'Entête'
                },
            } ),
        } );
    

}

wp.hooks.addFilter(
    'blocks.registerBlockType',
    'back-custom/gutenberg-alteration',
    alterHeaderDefaultText
);

Thanks.

  • This topic was modified 2 hours, 57 minutes ago by ccaron.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer