By Martin on Friday, 04 November 2016
Posted in Technical Issues
Replies 24
Likes 0
Views 1.1K
Votes 0
This post is a continuation of this: https://stackideas.com/forums/easyblog-falang-translation-compatibility#reply-293483

The most important part is that EB include compatibility with Falang as soon as possible.

Now, to help you do this faster, i explain that Falang is a component + plugin that allows to have your site multilingual without having to duplicate content in each language.
The component allows you to translate content of different components.
The plugin "intercept" DB queries.
When user browse website in default language the plugin returns "original" content from original table in DB.
When user browse website in different language the plugin returns the translated content from Falang table in DB.

In the case of EB, on version 3.9 this was working fine. As there was no revision table. So the content was loaded from post table or from falang table.

Now in v5, the revision feature load the EB content from revision table, and this content is JSON coded. Falang would be able to intercept the queries to revision table, but there may be many revisions for a single article, then it will not be possible/practical to translate every revision. Moreover, the revision table hold the post coded in JSON. But falang can only translate HTML.

So the solution to this may be to allow Falang to load content from post table instead of revision when user is browsing translated content in FE.

The actual modification available made by Stephane (creator of Falang) is this code, you should include in /administrator/components/com_easyblog/includes/postpost.php near line 558:


public function checkoutFromRevision()
{
$workbench = $this->revision->getContent();

//start modification
if (JFile::exists(JPATH_ADMINISTRATOR . '/components/com_falang/classes/FalangManager.class.php')) {
$default_site_language =JComponentHelper::getParams('com_languages')->get("site","en-GB");
$JLang = JFactory::getLanguage();
$currentLanguage = $JLang->getTag;
if($currentLanguage != $default_site_language ){
$workbench=null;
}
}
//end modification

if (! $workbench) {

// somehow the revision id is exists but the revisions.content is empty.
// we need to regenerate the revisions.content.
$this->checkoutFromPost();

} else {
$this->setWorkbench($workbench);
}

$this->revision_id = $this->revision->id;
}


But im having problems with this modification. My website is native in Spanish, and Falang translations are in English. But for some strange reason, many of my post are getting overwritten with English content. So now i have the post and the translation in English.

I think this could be caused because when the $workbench = null EB "rebuild" the post with content from #__easyblog_post table. But as Falang returns translated content from falang table instead of post table, the rebuilded post is now in english.
hey Martin,

I am sorry for the delay of this reply,

Can you provide us with your FTP access as well so I can troubleshoot this issue?
·
Friday, 04 November 2016 17:41
·
0 Likes
·
0 Votes
·
0 Comments
·
Done
·
Friday, 04 November 2016 18:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Martin,

Thanks for getting back to us, now i can connect with your FTP and Joomla backend.

But im having problems with this modification. My website is native in Spanish, and Falang translations are in English. But for some strange reason, many of my post are getting overwritten with English content. So now i have the post and the translation in English.

I think this could be caused because when the $workbench = null EB "rebuild" the post with content from #__easyblog_post table. But as Falang returns translated content from falang table instead of post table, the rebuilded post is now in english.

I believe that is not related this $workbench which set to null, this is what I tried replicate this into your site :

1. I created a Spanish blog post from backend.
2. Update the translation in Falang regarding this test post.
3. Then check from frontend, everything is look fine even I switch to English content.
4. After that, I accidentally edit post from frontend (English language) and save it, it will update this English content into #__easyblog_post table, so it will become English content.

May i know your issue is it similar with my above scenario?

However, then I try again if I edit the post from backend, it will load the Spanish content, mean whatever I update the content from backend, it will not store as English content in this #__easyblog_posts table is because the way it load the content from the composer, Falang will not trigger it and translate the content to English, so it will not show English content.

For those blog post which already show English content, unfortunately that was no other way to restore back the Spanish content, since this #__easyblog_posts table already stored as English content now.
·
Saturday, 05 November 2016 21:56
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for your test.
I understand why FE editing could be causing issue. But i never translate from FE. In fact the translations were made more than a year ago, and didnt change since then.
My website was updated from J2.5 & EB3.9 to J3 and EB5 one month ago. And I have the old website as backup, and i can check that all contents are OK, both in english and spanish.
Once the update took place, then the post started to appear in english instead of spanish.
There is no problem about translation, i have backup for them.
The problem is to check if there is any scenario where the content gets overwritten, and why.
In my DB the overwritten post are the ones "modified by" 0 in the revision table.
Maybe this problem arrouse at the moment of updating EB, when copying tables and creating revisions?
Maybe we cant reproduce the problem because its not any change we can make now?
·
Monday, 07 November 2016 20:36
·
0 Likes
·
0 Votes
·
0 Comments
·
I will close my FTP and ADMIN credentials to prevent security issues.
Just want to tell that the translation problem may arouse by other causes. Dont seem to be fault of Falang.

Please consider allowing Falang to translate SEF url, like commented in this post: https://stackideas.com/forums/sef-support-for-falang
Otherwise translated SEF urls report problems. And now you consider compatibility with Falang, it would be nice a full compatibility instead of only half way.

When will you include this changes in core?
Thanks!
·
Thursday, 10 November 2016 00:43
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Martin,

I am sorry for the delay of this reply,

Yes, it might be that is the problem come from when you upgrade from 3.x to 5.x based on what you tell me in your previous reply, because it will generate all the existing 3.x posts to revision and store in revision table.

May i know when you upgrade from 3.x to 5.x that moment, I believe you include that code which provided from Falang developer after you upgraded to Easyblog 5.x right?

If that is the case, it shouldn't cause this happen because all the existing post already generated to new revision. Then only applied the hack code in the Easyblog core file.

By the way, may i know whether is it possible setup one of the test site then rollback with your previous backup start from 3.x data? So we can try track back from there and see whether can find out anything is it this issue related during the upgrade?



I will close my FTP and ADMIN credentials to prevent security issues.
Just want to tell that the translation problem may arouse by other causes. Dont seem to be fault of Falang.

Please consider allowing Falang to translate SEF url, like commented in this post: https://stackideas.com/forums/sef-support-for-falang
Otherwise translated SEF urls report problems. And now you consider compatibility with Falang, it would be nice a full compatibility instead of only half way.

When will you include this changes in core?

Based on current situation that is quite hard to integration well with Falang is because Easyblog 5 everything is rely on the revision.

But I have discuss this issue with our developers regarding this, we will see whether if possible to remove this revision in Easyblog 5.1 version, but this thing we haven't decide yet because we need to spend more time to do overall testing and see whether can fully work after remove the revision.

And now I would like figure out why only your site facing this issue, because we have a few customer also using this Falang and they use the Falang temporary hack code, it seems work fine and they didn't hitting any issue like your case.

Based on what their current issue is blog permalink issue is because the blog post alias is not refer on the Falang and we still discussing this issue with Falang one of the staff (Stéphane Bouey) how the Falang workflow to convert it to Falang translated permalink alias from backend.
·
Thursday, 10 November 2016 18:16
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi guys,

I wondered if there was any progress made on this in EasyBlog 5.1 or 5.2? Multi-language support is a huge advantage of Joomla over other sites, but FaLang seems to do a better job than Joomla, because you do not have to duplicate items for every language.

I note that they have a competitor called Easy Language. Briefly I fantasized that StackIdeas had created their OWN solution to this issue. Wouldn't that be amazing!?

But seriously, perhaps Joomla 4 will make all of this simpler, but until then FaLang seems like the best solution out there for many of us. Any updates?

Thanks,
Griffin
·
Saturday, 23 December 2017 18:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Griffin,

It's a little tricky because EasyBlog uses revisions and this would mean that the Falang plugin would need to be handling translations for many different versions of the content.

The only proper way to get this to work properly with Falang is to have revisions disabled and by doing that, you would lose out the ability to switch between different versions of the content

By the way, I have never used Falang before and neither have we setup a site with multi lingual contents before, I would really like to know what are the differences between Falang and also the core multi lingual system in Joomla.
·
Saturday, 23 December 2017 22:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark (Merry Christmas )

I'm no expert. I only once used mumti-language and that was with JoomFish (which was ehat Stephane forked when he created Falang.)

But my understanding is that the advantage is that Falang can work with a SINGLE cooy of each item where Joomla may require you
to (still?) recreate a copy of each article, menu item, module, etc. for each language.

Seems like it would get messy quickly. Falang seems to streamline with a signlemcopy and single UI with a pop up.

Perhaps the one limitation may be that it could (as of the last video I watched) only use standard characters in aliases. When I saw unicode Support by you guys in EB5.2 it got me thinking anout this and wondering if unicode aliases might arrive soon.

I've long hope that Joomla would re-do their multilanguage support soon to eliminate duplicate items. Maybe George will fast track this for 4.1 or 4.2.

Happy Holidays everyone!
·
Sunday, 24 December 2017 03:57
·
0 Likes
·
0 Votes
·
0 Comments
·
hey Griffin,

Easyblog 5.1 should be compatible with Falang, perhaps you can setup these both extension into your development site and see how it goes?

If those blog content still not load from the Falang translation after switch to another language, perhaps you can start a new thread so we can better have a check again?
·
Sunday, 24 December 2017 11:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Im happy someone else join this post.
Just to be clear at this point.

Why not use Joomla for multi language site
To make multi language site you have to create every single item (article, menu, module, etc) once for every language. Its like having 2 different sites, one on each language. You can VERY easily forget to duplicate some of the content. Or if you update an article for example, you should go and update the same on the other language. But there is no reminder. So its impossible to keep track if you have everything updated on both languages.

Falang
Falang solves all mentioned problems. You should have your site as usual. Only one item of everything for the main language. Then you can access Falang, and see all your items (menus, articles, modules, etc) and see if they are translated or not, even if you have some content translated, but you make some change to the original article, it will notice you that your translation may be outdated.
All translations are kept in Falang own table on DB.
On the FE, falang detects if you are browsing the site in the main language, then it just dont do nothing... But if you are browsing in the translated language, it gets in between the DB queries, and if it detects that you try to retrieve an article, instead of returning the original article, it returns the translated content.
In fact, for a single item falang allow to translate more than one field. For example you can translate the title, the content, the alias, etc... Even custom fields, you just have to set which fields you want to translate (DB columns).
Simple and clever.

Current status
At this right moment i have EasyBlog 5.1.15, and Falang 2.9.3 and my site is working fine with Spanish and English.
With EB 3.x Falang worked fine, but starting with EB 5.0 stopped working because the revisions. Using the code provided on the first post Falang would work again.
At some point between EB5.0 and EB5.1 i think stackideas made some fix and falang started working no matter the revisions., and no need to touch the code.
Some features still dont work, and ive asked Stephane if he could try to fix them. He is quite busy right now, although the fixes are not his concern, as Falang do work ok, but he still will try to twitch falang to work with the complex behaviour of EB.
I face some problem that falang translations overwrite the original EB content. I guess the problem was originated when updating EB. So now every time i have to update EB, i first disable falang, update, and then enable Falang again. Doing this i never had that problem again.

What still dont work
SEF url / alias translation for blog post is still not working for me. If i translate alias of a EB post, then the link becomes broken. (this works fine with any other component and falang, but not with EB).

Conclusion
Really, the revisions DONT CARE to falang. EB may keep as many revisions as they want, as long as the published content is placed on the_post table. Because that is what falang will check. When content is queried to EB _post table, falang will return the translated content. Also if the date of modification of this post is newer than the translation, then falang will notice that the translation may be outdated.
Anyway, i think its working fine right now... or at least for me.
What do not work is the alias translation, and i hope Stackideas and Falang could cooperate to work together. Ive been in touch with Stephane and he is willing to help on this, but i havent seen that much interest from Stackideas side.
I can mediate, test and help as much as possible if they need me.

Regards and happy new year!
·
Thursday, 04 January 2018 00:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for took your time to explained this, I will check further on this SEF url / alias translation issue and see if we can find a better solution to solve this.
·
Thursday, 04 January 2018 12:39
·
0 Likes
·
0 Votes
·
0 Comments
·
I will check further on this SEF url / alias translation issue and see if we can find a better solution to solve this.

That would be grate! When do you plan to have a look at this?
Regards
·
Thursday, 11 January 2018 18:29
·
0 Likes
·
0 Votes
·
0 Comments
·
We will include the fix in Easyblog 5.2.
·
Thursday, 11 January 2018 22:28
·
0 Likes
·
0 Votes
·
0 Comments
·

And when do you plan the launch of EB 5.2?
·
Thursday, 11 January 2018 23:29
·
0 Likes
·
0 Votes
·
0 Comments
·
No ETA on this yet but check out our blogs
·
Thursday, 11 January 2018 23:34
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you Mark, Martin and Arlex(!)

I have been holding off on my installation until Martin seemed satisfied. This is very promising good news. Thank you.

We will include the fix in Easyblog 5.2.
·
Friday, 12 January 2018 10:29
·
0 Likes
·
0 Votes
·
0 Comments
·
You're welcome Griffin
·
Friday, 12 January 2018 11:33
·
0 Likes
·
0 Votes
·
0 Comments
·
I have been holding off on my installation until Martin seemed satisfied.

hehe, please don't take my word, maybe I'm doing something wrong
·
Friday, 12 January 2018 17:26
·
0 Likes
·
0 Votes
·
0 Comments
·
I will keep you guys update when we release Easyblog 5.2.
·
Friday, 12 January 2018 23:08
·
0 Likes
·
0 Votes
·
0 Comments
·
I hope EB 5.2 is released before my subscription expires in a couple of weeks.
Ive been asking for this fixes for some years now, and it wont be fair not being able to enjoy them!
·
Wednesday, 21 March 2018 19:52
·
0 Likes
·
0 Votes
·
0 Comments
·
EasyBlog 5.2 is already at RC right now and I think you can try playing around with the RC
·
Thursday, 22 March 2018 01:15
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post