151 replies [Last post]
aacraig's picture
Offline
Joined: 01/15/2010
Juice: 19
Re: Re: UC Localize - a drop in quick fix for internationalizati

Locale and 118n both. I'll have an update on drupal.org later today or tomorrow with the dependencies updated.

marcoBauli@drupal.org's picture
Offline
Joined: 12/17/2009
Juice: 12
Integrate Uc_i18n_sync and Uc_option_image

attaching a patch to Uc_i18n_sync at #30 above (thx!) that makes it sync also option images (uc_option_image) between translations.

AttachmentSize
sync_option_images.diff 1.41 KB
totsubo's picture
Offline
Joined: 11/12/2009
Juice: 164
Product deletion problems with multilingual UC installations

Just entered a bug report against UC concerning multilanguage and language deletion. http://drupal.org/node/694514

Basically if you added an item in one language you must be in that language in order to delete it from the cart. Anyone know of a workaround?

firewing1's picture
Offline
Joined: 07/07/2009
Juice: 126
Synchronizing translations - version 2

Totsubo brought it to my attention that with my module enabled, although the cart item's titles were localized it was still possible to add the same item in different languages to the cart and it was only possible to remove an item if you were viewing the cart in that item's language. I've extended the module a bit to solve the problem:

<?php
# Module written by Stewart Adam <s.adam at diffingo.com>
/**
  * Implementation of hook_i18nsync_fields_alter().
  * This function is loosely based on code sample from Docc: drupal.org/node/456358
  */
function custommod_i18nsync_fields_alter($fields, $type) {
 
$fields['uc_products']['#title'] = 'Products';
 
// These values were found by doing a print_r($node) in node-product.tpl.php
 
$fields['uc_products']['#options'] = array (
   
'model' => 'SKU',
   
'list_price' => 'List Price',
   
'cost' => 'Cost',
   
'sell_price' => 'Sell Price',
   
'weight' => 'Weight',
   
'weight_units' => 'Weight Units',
   
'length' => 'Length',
   
'width' => 'Width',
   
'height' => 'Height',
   
'length_units' => 'Length Units',
   
'pkg_qty' => 'Quantity',
   
'default_qty' => 'Default quantity to add to cart'
 
);
}

/**
  * Implementation of hook_add_to_cart().
  */
function custommod_add_to_cart($nid, $qty, $data) {
 
/* Due to Drupal's use of multiple nodes for product translations, the same
   * product in a different language is treated as a different product entirely.
   * This is problematic as the same product in different languages can be added
   * to the cart simultaneously. This function works around that problem by
   * always using the tnid/original node. As a result, the cart must be
   * localized as it is displayed. */
 
$node = node_load($nid);
 
// Determine if this node is the source node or a translated one
 
$is_source = $node->nid == $node->tnid? 1 : 0;
  if (
$is_source) {
   
// If it is the source, then all is well…
   
$result[] =  array('success' => TRUE);
  } else {
   
/* If we are not the source node, then fail to add this product silently and
     * call uc_cart_add_item() to add the source node's product instead. It will
     * be localized later - see custommod_cart_item() */
   
uc_cart_add_item($node->tnid, $qty, $data);
   
$result[] = array('success' => FALSE, 'silent' => TRUE);
  }
 
// Remember: We need an array in an array here
 
return $result;
}

/**
  * Implementation of hook_cart_item().
  */
function custommod_cart_item($op, &$item) {
 
/* hook_cart_display() isn't really a hook, it's mostly for internal use.
   * However, we do need to access later. Setting $item->module forces
   * a module_invoke() call in uc_cart.module to call custommod_cart_display()
   * instead of the default uc_product_cart_display(). We will call
   * uc_product_cart_display() inside our function to ensure things work as
   * usual in future versions. */
 
$item->module = "custommod";
 
/* Note that although it is possible to use check for case 'load' in $op and
   * then override the $item->nid and $item->title values, this will cause bugs
   * when attempting to add or remove products in different languages. To
   * resolve these bugs, we are forcing the use of custommod_cart_display() and
   * rewriting the code for the title, img, and anchors to localize the cart. */
}

/**
  * Implementation of hook_cart_display().
  */
function custommod_cart_display($item) {
 
/* Call uc_product_cart_display() to get things setup as usual and to ensure
   * this hack still works even if uc_product_cart_display changes at some point
   * in the future. */
 
$display_item = uc_product_cart_display($item);
 
// Get the translations, if any.
 
$node = node_load($item->nid);
  global
$language;
 
$translations = translation_node_get_translations($node->tnid);
  if (
$translations[$language->language]) {
   
// Reminder: NEVER override the nid. That is what causes the bugs!
   
$tnode = node_load($translations[$language->language]->nid);
   
$display_item["title"]["#value"] = node_access('view', $tnode) ? l($tnode->title, 'node/'. $tnode->nid) : check_plain($tnode->title);
   
$display_item["image"]["#value"] = uc_product_get_picture($tnode->nid, 'cart');
  }
  return
$display_item;
}
?>

Description of the problems and workarounds are in the code comments. I hope this helps! I'm going to be putting this into a downloadable module soon. Note that if you are not using "custommod" as the name of your custom module, please change the function prefixes accordingly. Otherwise, the hooks won't get called! As well, if you are using "custommod" as your module name and you're dropping in this code as a replacement, be sure to disable/enable the module to get the new hooks registered.

totsubo's picture
Offline
Joined: 11/12/2009
Juice: 164
Re: Synchronizing translations - version 2

Just want to report back that so far firewing1's module is working very well. No bugs to report.

With all of the help here and especially with firewing1's module I've mostly been able to get a Bilingual Ubercart installation to work.

There are still a few outstanding issues though:

1- On the checkout page, the cart contents pane always lists the products in English, even when viewing the checkout in another language.

2- The Catalog listing and the Language Switcher don't seem to work together well. My guess is that for some reason, the catalog block isn't able to lookup the localized versions of the taxonomy terms.

totsubo's picture
Offline
Joined: 11/12/2009
Juice: 164
Re: Re: Synchronizing translations - version 2

Firewing1 sent me a module that fixes part of #1 using a custom module and panel for the checkout.

I decided to use his code and technique and instead patch Ubercart's code itself. The problematic file is ubercart/uc_cart/uc_cart_checkout_pane.inc

I'm posting the patch here for people to use if they want. I'll also submit it using the Ubercart issue queue but I'm not sure how quickly or even if it will be accepted.

AttachmentSize
patch.txt 1.62 KB
totsubo's picture
Offline
Joined: 11/12/2009
Juice: 164
Re: Re: Re: Synchronizing translations - version 2

I submitted the patch to Ubercart. Anyone who wants to use it or has used/reviewed it please visit:

http://drupal.org/node/705786

And if the patch works for you please leave a comment saying so and set the issue status to 'reviewed & tested by community'

The patch probably won't be accepted until then Smiling

totsubo's picture
Offline
Joined: 11/12/2009
Juice: 164
Order status not translated

I just noticed that when emails are sent out to let the customer know that the status of the order has changed, the status is always in English.

Raised this bug report with patch: http://drupal.org/node/709870

Just fix line 414 in uc_order.module

line 414:
$values['order-status'] = uc_order_status_data($order->order_status, 'title');

should be:

$values['order-status'] = t(uc_order_status_data($order->order_status, 'title'));

gasperz's picture
Offline
Joined: 02/21/2010
Juice: 19
Re: i18n issues i D6/UC2 for Multilingual sites

Did anybody sucessfuly translated Order status (like "Pending", "Cancled",...)? I tried exporting all Ubecart strings with Potx module, translate string "Pending" and then import it back. But translated string was not shown. Does anyone have any idea how to do this?

br,
gapa

totsubo's picture
Offline
Joined: 11/12/2009
Juice: 164
Re: Re: i18n issues i D6/UC2 for Multilingual sites

I haven't been able to have the strings show up properly translated on the admin screen but the emails sent out when I update the status are correctly translated.

I think the strings you see in the drop-down list are fetched from the database which is what makes it next to impossible to translate them without a major code rewrite.

gasperz's picture
Offline
Joined: 02/21/2010
Juice: 19
Re: i18n issues i D6/UC2 for Multilingual sites

I am also having problems translating this two massages from uc_cart.module.

<?php
  $messages
['completion_existing_user'] = t("Thank you for shopping at [store-name]. Your current order has been attached to the account we found matching your e-mail address.\n\n<a href=\"!user_url\">Login</a> to view your current order status and order history. Remember to login when you make your next purchase for a faster checkout experience!", array('!user_url' => url('user')));

 

$messages['completion_new_user'] = t("Thank you for shopping at [store-name]. A new account has been created for you here that you may use to view your current order status.\n\n<a href=\"!user_url\">Login</a> to your new account using the following information:\n\n<strong>Username:</strong> !new_username\n<strong>Password:</strong> !new_password", array('!user_url' => url('user')));
?>

This two massages should show at order complete. But they are alway english. I don't have problems with other few checkout massages. I assume the problem is due to replacement variables.
Can anyone else confirm that and maybe also post a solution?

br,
gapa

firewing1's picture
Offline
Joined: 07/07/2009
Juice: 126
Switch the interface language

If you browse to /admin/store/settings/checkout/edit/messages in your store, you should see "This is a multilingual variable." under each of the text entry boxes. This means that if you switch the interface language and save the message again, it will use that message in when users browse in that language. For example in my English/French stores, I would need to save a message in English, then switch to French and save a message again in French. Then when French users checkout Ubercart will automatically choose the French version I saved, and default to English.

remaye's picture
Offline
Joined: 01/08/2010
Juice: 54
Hi I have a few problems with

Hi
I have a few problems with notification e-mail translation.
I've read here : http://www.drupalcommerce.org/node/97#comment-208
that : "Emails (invoices, etc.) seem to be sent to the user using the language that was used at the time the order was submitted."
But for me it's not the case at all : it's always in default language or in the administration language depending on the kind of mail that is sent
(see here : http://www.ubercart.org/forum/support/15800/customer_emails_internationa...)

Does anybody experimented the same ?

In fact it seems that order language is not saved anywhere, neither in order or user information (user created at order completion come without language settings)
and when the "Customer completes checkout" CA is triggered (at checkout completion), the language set in checkout seems to be lost
although the right language is recovered when returning back to site (after payement)

I'm not drupal expert and I can't figure out what is happening and how to fix it.

Any idea ? Thanks for helping.

totsubo's picture
Offline
Joined: 11/12/2009
Juice: 164
Re: Hi I have a few problems with

@remaye, you are right that this is indeed broken in Drupal/Ubercart. When I update the status of an order using the admin screen, the email will be sent out using the language that I, as the admin, am currently using. Ubercart doesn't care about the user's preferred language.

The only way around this I have found is for me to look up a user's preferred language manually, and then make sure I am viewing his order in the order admin screen using that language. It's a real pain.

I hate to say it but Drupal/Ubercart still hasn't gotten translations quite right.

remaye's picture
Offline
Joined: 01/08/2010
Juice: 54
Re: Re: Hi I have a few problems with

Thanks totsubo for your answer.
At least, it's already good for me to know that I didn't made something wrong somewhere!

But how to work around it ?
ok, it's a solution to send e-mail invoice, setting the administration interface in the customer language
but how to do that for mails automatically sent at order completion through conditional actions ?

As far as I could investigate what is going on, there is "just" a "missing link" during the order completion process :

When coming back to shop after payment you got the "thanks you for your order ..." page in the right language (the one the customer has choosen for his order).
So this information is not completly lost during the process...
But this information is not saved anywhere and the order completion process doesn't access to it (the uc_cart_complete_sale() function in /uc_cart/uc_cart.module)
Why ? And isn't there a way (session variable, watchdog ... ?) to retrieve the customer language and restore it or save it (in the user table for exemple)
If we can do that, it's done...
Any idea ... ?

Sorry I apologize if I'm saying "it's just to do that...or that..." and I would propose a concrete solution if I could, but I've reached my limits ...
Thanks.

anschinsan's picture
Offline
Joined: 07/29/2009
Juice: 8
minor improvement of hook_add_to_cart

I got my i18n site working with the recommendations in #100 from firewing1 (Thanks!)

My site has some products translated, others not. I got an error because the hook function tried to add a node with $nid 0 to the shopping cart, when the node had no translation so I added an if-clause to the function:

<?php
function hook_add_to_cart($nid, $qty, $data) {
 
/* Due to Drupal's use of multiple nodes for product translations, the same
   * product in a different language is treated as a different product entirely.
   * This is problematic as the same product in different languages can be added
   * to the cart simultaneously. This function works around that problem by
   * always using the tnid/original node. As a result, the cart must be
   * localized as it is displayed. */
 
$node = node_load($nid);
 
// Determine if this node is the source node or a translated one
 
$is_source = ($node->nid == $node->tnid) ? 1 : 0;
 
  if (
$is_source) {
   
// If it is the source, then all is well…
   
$result[] =  array('success' => TRUE);
  } else {
   
/* If we are not the source node, then fail to add this product silently and
     * call uc_cart_add_item() to add the source node's product instead. It will
     * be localized later - see custommod_cart_item() */
   
if ($node->tnid == 0) {
     
$result[] =  array('success' => TRUE);
    }
    else {
     
uc_cart_add_item($node->tnid, $qty, $data);
     
$result[] = array('success' => FALSE, 'silent' => TRUE);     
    }
  }
 
// Remember: We need an array in an array here
 
return $result;
}
?>
firewing1's picture
Offline
Joined: 07/07/2009
Juice: 126
Tutorial updated

Oh, sorry about that - I just realized that I had made some changes to the module but forgotten to update my blog post! I've updated them there. There's still an additional check we have to do:

<?php
...
$is_source = ($node->nid == $node->tnid || $node->tnid == 0) ? 1 : 0;
..
?>

This checks not only if we are the source for any translated notes, but if there even is a translated node. My previous code had a bug where adding a product with no translated nodes to the cart would result in this bizarre error message:

"" is not a product

Edit: BTW, I've also just updated my blog post to include the code for fixing product localization during checkout. Thanks for your support & help testing this everyone!

calbasi's picture
Offline
Joined: 03/01/2009
Juice: 108
Chaos patch is a good starting point?

I wonder if Chaos patch (http://drupal.org/node/488452) is a good starting point to solve this i18 Ubercart related stuff. If so, maybe we could collect some money for some coders start a module and maintain it!

Regards

---
calbasi.net
If you can not understand me, it's my poor English skills fault Sticking out tongue

totsubo's picture
Offline
Joined: 11/12/2009
Juice: 164
Re: Chaos patch is a good starting point?

Unfortunately the patch posted by Cha0s is pretty old and because there have been quite a few Drupal releases and one or two UC releases since he created the patch it doesn't seem to install properly anymore.

I'd be happy to contribute money to have someone fix this but I don't think a module is the right way to go. This should be fixed in core Ubercart or core Drupal.

There is a UC 3 now in alpha phase, I wonder if any though was put into better multilingual support?

calbasi's picture
Offline
Joined: 03/01/2009
Juice: 108
Re: Re: Chaos patch is a good starting point?

I agree best way is multilingual support was build in core, but that depends of ubercart team boys, and I think they are not very interested in this stuff. For this reason I think a module that patch / bypass ubercart core multilingual limits could be a good idea...

Ps: I have no idea of multilingual support in UC3 but I've not read anything about it... And waiting for a UC 3 release would mean we must wait for a long time untill all UC modules plus Drupal 7 modules were migrated... Too long for me Eye-wink

Ps: but I'm not a coder or a drupal / ubercart developer, and I don't if a module / patch is realistic task or not...

Regards

---
calbasi.net
If you can not understand me, it's my poor English skills fault Sticking out tongue

totsubo's picture
Offline
Joined: 11/12/2009
Juice: 164
Re: Re: Re: Chaos patch is a good starting point?

calbasi I feel your pain, as probably do most people who have posted on this thread.

For what it's worth firewing1 has a great post that lists the solutions to most of the basic i18n problems that Ubercart suffers from. You can find it here: http://www.firewing1.com/node/27

I've used all the solutions presented and they all work and solve most UC problems. Best of all using a tip from a comment on that site I was finally able today to solve my last i18n related UC problem, getting the language switcher block to work with the product/catalog view. Hooray!

calbasi's picture
Offline
Joined: 03/01/2009
Juice: 108
Stock sync

Hello totsubo,

I've read Firewing1 blog and his fantastic work, but it suck in a important feature (for me): the stock levels sync. If stock levels are not synchronized, I can NOT use the translation features (because is not acceptable have different stocks for the same product!).

But I suppose Firewing module and tips could be a good start point, because they solve a lot of i18 issues.

---
calbasi.net
If you can not understand me, it's my poor English skills fault Sticking out tongue

GiorgosK's picture
Offline
Joined: 07/05/2009
Juice: 45
Re: i18n issues i D6/UC2 for Multilingual sites

might want to take a look at
http://drupal.org/project/uc_localize

heyyo's picture
Offline
Joined: 05/17/2009
Juice: 36
Anyone has a solution for checkout panel in UC 6.2.4 ?

Anyone has a solution for the strings in checkout panel and add to cart button in UC 6.2.4 ? It was correctly handled in 6.2.2

http://drupal.org/node/834290#comment-3355194

calbasi's picture
Offline
Joined: 03/01/2009
Juice: 108
Re: Re: i18n issues i D6/UC2 for Multilingual sites

I had already seen it, but author replies to its issues had discourage me: http://drupal.org/project/issues/uc_localize?status=All&categories=All

Have anyone succeeded with it? And, then, why is not the module more maintained / improved /tested?

Regards

---
calbasi.net
If you can not understand me, it's my poor English skills fault Sticking out tongue

aacraig's picture
Offline
Joined: 01/15/2010
Juice: 19
UC Localize

I'm the author of uc_localize, and it certainly isn't a very advanced module (though it is being used in one of my production sites).

I wrote it more as a cry of anguish than anything else. I use Drupal exclusively in my design company, and I love it, but there is no excuse for its horrible non-implementation of internationalization features in today's modern and globalized world. True internationalization can only be done in core, and cannot depend on making copies of nodes for translations. A story in English and a story in Italian are the same story with different text, not copies of each other. The author is the same, etc. Copying nodes creates issues with maintaining sync across the copies, as seen with the SKU problem for generating reports.

It shouldn't be so hard to translate text in Drupal! It's got it's own handbook page! http://drupal.org/node/133977

We are about to do a slew of new multi-lingual sites. Depending on how D7 comes out for internationalization, we may do further development on UC Localize, but for now, it's on hold.

anea01's picture
Offline
Joined: 02/19/2009
Juice: 13
Multiprice and multilingual

Anyone else out there trying this - a multilingual site with multiple prices for a product? This thread seems to be the best informed group of people for multlingual UC sites so here goes. If anyone is interested, have a read:
http://drupal.org/node/913660
Basically it appears to me that UC 2.4 + i18n 6.x-1.7 + uc_multiprice 6.x-2.x-dev do not play nicely together and prices on translated (linked) page get deleted. I will carry on experimenting and report back here anything I find.

regards and thanks to everyone who has contributed in this thread - it has been most helpful.

Adam

anea01's picture
Offline
Joined: 02/19/2009
Juice: 13
Multiprice and Multilingual

I have done a bit more work on this today and the price deletions were being caused by the translation sync module in i18n. I have temporarily switched this off.

anea01's picture
Offline
Joined: 02/19/2009
Juice: 13
Attribute Translation

I know attributes have been covered a number of times in this thread and others but I haven't yet seen a solution I can use (given the direction my multilingual site has taken.)

For now, I can live with the large level of error-prone duplication that is undoubtedly created by the current architecture of UC 2.x when creating multi lingual sites. What I am desperately searching for is a way to translate attributes / options for the linked products. This should also mean that the SKUs should match up between each translated node attribute. I.e. The 'large', 'green' dress should have the same SKU as the 'grande', 'verde' vestido.

So, in short, aside from uc_localize (which follows a path that IMO creates other limitations that I am not prepared to have on my site), does anyone have a solution out there that they are prepared to share for the translation of attributes between linked (translation) nodes? I think if I cannot find a solution for this I will seriously have to reconsider my chosen platform for this solution.

So far, thanks to the community (most of whom appear in this thread), I have solutions for the architectural shortcomings of UC 2, but I can't help feeling that I am approaching this incorrectly. I am fighting to find stop-gap solutions rather than exploiting the inbuilt functionality of a complete multlingual compatible shopping cart. It is very frustrating to have (off and on) invested so much of my time over the last 2 years in UC only to find that it actually cannot do what I need it to do. (sorry for the negatives - having a bad day)

CpILL - somewhere you said that if you were doing it all again you would just do separate sites for each language. Do you stand by that statement today? Does anyone else have a view on this? Next release of UC perhaps? DrupalCommerce??? Another open source / relatively cheap shopping cart???? I am working on a 3 language site, with different fixed prices for different countries, in those countries' currencies. The product line is womens accessories so approximately half the products have attributes - colours (up to 10), size (up to 4). The only thing I don't have to worry about in this site is stock levels. The next one though is very similar to the current but DOES worry about stock .

Thanks

Adam

anschinsan's picture
Offline
Joined: 07/29/2009
Juice: 8
I know how you feel

I achieved all things I needed with Ubercart - but I feel I've not really done a good solution but only a huge amount of workarounds, hacks and ugly special code, I normally would be ashamed for.

A friend recommended Presta shop (http://www.prestashop.com), another OS Shop. The Demo looks really good - but I have not looked at it's code base and how data is stored. The guy who recommended it to me is a skilled server admin, has experiences with Joomla but no experiences with drupal. However, I think he knows what he's talking about.

Greetings from Austria!

CpILL's picture
Offline
Early adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/08/2007
Juice: 550
Re: Attribute Translation

Yes, i would still go with separate instances of Drupal, one for each language. You can probably share tables such as the stock levels table but the products themselves would have to be separate languages. Particularly if they have attributes. If your importing products then this shouldn't be too much work. Otherwise I don't see a reliable way to do translations with the current state of UC2

Uberdevelopment www.tsd.net.au/blog

kellogs's picture
Offline
Joined: 02/11/2010
Juice: 57
Re: i18n issues i D6/UC2 for Multilingual sites

I don't really agree with this point of view that Ubercart should not be fixed to support internationalization.
If we stick to Drupal core, everything should work or be marked "buggy" until someone fixes it.

The catalog block is an example where simple fixes could be applied with little to no side effect.
I think we should split a series of small patches and push them to the main Drupal.org website and wait for commit.

I would like to discuss a first issue, which is the catalog block:
http://drupal.org/node/951760

Bartezz's picture
Offline
Joined: 04/18/2008
Juice: 104
Re: Re: i18n issues i D6/UC2 for Multilingual sites

Ubercart should definitaly support internationalization, I think every Drupal module does.
As Drupal is an international community which international users andcontributors.

I'm struggling to make ubercart play nice with i18n. Thanx to firewing1 I'm slowly getting there.
I don't understand why initiatives of cha0s for instance (http://drupal.org/node/488452) haven't
been picked up?

Cheers

Chris8080's picture
Offline
Joined: 04/30/2009
Juice: 79
Hi all fellow-sufferer, how

Hi all fellow-sufferer,

how about the following approach:
There is one leading store, that synchronizes sperate stores and databases with for instance Services.

Basically it wouldn't harm me if the stock level wouldn't be correct.
The problem with the translation stays major - but wouldn't it be possible to have a German leading store and then sync the German products in other stores and then translate into English, French, etc.?

aacraig's picture
Offline
Joined: 01/15/2010
Juice: 19
Re: Hi all fellow-sufferer, how

Wow, a lot of time has passed and still no solution!

I have stopped using Ubercart due to this issue, but I thought the solution we're using might be useful to others (and probably could be applied to Ubercart, as well).

We now define a single Product content type which stores all of the product specific data (price, tax rate, etc.) and then a second Product Info content type which holds the language specific info. The Product type is mono-lingual, and each Product Info type contains a CCK node reference back to it's parent product.

In hook_nodeapi, it's trivial to load a product's Product Info (or vice versa) when a Product is loaded, so that the language specific data is available for easy display.

Chris8080's picture
Offline
Joined: 04/30/2009
Juice: 79
aacraig wrote: ... We now
aacraig wrote:

... We now define a single Product content type which stores all of the product specific data (price, tax rate, etc.) and then a second Product Info content type which holds the language specific info. The Product type is mono-lingual, and each Product Info type contains a CCK node reference back to it's parent product.

Still no solution to things like a multilang email on status changes and stuff Sad

aacraig's picture
Offline
Joined: 01/15/2010
Juice: 19
Re: aacraig wrote: ... We now

You're right, which is why we've discontinued use of Ubercart and for the moment are "rolling our own".

firewing1's picture
Offline
Joined: 07/07/2009
Juice: 126
Core hack

I've experienced this problem and well and it is moderately easy to fix but it requires a core hack... I am currently in the process of making sure everything works correctly and then I'll be submitting a patch to this bug report:
http://drupal.org/comment/reply/622388

Hopefully this can be resolved soon.

aacraig's picture
Offline
Joined: 01/15/2010
Juice: 19
Re: Core hack

More than a core hack, I think it requires a complete re-implementation of localization for Drupal. The whole concept is wrong from the ground up, and unlike just about everything else on Drupal, internationalization is hacky and not well implemented all around.

It's not a Ubercart issue, it's a Drupal issue, and one that I'd hoped to have seen addressed in D7. The whole translation system is a nightmare, IMHO.

Chris8080's picture
Offline
Joined: 04/30/2009
Juice: 79
Re: Core hack

firewing1, your efforts on this are great - no doubt at all.

I'm just worrying a bit that if the system is getting bigger and one would like to have more functionality, it's just difficult to maintain.
That is, if one wants to have more modules, features etc. maybe there will be any problems that interfere.

How about panels with views of products that should be loaded according to category ID and language?
How about sections?
How about the export of products in different languages?
Not sure though wich are pure Drupal tasks and where Ubercart interferes.

I somehow would not like to go with Magento since it is really huge - but it just seems to work a bit better here.

--

Still favouring Drupal, there must be another way to approach this.
I have to think this Service thing through and try to distribute the products among several shops and then just translate them.
Any thoughts on this?

Chris8080's picture
Offline
Joined: 04/30/2009
Juice: 79
Re: Re: Core hack

I was trying to get it somehow working with some very creative approaches but it's just too weak or too creative to be sustainable.
Now I installed Magento and it does everything out of the box - even though the system is just huge!

splash112@drupal.org's picture
Offline
Joined: 03/31/2008
Juice: 413
Re: i18n issues i D6/UC2 for Multilingual sites

Been working lately to the ultimate solution for Ubercart multilingual sites.
Things work at the moment on my sites, would love to have some input from testers and feature requests.

Please check here:
http://drupal.org/project/uc_i18n

tazir's picture
Offline
Joined: 01/27/2010
Juice: 44
Re: i18n issues i D6/UC2 for Multilingual sites

Port for D7, still need work.
Just for the first part - sync product attributes

AttachmentSize
uc_sync_i18n-7.x-1.0-dev.tar.gz 735 bytes
vensires's picture
Offline
Joined: 07/30/2010
Juice: 81
Re: i18n issues i D6/UC2 for Multilingual sites

I also encountered a lot of problems with Ubercart and Multilingual sites. And since I coudln't find a solution to my problem, I thought of a workaround.
In a site of our customers, we use panels and a view to retrieve and display the node information of a product. This includes all the attributes, the "Add to cart" buttons and everything else. I first thought of using the Node Translation as Panel Context to do what I had to. When I realised there was not one such context, I googled and found this: http://thereisamoduleforthat.com/content/node-translations-panels-and-ct... . I never used it though... The reason is...
From Views I get the nid as argument from the url.
I then add a relationship of Node translation:Source translation.
All I have to do then is to connect all the fields (except the Node:Body) with the relation. And everything works like a charm. No translation problem, no extra data and no way for the customers to buy the translated product. They will always buy the source.

PS: This is just a workaround and requires Views. This is not what you would call "a Drupal-way solution".

Tracy_CZ's picture
Offline
Joined: 05/07/2012
Juice: 5
D7 UC3

Hi everyone,

does anybody know about way how to do this in D7/UC3 ?

Because it seems like there is no way for usable ecommerce solution for drupal 7 Sad(

Thank you for any ideas.

Michal

aacraig's picture
Offline
Joined: 01/15/2010
Juice: 19
Re: D7 UC3

I'll be launching a fully multilingual UC3 / D7 site this week.

In creating the site, I've updated uc_vat and uc_vat_number to D7, as well as uc_option_image (which has nothing to do with multilingual, but needed a D7 port).

I've also created a custom module that addresses some of the issues raised in this thread, such as automating the copying of attributes and other properties among different languages of the same product.

You'll find updates in the issue queues of the modules I've mentioned, and when I have a chance to generalize the code, I'll release a i18n module for UC that addresses some of the more glaring omissions, so I guess you can watch my Drupal profile for when I get that out (http://drupal.org/user/118575)

Anyway, the takeaway is you CAN get a UC going that is multilingual. I suggest instead of everyone doing custom modules, though, that we pool our resources and solve the issues once and for all with a uc_i18n_* family of modules.

Tracy_CZ's picture
Offline
Joined: 05/07/2012
Juice: 5
Nice

Hi, nice to hear that some1 still reading this Smiling

Usually I am using prestashop for exommerce web, but not I have to create portal with a lot of things which I can do better with D7.

I would like to help with some module for this, but I am not sure that I know drupal core enough....

But if I can help, just tell me what where Smiling

JBerges's picture
Offline
Joined: 12/19/2012
Juice: 3
D7 / UC3 sync fields

I Only found how to enable sync fields.

Using http://www.firewing1.com/node/27?page=1 as guide, in D7 hook_i18nsync_fields_alter has changed to hook_i18n_sync_options.

So, create a new module and add this code to module file ( I've used 'uc_18n' as module name, change this to your module name)

function uc_i18n_i18n_sync_options($entity_type, $bundle_name) {
if ($entity_type == 'node' && in_array($bundle_name, uc_product_types())) {
return array(
'model' => array('title' => 'SKU'),
'list_price' => array('title' => t('List Price')),
'cost' => array('title' => t('Cost')),
'sell_price' => array('title' => t('Sell Price')),
'weight' => array('title' => t('Weight')),
'weight_units' => array('title' => t('Weight Units')),
'length' => array('title' => t('Length')),
'width' => array('title' => t('Width')),
'height' => array('title' => t('Height')),
'length_units' => array('title' => t('Length Units')),
'pkg_qty' => array('title' => t('Quantity')),
'default_qty' => array('title' => t('Default quantity to add to cart')),
);

}
}

Hope this helps.

Jordi

antsa's picture
Offline
Joined: 02/18/2013
Juice: 52
Re: D7 / UC3 sync fields

I can't get this to work. I've tried altering the code etc but with no success...

I'm using Drupal 7 with Ubercart 3.4 and i18n 1.8

magicalysia's picture
Offline
Joined: 01/27/2013
Juice: 4
Re: D7 UC3

I have been administering an ubertcart site usind D6 U2 for about 2 years (ecommerce before that). I am not a programmer and about half of what gets posted on these forums goes over my head.

However, I am having the same problems that everyone else here is having regarding the ability to have a site run in more than 1 language. Currently, our site is defaulted into french and I can't get any of the multilingual variables in the checkout messages to translate, effectively making the checkout pages appear in both english and french.

We are completely re-designing our site (about to begin) and I want to know if these issues are been solved in D7 U3? If not, I might want to seriously reconsider our options.

Are they other options? Should I assume the lack of postings on this thread since D7/U3 has come out means that this issue is resolved?