Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #541432

    Hi there,

    I have installed the plugin “Enfold Facebook Likebox” in column4 of my footer. Two questions:

    1) My site is multilingual (WPML, configured EN and ES), but the content of the likebox is always shown in English. Should be the captions “Like Page”, “Share”, etc. shown inside your likebox be translated automatically when choosing “ES” in the language switcher?
    – If YES, why is not working?
    – If NO (so I have to add some string translation): where can I find the strings to be translated? I have looked for them in the list “WPML / String translation”, but I’m not finding any string related to the “Enfold Facebook Likebox” widget.

    2) In some cases, when a user clics on the “Like Page” button of the widget, the caption of the button “Like Page” turns into “Liked” (it seems as expected). But, in other cases, the caption of that button (“Like page”) turns into “Error”. Why does it mean? What is happening?

    I would really appreciate your help asap, as the site is on production.

    Thanks a lot in advance.

    #543476

    Hey muumi74!

    Thank you for using Enfold.

    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

    #544542

    Hey Ismael!

    It seems to work properly after replacing the code indicated by you, so thanks a lot for you help! :)

    In addition, please let me know your feedback about this other question: in addition to the FB likebox widget, there are some other widgets not properly translated after updating Enfold theme + some WPML plugins.

    For instance, the “Mailchimp widget” (installed in the footer, column1), or the “Latest tweets” widget (installed on column3). Translated strings for both of widgets are available and marked as completed in WPML > String translation, and both of them worked properly before updates. But now, after updating Enfold+WPML, only English strings are shown related to those two widgets (even if I choose Spanish in the language switcher).

    Could you please let me know if these bugs could be related to the latest Enfold theme update, to WPML updates, or maybe to both? Maybe could you test anything, and help to find the root of the problem?

    Thanks in advance for your kind help and support.

    Cheers

    #546703

    Hey!

    try to deactivate all other plugins but WPML and make sure to use newest Enfold version (check on themeforest.com). Clear browser cache and hard refresh a few times. Try to activate a default WordPress theme to check if you get the same results there as well and let us know about your results.

    Regards,
    Andy

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.