New Landing How can we help? Atelier Choose An Option Slideout Problem

Viewing 14 posts - 1 through 14 (of 14 total)
  • Posted in: Atelier
  • #285741
    mcener
    Member
    Post count: 44

    Hello,
    I am having trouble with “Choose an option” slideout in the single product page…
    I used PoEdit and translated the whole website. However after the last update I can’t get the text to change to the way I want…
    I looked tried to find the php file of the original source but no luck…
    What I want is “Beden Seçiniz” to show instead of half Turkish half English “Choose a Beden”
    Beden is a Turkish word for size…

    Thank you for the assistance, amazing theme, great support 🙂

    Attachments:
    You must be logged in to view attached files.
    #285867
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please paste this code at functions.php of child theme.

    function sf_text_strings( $translated_text, $text, $domain ) {
    	switch ( $translated_text ) {
    		case 'Choose an option' :
    			$translated_text = __( 'Change me', $domain );//just change it
    			break;
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'sf_text_strings', 20, 3 );

    Thanks
    Mohammad

    #285895
    mcener
    Member
    Post count: 44

    You are a star thank you for the reply
    This is the code I want to insert in the child theme functions.php

    function sf_text_strings( $translated_text, $text, $domain ) {
    	switch ( $translated_text ) {
    		case 'Choose an option' :
    			$translated_text = __( 'Beden Seçiniz', $domain );//just change it
    			break;
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'sf_text_strings', 20, 3 );

    This is the child theme functions.php but I don’t know which part should I insert the code… Sorry for being a noob 🙂
    Can you please insert it for me so I don’t make any mistakes?
    Thanks

    <?php
    	
    	/*
    	*
    	*	Atelier Functions - Child Theme
    	*	------------------------------------------------
    	*	These functions will override the parent theme
    	*	functions. We have provided some examples below.
    	*
    	*
    	*/
    	
    	/* LOAD PARENT THEME STYLES
    	================================================== */
    	function atelier_child_enqueue_styles() {
    	    wp_enqueue_style( 'atelier-parent-style', get_template_directory_uri() . '/style.css' );
    	
    	}
    	add_action( 'wp_enqueue_scripts', 'atelier_child_enqueue_styles' );
    	
    	
    	/* LOAD THEME LANGUAGE
    	================================================== */
    	/*
    	*	You can uncomment the line below to include your own translations
    	*	into your child theme, simply create a "language" folder and add your po/mo files
    	*/
    	
    	// load_theme_textdomain('swiftframework', get_stylesheet_directory().'/language');
    	
    	
    	/* REMOVE PAGE BUILDER ASSETS
    	================================================== */
    	/*
    	*	You can uncomment the line below to remove selected assets from the page builder
    	*/
    	
    	// function spb_remove_assets( $pb_assets ) {
    	//     unset($pb_assets['parallax']);
    	//     return $pb_assets;
    	// }
    	// add_filter( 'spb_assets_filter', 'spb_remove_assets' );	
    
    	/* ADD/EDIT PAGE BUILDER TEMPLATES
    	================================================== */
    	function custom_prebuilt_templates($prebuilt_templates) {
    			
    		/*
    		*	You can uncomment the lines below to add custom templates
    		*/
    		// $prebuilt_templates["custom"] = array(
    		// 	'id' => "custom",
    		// 	'name' => 'Custom',
    		// 	'code' => 'your-code-here'
    		// );
    
    		/*
    		*	You can uncomment the lines below to remove default templates
    		*/
    		// unset($prebuilt_templates['home-1']);
    		// unset($prebuilt_templates['home-2']);
    
    		// return templates array
    	    return $prebuilt_templates;
    
    	}
    	//add_filter( 'spb_prebuilt_templates', 'custom_prebuilt_templates' );
    	
    //	function custom_post_thumb_image($thumb_img_url) {
    //	    
    //	    if ($thumb_img_url == "") {
    //	    	global $post;
    //	  		ob_start();
    //	  		ob_end_clean();
    //	  		$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
    //	  		if (!empty($matches) && isset($matches[1][0])) {
    //	  		$thumb_img_url = $matches[1][0];
    //	    	}
    //	    }
    //	    
    //	    return $thumb_img_url;
    //	}
    //	add_filter( 'sf_post_thumb_image_url', 'custom_post_thumb_image' );
    	
    //	function dynamic_section( $sections ) {
    //        //$sections = array();
    //        $sections[] = array(
    //            'title'  => __( 'Section via hook', 'redux-framework-demo' ),
    //            'desc'   => __( '<p class="description">This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.</p>', 'redux-framework-demo' ),
    //            'icon'   => 'el-icon-paper-clip',
    //            // Leave this as a blank section, no options just some intro text set above.
    //            'fields' => array()
    //        );
    //        return $sections;
    //    }
    //	
    	
    //	function custom_style_sheet() {
    //	    echo '<link rel="stylesheet" href="'.get_stylesheet_directory_uri() . '/test.css'.'" type="text/css" media="all" />';
    //	}
    //	add_action('wp_head', 'custom_style_sheet', 100);
    	
    
    	// function custom_wishlist_icon() {
    	// 	return '<i class="fa-heart"></i>';
    	// }
    	// add_filter('sf_wishlist_icon', 'custom_wishlist_icon', 100);
    	// add_filter('sf_add_to_wishlist_icon', 'custom_wishlist_icon', 100);
    	// add_filter('sf_wishlist_menu_icon', 'custom_wishlist_icon', 100);
    #285905
    mcener
    Member
    Post count: 44

    Update: I tried it several times in several versions and pasted in several different sections withing the child functions.php but it is not working
    AND the correct translation that I want to work is:

    function sf_text_strings( $translated_text, $text, $domain ) {
    	switch ( $translated_text ) {
    		case 'Choose a Beden' :
    			$translated_text = __( 'Beden Seçiniz', $domain );//just change it
    			break;
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'sf_text_strings', 20, 3 );

    Life is painful when codes don’t work 🙁
    Thank you

    #286114
    David Martin – Support
    Moderator
    Post count: 20834

    This string would not be in the theme .po file, rather the WooCommerce plugin translation folder. Have you translated the .po file for the WooCommerce plugin?

    Thanks.

    #286170
    mcener
    Member
    Post count: 44

    Yes sir I did. I translated woocommerce with PoEdit and upload the translation to the ftp folder…

    #286333
    David Martin – Support
    Moderator
    Post count: 20834

    Could you add your FTP details so I can take a look?

    – David.

    #286946
    mcener
    Member
    Post count: 44
    This reply has been marked as private.
    #287157
    David Martin – Support
    Moderator
    Post count: 20834

    Can you please activate the child theme.

    Copy the /language/ folder from the parent theme into the child theme and then add this to the child theme functions.php file.

    // Load translation files from your child theme instead of the parent theme
    function my_child_theme_locale() {
        load_child_theme_textdomain( 'swiftframework', get_stylesheet_directory() . '/language' );
    }
    add_action( 'after_setup_theme', 'my_child_theme_locale' );
    #287180
    mcener
    Member
    Post count: 44

    I did everything you instructed sir but still can’t see the result I want

    Attachments:
    You must be logged in to view attached files.
    #287368
    mcener
    Member
    Post count: 44

    🙁

    #287595
    David Martin – Support
    Moderator
    Post count: 20834

    Perfect, now it’s really easy to amend the translation.

    1) Navigate to themes/atelier-child/language
    2) Download atelier.pot and open with POEdit.
    3) Create a new language file from this and save as tr_TR.po. Once you have finished adding your translations, create compile a .mo file also. POEdit => File => Compile As MO.
    4) Upload both to themes/atelier-child/language.

    Two example files I created using the above method: https://dl.dropboxusercontent.com/u/16264105/tr_TR.zip

    #288207
    mcener
    Member
    Post count: 44

    By far,
    This is the best theme support I’ve ever seen in my entire life!
    Thank you for making things possible for people like me!

    Have a great one.

    #288401
    David Martin – Support
    Moderator
    Post count: 20834

    Great, we are all happy to help you out here!

    Thanks,
    David.

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

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register