How to change language of displayed JFBConnect components

How to change language of displayed JFBConnect components

Hi
How to change language of displayed JFBConnect components in my website

Thanks

Administrator has disabled public posting. Please login or register in order to proceed.

Re: How to change language of displayed JFBConnect components

You can set the locale for Facebook using our setting found in JFBConnect > Configuration > Facebook section. For instance, use fr_FR for France. This will notify Facebook to change the language for social widgets, etc.

Our installation package also provides available languages for our component, modules and plugins. This will translate the strings that we have control over. If the language is installed on your site, you should just have to reinstall JFBConnect to get the language added.

If these two options aren't describing what you're asking for, can you provide more clarification please.

-Melissa

Want to stay up-to-date on new releases and development efforts?
Follow us on Twitter @sourcecoast and @mandreae

mel
Melissa
useravatar
Offline
3502 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: How to change language of displayed JFBConnect components

I have website with two language  English and Arabic
I need to display Facebook comment  for example in Arabic if user use Arabic language

http://www.5tawzeef.com/index.php/content-category-1/91
http://www.5tawzeef.com/index.php/en/co … egory-1/91

https://www.sourcecoast.com/images/agorapro/attachments/48881/mini_2.png

https://www.sourcecoast.com/images/agorapro/attachments/48881/mini_1.png

Attachments:
Administrator has disabled public posting. Please login or register in order to proceed.

Re: How to change language of displayed JFBConnect components

Please can you help me

Administrator has disabled public posting. Please login or register in order to proceed.

Re: How to change language of displayed JFBConnect components

If you leave the locale setting blank in the JFBConnect backend > Configuration > Facebook area, JFBConnect has logic to determine the locale based on the language of the page. Then we use that locale to initialize the Facebook javascript.

In your two examples:

www.5tawzeef.com/index.php/en/content-category-1/91
1. og:locale is set to en_gb
2. We have initialized the JS library to

js.src = "//connect.facebook.net/en_GB/sdk.js"

www.5tawzeef.com/index.php/content-category-1/91
1. og:locale is set to ar_aa
2. We have initialized the JS library to

js.src = "//connect.facebook.net/ar_AA/sdk.js"

For the social widgets, those are the only two ways for our website to configure the language of the comment plugin. Other than that, it's out of our hands for what Facebook renders.

-Melissa

Want to stay up-to-date on new releases and development efforts?
Follow us on Twitter @sourcecoast and @mandreae

mel
Melissa
useravatar
Offline
3502 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: How to change language of displayed JFBConnect components

It's blank already
But not work.

https://www.sourcecoast.com/images/agorapro/attachments/48881/mini_3.png

Attachments:
Administrator has disabled public posting. Please login or register in order to proceed.

Re: How to change language of displayed JFBConnect components

Facebook describes how to do the set the language for the social widgets on the following page:
https://developers.facebook.com/docs/in … nalization

As Melissa noted above, we are doing exactly what they recommend. However, it seems like Facebook doesn't recognize the ar_AR language code. From the first line in the following file, you'll see it shows en_US:
https://connect.facebook.net/ar_AA/sdk.js

However, if you change that URL to the below, it properly shows ar_AR:
https://connect.facebook.net/ar_AR/sdk.js

The reason is discussed on the internationalization page above. You may need to change the setting in the Joomla language manager to ar_AR for your language code or use the Facebook Locale override setting in JFBConnect to force one or the other languages.

I hope that helps explain,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
23658 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: How to change language of displayed JFBConnect components

Actually, we were just thinking this through further on our end and it's something we can fix. Below is a small code snippet we'd love for you to try out and let us know if it works. If so, we can get it included in a future release.

The edit is to the /components/com_jfbconnect/libraries/provider/facebook.php file.

Around line 220, you should see:

Code:

        $locale = str_replace("-", "_", $locale);

After that line, please add the following line:

Code:

        $locale = ($locale == 'ar_AA') ? 'aa_AA' : $locale;

That should detect ar_AA and replace it with aa_AA when loading the Facebook javascript file automatically.

I hope that helps,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
23658 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: How to change language of displayed JFBConnect components

I made the modification for (/components/com_jfbconnect/libraries/provider/facebook.php )
but still same problem


https://www.sourcecoast.com/images/agorapro/attachments/48881/mini_0.PNG

https://www.sourcecoast.com/images/agorapro/attachments/48881/mini_1.PNG

Attachments:
Administrator has disabled public posting. Please login or register in order to proceed.

Re: How to change language of displayed JFBConnect components

I apologize. I messed the language codes. Please try the following code:

Code:

$locale = ($locale == 'aa_AA') ? 'ar_AR' : $locale;

That should detect aa_AA and update it to ar_AR, which is the proper code that Facebook supports.

Please test and let me know how that goes.

Thanks,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
23658 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: How to change language of displayed JFBConnect components

Still same problem
Please Help me

https://www.sourcecoast.com/images/agorapro/attachments/48881/mini_t1.PNG

https://www.sourcecoast.com/images/agorapro/attachments/48881/mini_t2.PNG

Attachments:
Administrator has disabled public posting. Please login or register in order to proceed.

Re: How to change language of displayed JFBConnect components

Ok.. I'm getting confused. You may need to help me. The second part of that code I gave you must end with 'ar_AR'. Right now, the language on the page is getting incorrectly set to 'ar_AA'. I *think* ar_AA is what your Joomla site is trying to set it to and the code I gave you should be trying to replace that with ar_AR.

So, let's try this one last time:

Code:

$locale = ($locale == 'ar_AA') ? 'ar_AR' : $locale;

If you do the echo statement, and the language code comes out as anything other than ar_AR, please use that code in the first part of the code above.. so, if somehow, ab_CD is what appears, update the code to:

Code:

$locale = ($locale == 'ab_CD') ? 'ar_AR' : $locale;

Please let me know how that goes and sorry for the issues!
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
23658 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: How to change language of displayed JFBConnect components

It's ok now
Thank you

Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests also viewing this topic
There are 0 users also viewing this topic

Board Info

Board Stats
 
Total Topics:
11404
Total Polls:
0
Total Posts:
48070
Posts today:
2
User Info
 
Total Users:
47234
Newest User:
jrucker
Members Online:
1
Guests Online:
963

Online: 
Vinnie
Social Stream
Refer and Earn

Like our extensions? You're not alone! That's why they're used on tens of thousands of websites. Now you can earn 20% of any sale you refer to SourceCoast.com.

We provide excellent documentation, well laid out sales pages and great support. All you need to do is spread the word and we'll take care of the rest.

Learn About Our Affiliate Program