× Joomla Facebook Connect support forum

Topic-icon Language on JFBCComments

Active Subscriptions:

None
15 years 9 months ago #4448 by supersej
I just installed the JFBCComments which is brilliant. But I would like it to be in Danish on my danish part of the side so it doesn't say "add a comment", "post comment on my facebook profile" and so on. But I can't seem to find where this text accours.

Can you please help me?
The topic has been locked.
Support Specialist
15 years 9 months ago #4459 by alzander
Replied by alzander on topic Language on JFBCComments
That's a great question, and something we haven't tested. However, we had looked into it at one point, and the page below is what we found:
forum.developers.facebook.net/viewtopic.php?id=29112
Specifically:
Q: How does the Comments Box work in other languages?
A: Because of Facebook's user-provided translations application, the Comments Box UI will automatically display in a user's chosen language

Again, we haven't tested that, but it is from an administrator on the Facebook Developer forums. Unfortunately, it's also a pretty old post, so may be out of date. Please try with a Facebook account who's default is Danish (or your language of choosing). This can be set in Facebook by going to your "My Account" page and then using the language tab.

I don't know of a way to 'force' the comments block to always be in a specific language.
The topic has been locked.
Active Subscriptions:

None
15 years 9 months ago #4494 by supersej
Replied by supersej on topic Language on JFBCComments
My facebook language is already set to danish so sadly that doesnt change the language in the comment box.

Isnt it possible to change the language by a diffrent url? I know that the login info page can be language changed by changing a variable in the link
The topic has been locked.
Support Specialist
15 years 9 months ago #4507 by alzander
Replied by alzander on topic Language on JFBCComments
Yes, you're correct. We actually stumbled across this over the weekend and remembered your post. Currently, and somewhat unknowingly, we've hard-coded the language into the Javascript. We'll make this a configuration setting in an upcoming version. For now, if you'd like to set it yourself, please do the following:

Edit the /components/com_jfbconnect/libraries/facebook.php file. At ~line 75, update the line below with your country code:
<script src="//connect.facebook.net/en_US/all.js"></script>\n

When we do a setting in the future, we'll likely make it a global configuration setting (or pull from Joomla's default language setting). If you have a preference or suggestion on how you'd like it done, please let us know!

Thanks for following up and making us track this down.
The topic has been locked.
Active Subscriptions:

None
15 years 9 months ago #4516 by supersej
Replied by supersej on topic Language on JFBCComments
Thanks for following up on this. You were right. I edited the code with the following and now it shows in danish when danish visitors arrive and on english when everyone else arrive (thanks to Joom!fish)

Code looks like this

$lg = &JFactory::getLanguage();
$language = $lg->getBackwardLang();
if ( $language == "danish" ) { $facebooklang = 'da_DK'; } if ( $language != "danish" ) { $facebooklang = 'en_US'; }

echo <<<EOT
<div id="fb-root"></div>\n
<script src="//connect.facebook.net/$facebooklang/all.js"></script>\n
The topic has been locked.
Active Subscriptions:

None
15 years 9 months ago #4517 by supersej
Replied by supersej on topic Language on JFBCComments
That means the 4 first lines are added to the existing code and in the code below i just replaced en_US with $facebooklang
The topic has been locked.
Support Specialist
15 years 9 months ago #4524 by alzander
Replied by alzander on topic Language on JFBCComments
Awesome. Yes, we would like to do something like that (so it's automatic). There's also a way to pull the user's langauge from Facebook itself, but sometimes that requires the user to have already approved your app.. which is poor.

Either way, we're investigating. Won't be in the next release (due soon), but short after.

Thanks for providing your code. Looks clean and easy.. now to make it work for all languages easily :D
The topic has been locked.
Active Subscriptions:

None
15 years 9 months ago #4646 by fb_100000915234320
Taking advantage of the question, the same holds for translation into Portuguese Brazil
The topic has been locked.
Support Specialist
15 years 9 months ago #4654 by alzander
Replied by alzander on topic Language on JFBCComments
Yes, we'll be making the language selection flexible (or automatic) based on your Joomla settings. Haven't decided the exact approach yet. Again, it should be in the release after 3.0 stable (do this week).
The topic has been locked.