VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: mgworld on July 07, 2015, 18:19:29 PM

Title: BUG FIX: ShopperGroups not translated in Account Maintenance frontend page
Post by: mgworld on July 07, 2015, 18:19:29 PM
Hi, I discovered a bug in the file edit_vmshopper.php. If you use virtuemart in a multilanguage scenario, the string of the shoppergroups is not translated in the "Account Maintenance" frontend page.

I fixed it by replacing the line 68:

<?php echo $this->lists['shoppergroups']; ?>

with this code:

<?php 
$sgArray explode(", "$this->lists['shoppergroups']);
$shoppergroups "";
foreach ($sgArray as $sg)
{
   $shoppergroups .= vmText::_($sg) . ", ";
}
$shoppergroups substr($shoppergroups0, -2);
echo $shoppergroups;
?>


Now all the shoppergroups strings are correctly translated and displayed.  ;)
Title: Re: BUG FIX: ShopperGroups not translated in Account Maintenance frontend page
Post by: Milbo on July 08, 2015, 20:27:25 PM
Thank you for the advice, but what you did is quickndirty fix not useable for the core. Furthermore you do not write your version. In the current version the problem is imho fixed.
Title: Re: BUG FIX: ShopperGroups not translated in Account Maintenance frontend page
Post by: mgworld on July 09, 2015, 10:25:41 AM
Sorry, I'm using Virtuemart version 3.0.9.4 and Joomla 3.4.3.

The problem is that if you use a string like COM_VIRTUEMART_SHOPPERGROUP_DEFAULT for the Shopper Group Name field of a shopper group, then, in the user profile that a normal user (not admin or superadmin... A simple registered user) could see from a normal page of the site, without my fix the user see the untranslated string COM_VIRTUEMART_SHOPPERGROUP_DEFAULT, instead of "Default Shopper Group" or similar.

Maybe you already fixed the bug in a beta in development?
Title: Re: BUG FIX: ShopperGroups not translated in Account Maintenance frontend page
Post by: Milbo on July 09, 2015, 10:37:17 AM

public static function genericlist($data, $name, $attribs = null, $optKey = 'value', $optText = 'text', $selected = null, $idtag = false,
$translate = false)

We use as last parameter "true", so it should be translated. The shoppergroups are translated for me. Just tested, works on j2.5.28, j3.4.1 and j3.4.3.
Title: Re: BUG FIX: ShopperGroups not translated in Account Maintenance frontend page
Post by: mgworld on July 09, 2015, 18:31:08 PM
Hi, I just tried a new clean installation of joomla 3.4.1, updated to 3.4.3, installed virtuemart 3.0.9, activated multilanguage plugins, and I have always the problem I mentioned in the previous post, as you can see from the attached image...

Are you sure you activated the multi-language plugins in joomla ("System - Language Filter" and "System - Language Code") ?
Title: Re: BUG FIX: ShopperGroups not translated in Account Maintenance frontend page
Post by: Milbo on July 10, 2015, 08:18:52 AM
Thank you, found.

It was not translated for non admins.
Title: Re: BUG FIX: ShopperGroups not translated in Account Maintenance frontend page
Post by: mgworld on July 10, 2015, 10:41:06 AM
Perfect, thanks! :)
Where can I download the fixed version?