thevenusproject / old_tvp_website

This was the github repo for the old TVP website
1 stars 0 forks source link

Testing Falang #13

Closed BorislavZlatanov closed 9 years ago

BorislavZlatanov commented 10 years ago

I've been playing with Falang for some time, trying to get it to work, but unsuccessfully. You can read about Falang, it works by replicating the database tables.

Now, when I'm trying to translate an article, it works well (just doesn't translate the article title). But when trying to translate a menu item, it doesn't display the translation. So that's the main problem.

Yesterday I installed Falang on the test site. I was getting a php error (something about a non-object) when going into the places in the backend in Falang, where you input the translation for articles/menus/etc. I didn't bother to write down what that error was, thinking that it will stay. But it strangely disappeared. The only thing I think I did was to change the Falang database plugin ordering in order to put it first (following the advice here: http://www.faboba.com/en/composants/falang/faq.html ), don't know if that may have caused the php error to disappear, but I don't think I made any other change. Getting the plugin ordering back to what it was didn't bring the error back. I also tried to locate the error in the php error log, but it's not there.

I'm mentioning this php error because it's the only thing that I saw that's not correct with Falang. Everything else seems to work fine, but the menus just don't get translated. So I have no clue what the reason might be. If anybody can help with this, please do let me know. This issue is with high priority because we're having major problems with the current translation extension being used on the live site, and that prevents us from properly presenting the information in multiple languages. :/

barryfearon commented 10 years ago

I have the PHP error message:

Notice: Trying to get property of non-object in /var/www/vhosts/tvp-dev.linguisticteam.org/public/modules/mod_falang/helper.php on line 79

It appears here: http://tvp-dev.linguisticteam.org/en/?option=com_content&view=article&id=2

I have just spent a few hours looking at the way this is set up and couldn't get the module to display properly in the template. I even tried to un publish the Falang module in the [translatewidget] module position but it remained on the page. Adding extra languages in using the Language Manager didn't populate in the Falang dropdown on the home page but it did in the link above...

This would suggest that there is a conflict with another component. I have installed a demo Joomla 3 instal and have the Falang component working (Bulgarian which I used Google to translate so apologies if this is very bad Bo!) http://darkhorsemusic.im/joomla/index.php

It works fine but the translation has to be added manually, not sure if this is what you want. I think you were after an automated system? Let me know if anyone would like a log in so you can look at the admin settings.

barryfearon commented 10 years ago

I have just installed an extension called GTranslate here: http://darkhorsemusic.im/joomla/index.php It is sitting under the Falang extension, and displays flags above the search option. This uses the Google translation service and applies it instantly to the page. I dont know if this is something that you would consider but it seems to work, just don't know what the translation is like - Only speak English I'm afraid :(

barryfearon commented 10 years ago

Got Falang working and have identified the plugin’s that were causing the issues: System - Easy Frontend SEO; System - Jomsocial Redirect (this one stops the menu items from being translated); ITP was an issue but seems to be ok now - keep an eye on it.

BorislavZlatanov commented 10 years ago

Great stuff! I was trying to identify the conflicting plugin(s) before but couldn't manage to. Awesome that you have done it. :)

Now that we figured out what is causing the conflict, the next step is to see how we can resolve it. For example, the Jomsocial Redirect plugin is an important part of Jomsocial (prevents registration from the standard Joomla form and does redirecting to the online community), so we need it functioning.

Right now I am looking at the Redirect plugin and at Falang, trying to figure out where exactly the conflict might be. It is a bit beyond my level because my php knowledge isn't that good yet, and I don't know too well how Joomla works on the code level. But I'll let you know if I have some progress. I also know that the ordering of the system plugins is of importance, so that by itself may be all that's needed, but it will take research and experimenting to see if we can fix it by changing the plugin order.

If anyone wants to join in the fun, get in touch with me. :)

Btw, the GTranslate module that was mentioned is what we are currently using on the production site.

BorislavZlatanov commented 10 years ago

Update: in regards to the conflict between the Jomsocial Redirect plugin and the Falang Database Driver plugin, here is what I found. The Jomsocial Redirect plugin is located in /plugins/system/jomsocialredirect . By commenting out parts of that file, I discovered that the problematic line is line 34. But it turns out that that line is an include to another file - /components/com_community/libraries/core.php . So I went to that core.php file and by commenting out parts of it, discovered that the problem is two calls to javascript files. By commenting out line 946 and lines 957-961, the problem is gone and the menu items are translated.

So now I am looking to find out what exactly about those javascript files is causing the menu items to not be translated. Unfortunately, I don't know any javascript yet. :/

P.S. Here ( http://www.diffchecker.com/4k8ke26v ), on line 25, you can see a comparison of the sources of the same page - before and after commenting out those lines in core.php. As you can see, when the calls to those javascript files are not there, the menu items are translated.

LTIOfficial commented 10 years ago

Has there been any additional progress on this? :D

BorislavZlatanov commented 10 years ago

Yes: https://github.com/joomla/joomla-cms/issues/4204

BorislavZlatanov commented 9 years ago

Falang released a new version and the problem no longer exists there. Thanks to all who helped!