Dear friends,

I know this is "another issue on translating Ubercart", but I would like to make sure simple issues are shared. This is not the big plan to rework Ubercart, only small issues...

So my situation is:
* i18n taxonomy translation module installed.
* settings.php
$conf['i18n_variables'] = array(
// Site name, slogan, mission, etc..
* My taxonomy for catalog is named 'Catalog'.
Translation option is set to:
"Localize terms. Terms are common for all languages, but their name and description may be localized."
IMHO, in small shops, there is only a simple product structure and we only need to translate it.
* Language switcher module installed.

So my first need would be to display the catalog in several languages.
It seems that the catalog block does not support t and tt translation.

Is there a way to fix this?

Kind regards,


A patch was proposed there:
Could it be reworked to display the catalog block?

Status:Active» Needs review
new5.24 KB

Please find attached the patch proposed on Ubercart forum by alexku (many thanks).
I applied it on our website, it works very well.

There is still an issue, as "Catalog" title is not translated, but this is a rather minor issue.

Status:Needs review» Needs work

There are a number of problems with your patch. First, it needs to be made in the proper format following The patch needs to be relative to the ubercart directory, not to the uc_catalog subdirectory. You need to follow Drupal coding standards. In particular, get rid of all the tabs. Remove commented out code, and remove the "fix by alexku" comments.

Also, the patch doesn't seem to take into account the comment from the thread at

It would help potential reviewers if you could describe here exactly what the patch is intended to do, including some examples of the current "wrong" behavior and how the patch will change that.

Also, isn't this essentially a duplicate of #697584: Language switcher does not work well with Catalog ?

This issue is dealing with the catalog block.
In Ubercart, the catalog block could never be displayed translated.

Were some of you able to display a translated catalog block using legacy Ubercart ca_catalog?

Kind regards, Grub

Okay, I am taking into account your remarks.

Priority:Normal» Critical
Status:Needs work» Reviewed & tested by the community
new3.04 KB

Attached patch works for 3 months in production.
Oping this diff complies with guidelines.

Priority:Critical» Normal
Status:Reviewed & tested by the community» Needs work

Could you please do what I asked in #3?

And, you can't mark your own patch as "reviewed and tested". I want to see someone other than you try this out.

Hi folks,
I "applied" the patch to my system and didn't get any changes.
For my understanding.
To explaine my problem.
If I use the the default taxonomy link of my products I get the right URL in my language switcher for all other languages.
But if I use the catalog link the language switcher doesnt give me the right URLs.

I changed the uc_catalog based on i18n-catalog-block-v3.diff but the behaivor of the
language switcher didnt change at all.
Any ideas?

new2.48 KB

Fixed titles on catalog grid view

Hi, I am using Drupal 6.22, i18n 6.x-1.9, Pathauto 6.x-1.5 and Ubercart

I have setup the UC catalog with a taxonomy configured as "Localize terms". I have tried #10 but this does not provide all the required functionality.

However, I have managed to get this to work as expected by additionally manually adding the following from the post at, which is where this patch has originated from and I am not sure why these were missed out from this patch:

- Applied all the changes described in that post to the file.

- Applied the changes suggested in the post in the uc_catalog.module for function uc_catalog_set_breadcrumb.

After all the above were applied, the catalog seems to be working as required when using 2 languages. I will carry out further testing and will report back any issues.

Can somebody please test and confirm if the above additions are required on top of the patch at #10, and if not why that is?

Also, I believe that the patch at #10 will have to be written in the proper format as described in #3. If some more people can test it would be great to get this commited.

On another note, I believe that if a "per terms" taxonomy is used for the catalog, then the fix suggested at the link below fixes this issue, as aslo mentioned in [697584]:

Thank you.


Hi, can somebody review the patch at #10 and my comments at #11? Thank you.

The patch is not in unified diff format (diff -u) which makes it harder to review and test.

Also, what happens if the user does not have i18n installed? Seems that tt() is not available in that case.

Hi longwave, thanks for the quick reply and the good work you are doing overall of Ubercart.

I have updated UC to 2.6 from 2.4 and have reapplied the code changes as I described in #11. I can confirm that this works fine for UC 2.6 too. The changes are required in the following 2 files of uc_catalog: uc_catalog.module and

I am not sure what is the exact format that you expect the patch to be in but if you refer me to the appropriate documentation I will try to produce that for you (apologies, I did not create a patch for Drupal before). However, I have attached the updated versions of these 2 files (with a txt extension in order to attache them) that contain all the changes so it would be easy to diff those with the original UC 2.6 files if required. I have also done a simple "diff filename1 filename2" on those 2 files and the output is also attached.

I am using i18n so I have not tested without it and I am not sure what the implications of using tt() would be if i18n is not used. Please let me know of any suggestions on this.

As mentioned in #11, some additional code was added on top of the patch in #10 of this issue in order to get this functionality to work. I have used the code in comment, but after this there was some extra work that had been done on that which I have not tested.

Let me know of your thoughts on what the best way is to progress this, thank you.

Please use diff -up filename1 filename2 to produce a unified diff; this provides more context (lines above and below your actual changes) and makes things easier for reviewers. You do not need to upload the full changed files, just the diff is enough - preferably with a .patch file extension. It is also helpful if you can test and patch against 6.x-2.x-dev rather than 6.x-2.6, though in this case there shouldn't be many changes.

If i18n is not installed (or disabled) I think the code will stop functioning as tt() will no longer be a defined function. You might need to keep the old code in place and use if (module_exists('i18n')) { ... } in order to handle both scenarios.

subscribe - would be great to get this working :)



Hi all. as per my comments in #15, I had managed to get the catalog translated ok in UC 2.6. I have now just started looking at the D7 version and I am trying to figure out what is the best way to setup a fully translated catalog. I see that now things have moved to views which is great, but from a brief play around it looks like there are still issues with translations for the catalog block, as well translations as other things such the titles in the category pages, the breadcrumb etc.

Does the work in this issue still needs to be done for UC 3 on D7, or otherwise can somebody please pointe me to the right direction on the best way to build a fully mulltiingual catalog? Thank you very much!

Thanks a lot #15 :)

@dimitriseng (#20):
For D7 you can get Language Switch Block working as suggested by the link you submitted on #11 ( with this.

Put following code in file "/modules/locale/locale.module" between line 1000 & 1001 (using D7.14)
(Other version: code goes in function "locale_block_view", just after the line "if (isset($links->links)) {")

if (preg_match("/^(catalog\/)([^\/]*)(.*)$/", $path, $matches)) {
  foreach ($links->links as $langcode => $link) {
    if ($str_tids = i18n_taxonomy_translation_term_tid($matches[2], $langcode)) {
      $links->links[$langcode]['href'] = "catalog/$str_tids". $matches[3];