-
AuthorPosts
-
December 20, 2015 at 2:03 pm #555586
Hi there,
I’m using the Facebook likebox widget included with the Enfold theme. Default version of the widget does not support multilingual configuration, that is, its content is always shown in English.
I sent a support thread here on the forum about this question a couple of weeks ago. It was successfully solved by one of the forum moderators (Ismael), but I have noticed that the versions of Enfold theme updated from them do not included the code needed to solve that bug. Because of that, I’m sending this post to ask for please updating that issue on next Enfold theme version.
I’m copying below a solution that works for solving the multilingual issue before mentioned about the widget “facebook likebox” included as part of the Enfold theme. Thanks in advance for including this update in coming versions of Enfold theme.
————————
Please modify the framework > php > class-framework-widgets.php file, look for avia_fb_likebox class and the fb_js function:function fb_js()
{
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/en_US/sdk.js#xfbml=1&version=v2.4”;
fjs.parentNode.insertBefore(js, fjs);
}(document, “script”, “facebook-jssdk”));</script>’;}
.. replace it with:function fb_js()
{
if ( function_exists(‘icl_object_id’) ) {
$locale = ICL_LANGUAGE_NAME_EN;
$fbxml = simplexml_load_file( AVIA_BASE . ‘/lang/FacebookLocales.xml’ );
$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 : ‘en_US’;
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/’. $langcode .’/sdk.js#xfbml=1&version=v2.4”;
fjs.parentNode.insertBefore(js, fjs);
}(document, “script”, “facebook-jssdk”));</script>’;}
You need to download the xml file here then place it in the themes/enfold/lang folder. Note that the languages supported by the facebook api is limited but it should work for the spanish translation.
Best regards,
Ismael
————————————–December 20, 2015 at 9:22 pm #555665Hey muumi74!
I will add that to our github, for feature updates.
Thanks a lot for reminding it t us, we do appreciate it a lotBest regards,
BasilisJanuary 20, 2016 at 2:26 pm #568617Hi!
I am closing the topic here as it has been reported to our git.
Best regards,
Basilis -
AuthorPosts
- The topic ‘Update to be included in next Enfold theme update – Facebook likebox widget’ is closed to new replies.