k2 social language

GK User
Fri Feb 03, 2012 7:23 pm
How do I change some phrase in K2 component social area? I've tried to modify default template translation in /languages directory but still nothing. Could you help me, please look at the screenshot below
User avatar
Gold Boarder

teitbite
Sat Feb 04, 2012 1:45 am
Hi

Please edit file /html/com_k2/templates/default/item.php

There You will find a script:

Code: Select all
<!-- Facebook Button -->
                    <div class="itemFacebookButton">
                        <div id="fb-root"></div>
                        <script type="text/javascript">
                            (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/all.js#appId=177111755694317&xfbml=1";
                              fjs.parentNode.insertBefore(js, fjs);
                            }(document, 'script', 'facebook-jssdk'));
                        </script>
                        <div class="fb-like" data-send="false" data-width="260" data-show-faces="true"></div>
                    </div>
                    <?php endif; ?>


there You need to change the path to the right lang file

Code: Select all
//connect.facebook.net/en_US/all.js
User avatar
Moderator

GK User
Sun Feb 05, 2012 11:18 pm
thanks teitbite

solved
User avatar
Gold Boarder

teitbite
Mon Feb 06, 2012 8:47 pm
Hi

Glad I could help.
User avatar
Moderator

GK User
Sat Jun 29, 2013 10:11 pm
Hello, what about multilingual sites where I need facebook buttons in different languages?

thank you
User avatar
Senior Boarder

teitbite
Sat Jun 29, 2013 10:30 pm
Hi

I think facebook script can recognize the site language tag if You use a default language library in settings. But You may also try editing /layout/blocks/social.php and look for facebook button code. There You will see a code like this:

Code: Select all
<?php echo  $this->getParam('fb_lang', 'en_US'); ?>


try replace it with:

Code: Select all
<?php echo str_replace('-','_',$this->API->language); ?>


Please try if it works. This may need some adjustment, because I'm not sure if facebook can load case insensitive file names.
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.