Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #720273

    Hi,
    i have a question.
    I would change the language of the widget of facebook from english to italian.

    I would change “liked” in “mi piace” for example.

    The widget is called Enfold Child Facebook Likebok.

    Thank you,

    Andrea

    #720558

    Hey Andreinho1992,

    You need to edit this file “class-framework-widgets.php” located in enfold\framework\php (in the theme files), and find this code in line 97:

      js.src = "//connect.facebook.net/'. $langcode .'/sdk.js#xfbml=1&version=v2.7";

    replace it with:

      js.src = "//connect.facebook.net/it_IT/sdk.js#xfbml=1&version=v2.7";

    Hope this helps.

    Best regards,
    Nikko

    #720561

    Hi!

    Please go to file Nikko mentioned above and find

    $langcode = function_exists('icl_object_id') && !empty($langcode) ? $langcode : 'en_US';

    and change it to

    $langcode = function_exists('icl_object_id') && !empty($langcode) ? $langcode : get_locale();

    It will be included in upcoming Enfold update :)

    Best regards,
    Yigit

    #721008

    Hi,
    thank you to everybody.

    I do this.
    But the language is english yet.

    Bye
    Andrea

    /**
    * AVIA FACEBOOK WIDGET
    */

    if (!class_exists(‘avia_fb_likebox’))
    {
    class avia_fb_likebox extends WP_Widget {

    static $script_loaded = 0;

    function __construct() {
    //Constructor
    $widget_ops = array(‘classname’ => ‘avia_fb_likebox’, ‘description’ => __(‘A widget that displays a facebook Likebox to a facebook page of your choice’, ‘avia_framework’) );
    parent::__construct( ‘avia_fb_likebox’, THEMENAME.’ Facebook Likebox’, $widget_ops );
    }

    function widget($args, $instance)
    {
    // prints the widget

    extract($args, EXTR_SKIP);
    if(empty($instance[‘url’])) return;
    $url = $instance[‘url’];
    $title = isset($instance[‘title’]) ? $instance[‘title’] : “”;
    $height = 151;
    $faces = “true”;
    $extraClass = “”;
    $style = “”;

    if(strpos($height, “%”) !== false)
    {
    $extraClass = “av_facebook_widget_wrap_positioner”;
    $style = “style=’padding-bottom:{$height}'”;
    $height = “100%”;
    }

    echo $before_widget;

    if ( !empty( $title ) ) { echo $before_title . $title . $after_title; };

    echo “<div class=’av_facebook_widget_wrap {$extraClass}’ {$style}>”;
    echo ‘<div class=”fb-page” data-width=”500″ data-href=”‘.$url.'” data-small-header=”false” data-adapt-container-width=”true” data-hide-cover=”false” data-show-facepile=”true” data-show-posts=”false”><div class=”fb-xfbml-parse-ignore”></div></div>’;
    echo “</div>”;
    echo $after_widget;
    add_action(‘wp_footer’, array( $this,’fb_js’ ));
    }

    function fb_js()
    {
    if ( function_exists(‘icl_object_id’) ) {
    $locale = ICL_LANGUAGE_NAME_EN;
    $fbxml = @simplexml_load_file( AVIA_BASE . ‘/config-wpml/FacebookLocales.xml’ );

    if(is_object($fbxml))
    {
    $langcode = array();
    foreach($fbxml as $loc) {
    if($loc->englishName == $locale) {
    $langcode = $loc->codes->code->standard->representation;
    }
    }
    }
    }

    $langcode = function_exists(‘icl_object_id’) && !empty($langcode) ? $langcode : get_locale();

    if(self::$script_loaded == 1) return;
    self::$script_loaded = 1;

    echo ‘
    <script>(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = “//connect.facebook.net/it_IT/sdk.js#xfbml=1&version=v2.7”;
    fjs.parentNode.insertBefore(js, fjs);
    }(document, “script”, “facebook-jssdk”));</script>’;

    }

    function update($new_instance, $old_instance)
    {
    $instance = $old_instance;
    foreach($new_instance as $key=>$value)
    {
    $instance[$key] = strip_tags($new_instance[$key]);
    }

    return $instance;
    }

    function form($instance) {
    //widgetform in backend

    $instance = wp_parse_args( (array) $instance, array(‘url’ => ‘https://www.facebook.com/kriesi.at&#8217;, ‘title’ => ”) );
    $html = new avia_htmlhelper();

    ?>

    <p>
    <label for=”<?php echo $this->get_field_id(‘title’); ?>”><?php _e(‘Title:’, ‘avia_framework’); ?>
    <input class=”widefat” id=”<?php echo $this->get_field_id(‘title’); ?>” name=”<?php echo $this->get_field_name(‘title’); ?>” type=”text” value=”<?php echo esc_attr($instance[‘title’]); ?>” /></label>
    </p>

    <p>
    <label for=”<?php echo $this->get_field_id(‘url’); ?>”><?php _e(‘Enter the url to the Page. Please note that it needs to be a link to a facebook fanpage. Personal profiles are not allowed!’, ‘avia_framework’); ?>
    <input class=”widefat” id=”<?php echo $this->get_field_id(‘url’); ?>” name=”<?php echo $this->get_field_name(‘url’); ?>” type=”text” value=”<?php echo esc_attr($instance[‘url’]); ?>” /></label>
    </p>

    <?php
    }
    }
    }

    #721015

    Hi!

    Please try applying only this – https://kriesi.at/support/topic/change-language-of-widget-of-facebook/#post-720561
    If that does not help, please post FTP and WP admin logins here privately so we can look into it.

    Best regards,
    Yigit

    #721020

    Doesn’work i post the logins information

    #721029

    Hey!

    Please see private content field.

    Cheers!
    Yigit

    #721033

    HI

    #721050

    Hi!

    I applied the changes. Please review your website now.

    It seems like you just copied all files from parent theme to child theme. That is not necessary. For more information, please see – http://kriesi.at/documentation/enfold/using-a-child-theme/

    Regards,
    Yigit

    #721057

    Fantastic! thank you very much.
    Bye

    #721069

    Hi!

    You are welcome! :)

    For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
    And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
    For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)

    Regards,
    Yigit

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Change language of widget of facebook (’ is closed to new replies.