[! for the developers] Translation of 2 variables in the router

Started by man.of.earth, July 05, 2021, 18:06:33 PM

Previous topic - Next topic

man.of.earth

I did a few improvements to the translation of 2 variables in the /components/com_virtuemart/router.php file. It is helpful if 'number' and 'id'are translated as strings in /language/[lang]/[lang].com_virtuemart.sef.ini:


COM_VIRTUEMART_SEF_NUMBER="number_translated"
COM_VIRTUEMART_SEF_ID="id_translated"
COM_VIRTUEMART_SEF_ORDERDONE="order_sent_translated"


Lines 341, 344 and 570, per revision 10514:

if ( isset($query['order_number']) ) {
$segments[] = $helper->lang('number').'/'.$query['order_number'];# this translates the 'number' variable
unset ($query['order_number'],$query['layout']);
} else if ( isset($query['virtuemart_order_id']) ) {
$segments[] = $helper->lang('id').'/'.$query['virtuemart_order_id'];# this translates the 'id' variable
unset ($query['virtuemart_order_id'],$query['layout']);
}


if ( !empty($segments) ) {
if ($segments[0] == $helper->lang('number'))# this translates the 'number' variable
$vars['order_number'] = $segments[1] ;
else $vars['virtuemart_order_id'] = $segments[1] ;
$vars['layout'] = 'details';
}