Home Forums Basel support forum Translation for specific text blocks

Translation for specific text blocks

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #129118

    [email protected]
    Participant

    Hey there,

    how can we translate (also see red markings in pictures):
    1. Title search bar text
    2. Text in cart (when empty)

    We have read the documentation and your standard solution, but it doesn’t work.

    Where can we find these text blocks to change them?

    Thanks
    Ben

    Attachments:
    You must be logged in to view attached files.
    #129127

    Hello,

    Please follow the steps to get the fix:

    1. Please upload the file from this link: https://drive.google.com/file/d/17pRyCpJdReyl_wWyoTduwTUoQQqLkvGT/view?usp=sharing

    2. Upload it into this folder deleting the previous one wp-content\themes\basel\languages\basel.pot

    3. Find this file wp-content\themes\basel\inc\template-tags.php and replace the code shown on the screen: http://prntscr.com/o2s9ji

    basel_header_block_search_extended()
    
    switch ( $search_post_type ) {
    	case 'product':
    		$placeholder = esc_attr_x( 'Search for products', 'basel' );
    		$description = esc_html__( 'Start typing to see products you are looking for.', 'basel' );
    	break;
    
    	case 'portfolio':
    		$placeholder = esc_attr_x( 'Search for projects', 'basel' );
    		$description = esc_html__( 'Start typing to see projects you are looking for.', 'basel' );
    	break;
    
    	default:
    		$placeholder = esc_attr_x( 'Search for posts', 'basel' );
    		$description = esc_html__( 'Start typing to see posts you are looking for.', 'basel' );
    	break;
    }
    
    switch ( $search_post_type ) {
    	case 'product':
    		$placeholder = esc_attr_x( 'Search for products', 'placeholder', 'basel' );
    		$description = esc_html__( 'Start typing to see products you are looking for.', 'basel' );
    	break;
    
    	case 'portfolio':
    		$placeholder = esc_attr_x( 'Search for projects', 'placeholder', 'basel' );
    		$description = esc_html__( 'Start typing to see projects you are looking for.', 'basel' );
    	break;
    
    	default:
    		$placeholder = esc_attr_x( 'Search for posts', 'placeholder', 'basel' );
    		$description = esc_html__( 'Start typing to see posts you are looking for.', 'basel' );
    	break;
    }

    Synchronize the translations.

    In order to translate the text for the empty cart, navigate to the Theme Settings > Shop

    Best Regards

    #129195

    [email protected]
    Participant

    Worked, thanks 🙂

    #129259

    You are welcome! If you have any questions please feel free to contact us.

    Best Regards

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Translation for specific text blocks’ is closed to new replies.