I set up my Image Galleries taxonomy translation method to:

Localize terms. Terms are common for all languages, but their name and description may be localized.

and then, I went to 'Translation interface', I refreshed taxonomies, I translated the taxonomies for Image Galleries (I translated term and description of 2 galleries I've created) but when I switch from english to spanish, the names of galleries (taxonomy terms) and their descriptions don't get translated.

Am I doing something wrong in the translation process?
Is 'Localize terms' translation method not working with Image / Image_Gallery module?

Any idea how to go over this and getting my galleries translated without duplicating them (I've already tried 'Per language term' but them the pictures inside a gallery are not displyed in its translated one, forcing me to upload them again)?

My images have no language as I don't want to upload them twice (this is also another issue I hope will be solved soon !)

Any help would be more than welcome !

Thanks in advance.

psc

CommentFileSizeAuthor
#10 image_gallery.patch1.04 KBhop

Comments

m13’s picture

yes, I have an Idea.

I am not sure this is correct http://drupal.org/node/360643
but it's all I found so far.

I have to say, I tried all possible settings "per language terms", "localize terms", "set language to vocabulary" for the Image Gallery Vocabulary but nothing seems to be working.

The problem is not the duplicate images one has to upload. The problem is that duplicate urls are created.

for example

Image galleries (vocabulary) --> image + /gr/image
floors (term in english) --> floors + /gr/floors
δάπεδα (term in greek) --> δάπεδα + /gr/δάπεδα

which means I get 4 url's and I only need 2.

the correct way would be

image galleries (vocabulary) --> image + /gr/image
floors (term in english) --> floors
δάπεδα (term in greek) --> /gr/δάπεδα.

Ι don't know whether you understand what I am talking about, it's been 3 days I am working on it and still, no result.

The only result I can get is that Localizer is not working properly with taxonomy terms OR my settings for content types and vocabularies are not set correctly.

any ideas would be appreciated.

metabits’s picture

Thanks for the link! It seems this is what I am looking for, but no idea how to aplly a patch to my sites. I am just a clever user, not a programmer... :(

psc

m13’s picture

hey, I discovered this one too http://drupal.org/node/377912

check out the second comment. It looks like we cannot escape duplicate urls and empty galleries :(

as for patch applying --> http://drupal.org/patch/apply

steff2009’s picture

Hi, here is my experience about creating and translating a gallery with Image module.

1. I created the original gallery and assigned it a name in Italian (I noticed that it was not possible to choose the gallery language upon creation, but didn't mess with it immediately)

2. I began adding images to the gallery, but saw that they would not display in the concerned gallery unless I specified the node language. As soon as I chose "Italian", the images would show.

3. I checked in the Taxonomy page and saw that a vocabulary for "Image Galleries" had automatically been created. As I wanted it to be "Gallerie di Immagini", I edited the vocabulary and changed the title. I also assigned translation mode "localize terms".

4. I then went to the translation interface, looked for string "Gallerie di Immagini" and added the EN version "Image Galleries".

5. When I started to add English translation for the images that I had created in the Italian gallery (by editing each image and clicking on "Translate"), I realized that I had to upload the image again and that a new node (for which a new alias was needed) was being created for each image in English.

When I look at my gallery and switch language, images and descriptin are brilliantly shown both in IT and in EN. I think it's correct that nodes and urls are duplicated, cause this enhances search and page ranking.

I only have one BIG problem: gallery names don't get translated!!! See what happens:

1. I'm on page Home > Gallerie di Immagini > Galleria Realizzazioni in IT
2. I switch to EN and I'm in Home > Image Galleries > Galleria Realizzazioni while it should be Home > Image Galleries > Projects Gallery!!

WHY???

The funny thing is that taxonomy terms have been translated and, if I navigate to taxonomy pages, I see all images in IT and EN under the correct titles: Galleria Realizzazioni and Projects Gallery.

Why do not gallery names get translated like taxonomy terms?

Thank you for sharing your opinion.

Cheers.

joachim’s picture

Category: support » bug
Status: Active » Postponed (maintainer needs more info)

So what you're saying is that if your gallery is /image/tid/6, then when you go to /taxonomy/term/6 the term name is translated properly?
This suggests taxonomy module does something to terms that we do not.
Can someone find out what taxonomy module does to ensure its terms are translated?

sun’s picture

Title: Localizing Image Galleries don't get them translated » Image gallery term translations not displayed
Status: Postponed (maintainer needs more info) » Active

AFAIK, i18ntaxonomy is required to translate taxonomies. Obviously, we don't really use the Taxonomy API (rather its data storage), so i18ntaxonomy is never invoked.

steff2009’s picture

Hi, yes taxonomy terms are translated (manually by me and switched through language switcher and i18n, as you can see at http://www.tendatech.com/taxonomy/term/4)

What it's not translated is the corresponding gallery name (see at http://www.tendatech.com/galleriarealizzazioni).

steff2009’s picture

Hello guys, any ideas or suggestions on my last post of one week ago above?

Thanks!

joachim’s picture

> Can someone find out what taxonomy module does to ensure its terms are translated?

Someone needs to do the above -- I don't have time at the moment.

hop’s picture

Assigned: Unassigned » hop
StatusFileSize
new1.04 KB

I applyed image_gallery.patch, I created (rename) taxonomy terms and description in (to) the default language and then, I translated them in Translation interface.

joachim’s picture

Status: Active » Needs review

That's a lot simpler than I thought it would be ... :)
Marking as needs review.

sun’s picture

Status: Needs review » Needs work

Well, but it's wrong. ;)

t() may not be used for user-supplied strings. We either have to conditionally invoke i18ntaxonomy, or we have to change the code, so i18ntaxonomy is invoked via Taxonomy API.

steff2009’s picture

Hi, shall I apply the patch or wait for review results?

Or maybe a new version of the image module is going to be released?

Thanks.

joachim’s picture

The review is that the patch is incorrect. A new patch is needed. Any fix to this bug will be here, before it appears in a new release: the issue queue is where we work on modules.

> We either have to conditionally invoke i18ntaxonomy, or we have to change the code, so i18ntaxonomy is invoked via Taxonomy API.

Do you mean that the taxonomy translation module is at fault?
I'm afraid I don't even know which modules are involved in translating terms -- is this core or contrib?
How does this translation module deal with modules that implement vocabularies such as forum? Does it do so correctly for any module or case by case?

steff2009’s picture

Hi, any news about working on this?

Both content translation and taxonomy modules are core (optional). Never experimented forum translation.

Cheers.

arpieb’s picture

I haven't tried this on the image_gallery.module yet, but I'm running into the same problem (English / German taxonomy terms). I also had to tackle this in UC2 running on D6.14 with the catalog not translating using the i18n taxonomy mappings. A friendly soul pointed me to a fix using i18n that seems to be working fine in my UC2 installation. Try loading the i18nstrings.module into image_gallery.module using:

// arpieb - include tt() method from i18n:
module_load_include('module', 'i18nstrings');

Now you can invoke the tt() method from i18n that uses the taxonomy translations on the terms you want to translate like so:

...
$vocabulary = tt('taxonomy:vocabulary:' . $vocabulary->vid . ':name', $vocabulary->name);
...
$name = tt('taxonomy:term:' . $term->tid . ':name', $term->name);
...

Not the prettiest hack ever, but it works flawlessly with the UC2 product catalog vocabulary with the i18n module enabled, and I plan on trying it on image_gallery.module as well... Unless of course someone comes up with a better fix...?

-R

DoctorWho’s picture

Is there a chance this fix (or some other one) will make it into one of the next releases? I don't really want to start modifying modules myself as it may lead to problems later.

I would guess that in this case it should not be possible to cause real problems as only the visible output is changed and never any data in the database. Is that correct, or is there a chance that it may screw up something permanently?

joachim’s picture

I don't know enough about translations and the other modules involved to tackle this.
So getting this fixed all depends on efforts from users of this module who understand how translation works.

DoctorWho’s picture

I have hacked together a solution as in post #18, I'll describe it a bit in case anyone else wants to use it.

I wrapped the gallery names in the tt() function. The i18nstrings module is enabled and no explicit module loading is needed in the code (The gallery will most likely also break, if you disable this module).

The use of the tt() function looks like that

drupal_set_title(tt('taxonomy:term:' . $gallery->tid . ':name', $gallery->name));
or
$content .= "<h3>". l(tt('taxonomy:term:' . $gallery->tid . ':name', $gallery->name), 'image/tid/'. $gallery->tid) ."</h3>\n";

If views is installed, the gallery will be shown using views and this code will not be used. To disable views I changed the path of the image_browser view from "image" to something else.

As the rest of the image_gallery module is not really i18n capable (hardcoded english count of images, etc.) and views is the future anyway, as far as I understand it, the best solution to the problem would be general i18n support for views. There are some hacks for the views module ( http://drupal.org/node/346028#comment-2257386 ) but I didn't try that.

joachim’s picture

> To disable views I changed the path of the image_browser view from "image" to something else.

Just disable that view entirely! And you mean 'image_gallery', not image_browser, I think.

> As the rest of the image_gallery module is not really i18n capable (hardcoded english count of images, etc.)
If there are places I've forgotten to use t(), please file bug reports! ;)

20th’s picture

subscribing

DoctorWho’s picture

Short update on the i18n galleries situation:

hacking the old gallery code (not the new views-based code) has some unfortunate consequences. Using the custom-pager based prev/next links does not work well, as the images are sorted differently. It is certainly possible to change that, but I decided to try another way.

I've found that the easiest way to get translated galleries is to patch the i18nviews module, as described in the thread http://drupal.org/node/346028#comment-2582956 . The patch is against the 1.2 version of the i18n module.

This method works very well for me, let's hope the patch gets included soon.

joachim’s picture

Status: Needs work » Closed (works as designed)

I think #887720: Term translation not working is also related.

At any rate, I think this is entirely a problem with Views and Views i18n. So closing this.

A potential fix for the non-views galleries is at #870654: Image node page, gallery view and subgallery view breadcrumbs not being translated.

Gill Xu’s picture

+1