Google Translation for CB Users Lists

12 years 8 months ago - 12 years 8 months ago #174205 by NTD
Hello

We are trying to enable a full-fledge translation option on our site.
The installation is made of Joomla 1.7, CB 1.7, and the quite efficient otherwise AjaxWtranslate module, which uses Google Translation API to translate the page on the fly when clicking a flag.

On the CB User List & Search page (option=com_comprofiler&task=userslist), the translation script does not translate the core of the list like it does for the rest of the page.
The script does translate on other pages, including Kunena and other CB pages (including CB Profile).
We got the very same problem using GT translate instead of AjaxWtranslate, so we tend to think it is something in the way CB listing is generated which Google translation is impervious to.

This page is quite crucial as our site is basically a registry to find members by profile :)

Is there some kind of workaround or solution to expect ?

Thank you in advance,

Regards

Arnaud

Please Log in to join the conversation.

12 years 8 months ago #174219 by krileon
Replied by krileon on topic Re: Google Translation for CB Users Lists
For Google translation we provide our own integration. Please see incubator project CB Google Translate. Your users will be able to change language dynamically from your CB Login module. We don't provide support for other developers extensions so what your extensions does or does not translate needs to be taken up with the extensions developers. Google simply parses a page and translates the text and there's nothing on CB that would prevent this from working. I've confirmed our integration works fine for userlists.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

12 years 8 months ago - 12 years 8 months ago #174320 by NTD
Thank you for your answer.

As I suspected by having two different third party modules giving the same result, problem is the same with incubator CB Addon.

I used Opera source viewing and changing html by dropping various blocks on result page to see where Google Translate is unable to do its job.
I happens to stop translation in the CB List navigation, and only when this block is here.
In fact the < and > generated in the navigation part actually do confuse Google translation and stop it dead in its tracks, and the rest of the page is not translated.
Removing them allows the translation modules/plugins to do their job.

Problem is obviously on Google/Translate side, but it is somehting that CB Users List does that call on its bug. Good news, because it is somehow easier to change.

Investigating in the component looking for what generates the divs with class "cbUserListPagination", I found that writePagesLinks generates them.
I finally located this function in line 886 of administrator/components/com_profiler/comprofiler.class

Going for a quick hack, I decided to replace the < and > by their rasterized versions that won't offend Ms Google.
So I changed the occurences in the following lines all occurences of &lt; by
<span class="bug lt">&nbsp;</span>
with appropriate \ before the " on some of the lines,
and I do the same thing with all occurences of &gt; by
<span class="bug gt">&nbsp;</span>
again with appropriate escape backlashes to avoid some fatal error.
I managed to get two pictures of the < and > which I named lt.jpg and gt.jpg. I made them the right color and size as my site. (I joined them for those that have the same problem as they are black and standard character size, which could reduce troubleshooting effort in many cases).

Then I went straight to my css and :
span.bug {display: inline-block; width: 12px;}
span.lt {background-image: url(../images/lt.jpg) ;}
span.rt {background-image: url(../images/gt.jpg) ;}

And now my Users Lists shows fine in every language by clicking on my little flags.

This is hack-based workaround, not the most elegant thing I will admit. Yet effective.
I suspect that the problem is Google or Ajax/jQuery related, until the patch it will work fine for those that would love to use CB all over the world !)

Solved.

Regards

Arnaud
Attachments:

Please Log in to join the conversation.

12 years 8 months ago #174339 by krileon
Replied by krileon on topic Re: Google Translation for CB Users Lists
Don't recommend you hacking the pagination, several plugins use it and you're likely to break them. Please users do NOT apply the hack. I can't stress this enough: If you change your core files you are VOIDING your support, which means we will NOT help you in event of a problem.

Again, I've tested our incubator project on a clean installation and it translated the userlist perfectly fine. This was tested on CB 1.7 on Joomla 1.5 and Joomla 1.7. Please ensure your installation is up to date. CBs core uses htmlspecial versions for a purpose and Google is more then capable of understanding a simple htmlspecialchar. It is very likely something installed could be causing such a conflict. Please also note Google translation is slow at times and took approx. 10+ seconds to translate a userlist in my tests.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.200 seconds

Facebook Twitter LinkedIn