Topic-icon Easy-to-implement multi-language feature

Active Subscriptions:

None
We should be able to put joomla language strings in all configuration text fields it makes sense...

Example:
- on "Status/Wall" - "New User Status Settings" - "Message" we should be able to put some COM_JFBC_NEW_USER_STATUS_MESSAGE (or whatever) so that users get their messages in their language of choice (AKA Joomla Current Language).

Now that would be a MAJOR improvement... and a very simple on to implement: I guess it just needs adding the proper JText calls where needed :=D
Can you implement this? Please? Oh Pleaaaaaaaaaaaase? (imagine a sweet Puss In Boots icon, here) - I am constantly working on multi-language sites and really need this feature! :/

In the mean time... on file com_jfbconnect/libraries/facebook.php if change both function setFacebookNewUserMessage() and function setFacebookLoginMessage() with
$post['message'] = JText::_($message);

...will this do the trick?

Could not find the bit of code to change to make this work for the "Social" - "Open Graph" - "Defaults" field... :|

Thanks!
The topic has been locked.
Support Specialist
14 years 1 month ago #22418 by alzander
Alexandre,
Definitely like that suggestion. Your code for how to do it is correct. The nice thing about JText is that if the string isn't found in a language file, it will use the direct string that's passed in. That will help for users that use a 'normal' message, which will be good for backward compatibility.

The problem with JText is that if you don't define the string for the users language, you'll be posting COM_JFBCONNECT_NEW_USER_WALL_MESSAGE (or whatever the key is) to the user's wall. If we implement this, we may try to detect if the key isn't found, and prevent the message from posting at all.. just something to be aware of.

Finally, for the Open Graph tags, you don't want those translated. Facebook will fetch the tags from your site periodically. They aren't read uniquely for each user at the time of a comment or Like click, but by Facebook itself when it needs those values. Therefore, setting them to different language strings on the same page will confuse Facebook and cause you more problems than you're looking for.

Hope that all makes sense,
Alex
The topic has been locked.
Active Subscriptions:

None
Thanks for the quick reply! :)

alzander wrote: Definitely like that suggestion. Your code for how to do it is correct. The nice thing about JText is that if the string isn't found in a language file, it will use the direct string that's passed in. That will help for users that use a 'normal' message, which will be good for backward compatibility.

I understand you're considering to adopt my suggestions. Any ideias when we will have a release with that ability included?
As a principle I avoid to change a component core code... I tend to forget to re-do the changes after updates... So, I'd rather wait for the official SourceCoast release :P

alzander wrote: Finally, for the Open Graph tags, you don't want those translated. Facebook will fetch the tags from your site periodically. They aren't read uniquely for each user at the time of a comment or Like click, but by Facebook itself when it needs those values. Therefore, setting them to different language strings on the same page will confuse Facebook and cause you more problems than you're looking for.


I don't see that as a problem, since the way Joomla goes multilanguage is by adding a suffix to the base URL:
- mysite.com/en for English
- mysite.com/pt for Portuguese
and so on

So, we're having distinct URLs for distinct languages and that should be OK with Facebook...

All the best!
The topic has been locked.