News:

Support the VirtueMart project and become a member

Main Menu

[SOLVED ]product Translation problem in a component

Started by ereallstaff, April 11, 2012, 17:28:43 PM

Previous topic - Next topic

ereallstaff

Hello everybuddy I am trying develping a custom component to insert multi language product with virtuemart.

need to set first a product in italian so I build a product array like this, then call vmModel('product)->store($product) and it's all ok :
    $productVM["vmlang"]="it-IT";
$productVM["product_name"]="prodotto Italiano";
$productVM["slug"]="prodotto Italiano slug";
                        $productVM["product_s_desc"]="prodotto Italiano descrizione breve ";
...........................

and then I try this following and call again vmModel('product)->store($product), but system over write previous values in italian table :

    $productVM["vmlang"]="en-GB";
$productVM["product_name"]="ENGLISH product";
$productVM["slug"]="ENGLISH-produc-slug";
                        $productVM["product_s_desc"]="English product description";
...........................

I assume there should be some step to change current JApplication-> set new language in the middle, but after many trial I was not able to reach them

Could someone help please?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ì
Try out our new joomla background rotator ( for joomla 1.x or 2.x), for only 14,99 eur @ innovailweb.it

Studio 42

I don't understand all your system. SImply follow the mvc patern to do it work.

For your information a final version of my tranlslator is ready, only some last testing but it work perfect.

If you try to store multiple language the best way is to do it in ajax and changing the vmlang values each time.
If you want do it with a loop then you must use setVar('vmlang';$lang) (and im not sure it work)

ereallstaff

Simply following the mvc. What it means, sorry?
I have trying modifying the vmLang simply as you see in the first example but it does not works.  Following my first example it overwrite the ..product_it_it table without inserting on en_gb

Can you confirm that editing only the vmlang variable of a product is enough?

Where I can see your component?
Thanks!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ì
Try out our new joomla background rotator ( for joomla 1.x or 2.x), for only 14,99 eur @ innovailweb.it

ereallstaff

Ok I got it

I though that the first item of the array vmlang could be enough.

but it's not so manually  set


$app->initialise(array(
   'language' => 'en-GB'
));
             
                $b= VmConfig::set('vmlang','en_gb');

And it seems working

Thanks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ì
Try out our new joomla background rotator ( for joomla 1.x or 2.x), for only 14,99 eur @ innovailweb.it