Author Topic: Virtuemart sometimes erroneously defaults to English  (Read 164 times)

at

  • Beginner
  • *
  • Posts: 9
  • A beginner
Virtuemart sometimes erroneously defaults to English
« on: November 10, 2018, 19:48:38 pm »
Hi,

Recently our Multilanguage shop started behaving weirdly. We're using Virtuemart 3.4.2 on Joomla 3.9.0 (powered by the latest php7) and a custom template.

The default language is English. But if I switch to Russian and do some changes in the cart, e.g. change product quantity and click 'update', VM should show a warning in the language of the user interface. It should say "Warning" and then warning text, both in UI language. However, "Warning" is shown in Russian but warning text in English. I went to vmInfo() function and changed line 57 from $msg = vmText::_($publicdescr) to $msg = vmText::_($publicdescr) . '  ' . JText::_($publicdescr). And repeated the action in the cart. This time, the text generated by vmText was wrongly in English, but the text generated by JText was correctly in Russian.

Related to that, if I go to account management in the front-end, the form for creating a new account is shown. If I'm in the Russian version of the website, it's in Russian. However, when I click the Cancel button on the form, this same form is shown again with Russian header, but this time, all field labels are in English.

The categories and products, however, are still shown in the correct language. The cart is shown in the correct language. So it's not that everything is broken. It seems that in some cases, Virtuemart thinks the user views the English version of the website when in fact it's not the case.

What could have gone wrong? I can't trace it to a particular action, but this for sure happened after updating Joomla to 3.9.0. Not sure whether installing another Virtuemart frontend language could have caused this.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8558
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Virtuemart sometimes erroneously defaults to English
« Reply #1 on: November 11, 2018, 10:41:59 am »
first stage is to use the VM debugging to test the what VM thinks its lang is...

and test what $lang = vmLanguage::getLanguage();  is in administrator\components\com_virtuemart\helpers\config.php  function vmInfo()
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

at

  • Beginner
  • *
  • Posts: 9
  • A beginner
Re: Virtuemart sometimes erroneously defaults to English
« Reply #2 on: November 11, 2018, 11:41:22 am »
Well, $lang in vmInfo() references everything related to en-GB, the website's default language, regardless what's the actual UI language.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8558
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Virtuemart sometimes erroneously defaults to English
« Reply #3 on: November 11, 2018, 12:19:15 pm »
Then we must assume this is a bug?

Max reads all these posts so will probably respond further
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation