-
AuthorPosts
-
December 5, 2016 at 2:38 am #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
December 5, 2016 at 5:35 pm #720558Hey 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,
NikkoDecember 5, 2016 at 5:43 pm #720561Hi!
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,
YigitDecember 6, 2016 at 2:25 pm #721008Hi,
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 widgetextract($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’, ‘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
}
}
}December 6, 2016 at 2:44 pm #721015Hi!
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,
YigitDecember 6, 2016 at 2:47 pm #721020Doesn’work i post the logins information
December 6, 2016 at 2:59 pm #721029December 6, 2016 at 3:02 pm #721033December 6, 2016 at 3:18 pm #721050Hi!
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,
YigitDecember 6, 2016 at 3:22 pm #721057Fantastic! thank you very much.
ByeDecember 6, 2016 at 3:30 pm #721069Hi!
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 -
AuthorPosts
- The topic ‘Change language of widget of facebook (’ is closed to new replies.