Author Topic: Multilanguage - language change issues  (Read 3166 times)

ptrouw

  • Jr. Member
  • **
  • Posts: 118
Multilanguage - language change issues
« on: January 26, 2017, 15:36:50 pm »
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

  • Jr. Member
  • **
  • Posts: 91
Re: Multilanguage - language change issues
« Reply #1 on: January 27, 2017, 00:14:37 am »
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

  • Jr. Member
  • **
  • Posts: 118
Re: Multilanguage - language change issues
« Reply #2 on: January 27, 2017, 13:59:30 pm »
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

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3187
  • using Piwik instead of Google Analytics
Re: Multilanguage - language change issues
« Reply #3 on: January 27, 2017, 14:30:53 pm »
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

  • Jr. Member
  • **
  • Posts: 91
Re: Multilanguage - language change issues
« Reply #4 on: January 27, 2017, 17:08:06 pm »
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

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2432
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Multilanguage - language change issues
« Reply #5 on: January 28, 2017, 12:35:47 pm »
@bortolani
Have you disable the Joomla cache for test ?

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3187
  • using Piwik instead of Google Analytics
Re: Multilanguage - language change issues
« Reply #6 on: January 28, 2017, 13:44:56 pm »
@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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9416
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Multilanguage - language change issues
« Reply #7 on: January 28, 2017, 13:48:33 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.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9416
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Multilanguage - language change issues
« Reply #8 on: January 28, 2017, 13:50:48 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?
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

bortolani

  • Jr. Member
  • **
  • Posts: 91
Re: Multilanguage - language change issues
« Reply #9 on: January 28, 2017, 14:21:26 pm »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9416
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Multilanguage - language change issues
« Reply #10 on: January 28, 2017, 19:47:36 pm »
Sounds great, please send me per pn
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9416
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Multilanguage - language change issues
« Reply #11 on: January 28, 2017, 22:06:47 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.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

bortolani

  • Jr. Member
  • **
  • Posts: 91
Re: Multilanguage - language change issues
« Reply #12 on: January 28, 2017, 22:48:10 pm »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9416
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Multilanguage - language change issues
« Reply #13 on: January 29, 2017, 20:42:59 pm »
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)
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

ptrouw

  • Jr. Member
  • **
  • Posts: 118
Re: Multilanguage - language change issues
« Reply #14 on: February 12, 2017, 20:58:39 pm »
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?