News:

Support the VirtueMart project and become a member

Main Menu

Multilanguage - language change issues

Started by ptrouw, January 26, 2017, 15:36:50 PM

Previous topic - Next topic

ptrouw

After upgrade to 3.0.18.7 the cart and search module and category product overview pages don't switch languages correctly.
After switching from for instance DE to NL the cart text on the homepage module isn't changing. Only after a second refresh the whole page has changed. It shows that the module has changed to DE, only the visible text string is still in Dutch "Winkelwagen is leeg", as you can see on the screen-shot.
Would a upgrade to 3.0.18.9 make a difference?

bortolani

I have the same problem: most strings are translated only after a second reload.

Now using VM 3.0.18.9 and Joomla 3.6.5 but the problem has been there also in previous versions.

You may easyly check that at www.puffosport.it


ptrouw

Yes, the same problem. Also sometimes it shows the string "MOD_VIRTUEMART_SEARCH_TEXT_TXT" in the search box instead of translation. Also here, a refresh does the job!

jjk

I have the same language switcher problem using the old (deprecated) VM Frontpage as the homepage and in the category views my 'Category description' and the 'Category name' don't switch with the first click on a different language flag.

In my case the category content switches completely if I disable my 'System VM OG Meta Tag' plugin.

Please check the following:
1. Check if disabling a third party VM plugin results into an improvement.
2. Set the 'System language switcher' plugin to 0 or first position (click on the plugin in adjust the order in the right hand dropdown list)

Didn't test yet to replace the VM Frontpage with the new category page system.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

bortolani

Tried both suggestions but did not work.
The problem has nothing to do with frontpage or category pages.
I have the feeling that it might not be related to VM but to Joomla.

Studio 42

@bortolani
Have you disable the Joomla cache for test ?

jjk

@Studio 42
Tested various settings yesterday, but was unable to find the source of the problem. When VM debug is enabled, you will see that some VM parts don't switch the language with the first click on a flag. The issues appeared only in the last few developer versions of VM. But to date none of the testers discovered what is causing this behavior.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Milbo

Quote from: bortolani on January 27, 2017, 17:08:06 PM
I have the feeling that it might not be related to VM but to Joomla.

Interesting point. It is maybe also related to the used php version. Also some 3rd party must be part of it, because I was not able to reproduce it on my system.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

Quote from: jjk on January 28, 2017, 13:44:56 PM
When VM debug is enabled, you will see that some VM parts don't switch the language with the first click on a flag.

There you see the culprit. I just need a vmTrace there. Makes it a difference with or without SEF?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

bortolani

Hi, I tested several configurations and the problem persists regardless of cache and seo, i.e. no matter if cache is enabled or not or SEF turned on or off, still translations are applied only on second reload.

Probably a 3rd party plugin. My impression is that T3 framework is causing the problem, but it's just a guess.

If you want I can give you full access to my test site www.puffosport.it/puffo2 to see if you have a better guess.

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

Quote from: jjk on January 27, 2017, 14:30:53 PM
2. Set the 'System language switcher' plugin to 0 or first position (click on the plugin in adjust the order in the right hand dropdown list)

First position, that is the key. I checked the page of bortolani, there are a lot plugins with "ordering" 0, but when you have 9 plugins which set them self on ordering 0,....
POSITION ! not the set ORDERING value! Just setting the plugin to top did not help, because most plugins stayed on top. So any plugin with ordering 0 should be set to position 1, except the 2 standard joomla plugins with ordering 0.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

bortolani

Hi Milbo, I'm not sure I understood you.
I moved the 2 language plugins (language filter and language code) and now they appear in the first two positions among system plugins, (ordering 0 and 1 respectively).
I can't see a way to move them ahead of other plugin types as each plugin type has its own ordering.

Moving the language plugins on top had no effect, still you need 2 reloads to set the lang variables as shown by vmdebug.

Probably I missed some steps...

Milbo

I tested a lot different ideas on bortolanis page, thank you for the direct access, so I could directly debug on the files.

It is always the same problem, some plugins use the onAfterInitialise() event. Even it sounds like that, it is not a good trigger, because joomla is NOT fully initialised. The routing (GET vars) and therefore the new language is missing. The language is meanwhile set per session to the last selected language.

The only way to avoid this, is to change the triggers in the plugins and to replace onAfterInitialise against onAfterRoute.

I even added as test a parameter to load the config without language, but then the plugin throwed errors for having no language. So some plugins, which use both events and dont need the language in onAfterInitialise can now load the config without language (3rd parameter to false)
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

ptrouw

#14
This tread is becoming very technical, but I still have the problem and don't know how to fix it. It seems that the site of bortolani, www.puffosport.it, works fine now. Can you confirm this? If so what was the fix?