Digital experiences for all disciplines
New Landing › How can we help? › Atelier › Choose An Option Slideout Problem
New Landing › How can we help? › Atelier › Choose An Option Slideout Problem
Tagged: iloveateliersupport
- This topic has 13 replies, 3 voices, and was last updated 8 years by David Martin – Support.
-
Posted in: Atelier
-
August 3, 2016 at 7:02 pm #285741
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.August 4, 2016 at 10:49 am #285867Hi,
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
MohammadAugust 4, 2016 at 1:24 pm #285895You are a star thank you for the reply
This is the code I want to insert in the child theme functions.phpfunction 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);
August 4, 2016 at 2:55 pm #285905Update: 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 youAugust 5, 2016 at 5:39 pm #286114This 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.
August 7, 2016 at 1:55 pm #286170Yes sir I did. I translated woocommerce with PoEdit and upload the translation to the ftp folder…
August 8, 2016 at 2:15 pm #286333Could you add your FTP details so I can take a look?
– David.
August 11, 2016 at 9:34 am #286946This reply has been marked as private.August 12, 2016 at 10:54 am #287157Can 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 themefunctions.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' );
August 12, 2016 at 12:50 pm #287180I did everything you instructed sir but still can’t see the result I want
Attachments:
You must be logged in to view attached files.August 15, 2016 at 9:46 am #287368🙁
August 16, 2016 at 9:58 am #287595Perfect, 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 tothemes/atelier-child/language
.Two example files I created using the above method: https://dl.dropboxusercontent.com/u/16264105/tr_TR.zip
August 18, 2016 at 10:09 pm #288207By 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.
August 19, 2016 at 4:19 pm #288401Great, we are all happy to help you out here!
Thanks,
David. -
Posted in: Atelier
You must be logged in and have valid license to reply to this topic.