When a gallery is translated in another language and then viewed in galleries/my it shows as two galleries - one for the native language and one for the translation. In galleries/ shows only the native language. Also there is no way as far as I know to translate the images. Internationalization is very important thing... :(

CommentFileSizeAuthor
#6 Capture.PNG128.91 KBmishoboss
#6 Capture2.PNG126.97 KBmishoboss
#6 Capture3.PNG126.41 KBmishoboss
#6 Capture4.PNG68.13 KBmishoboss
#4 Capture.PNG55.59 KBmishoboss
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jānis Bebrītis’s picture

Status: Active » Postponed (maintainer needs more info)

- can You please point to translation file so I could download it and test what`s wrong with module?
- which images should be internationalized?

Thanks!

mishoboss’s picture

I don't know what you mean about "translation file", I'm new to the Drupal world :)
I use i18n module (http://drupal.org/project/i18n), added a bulgarian language and tried to translate the galleries and images. As far as I read you use regular nodes to represent galleries and images, so I tought it will be easy to translate.

I want to be able to translate the TITLE and DESCRIPTION fields of every image.

Jānis Bebrītis’s picture

what l18n modules did You enable? I still want to reproduce this situation.

mishoboss’s picture

FileSize
55.59 KB

I made a screenshot and attached it.

Jānis Bebrītis’s picture

.. all of them :)

can You also post srceenshots of what has to be translated and where galleries/my galleries are duplicated?

Thanks!

mishoboss’s picture

FileSize
68.13 KB
126.41 KB
126.97 KB
128.91 KB

I made some screenshots. Look at the URL to view the path and current language. This is for the gallery translation only. For the images I don't know how to translate, couse there is no "translate" button. When I edit an image in one of the languages it changes for all languages.

Jānis Bebrītis’s picture

Well, I see it now. That`s because "galleries" and "galleries/my" pages do not sort galleries by language. They just display gallery type nodes and that`s it.

The reason why is "new gallery EN" in "My Galleries" page only, is because "unpublished, empty or galleries without thumbnail" are not displayed in galleries list. They appear only in "galleries/my" list. This means that translation "new gallery BG" is not in use at all, and as far as i know node titles are never translated in drupal (or are they?).

I hope I understood You right, that those two entries, "new gallery EN" and "new gallery BG" are two different galleries (under 2 different node id`s)

mishoboss’s picture

Titles are translated in Drupal with no problems. I just tried it.

It is one gallery translated in two languages. I don't know how exactly Drupal makes translations. Now I see that it maybe creates new node for the translation and asociates it with the "source" node. Thats why I see one gallery as two. There is a bigger problem than that - in the translated gallery there are none of the images in the source gallery. Is there a way somehow to asociate the image nodes from the source gallery to the translated gallery?

mishoboss’s picture

I just resolved the issue with duplicating galleries. On line 1443 I added The following:

global $language ;
$lang_name = $language->language ;
$q_add .= " AND n.language in ('".$lang_name."')";

But the problem with the images stays :(

Jānis Bebrītis’s picture

i am not able to find translation string by node title, only built in translations. where did you do it?

for example, i created page type node "test page". When i tried to find "test page" term using translation interface, it returned "No strings found for your search."

mishoboss’s picture

As far as I know the translation interface is for translating the interface (menus, strings, in fact everything that passes thru t() function). The i18n module translates the content. That "test page" is content, it doesn't translate via t().

Jānis Bebrītis’s picture

well, then this would explain that nodes and their titles are not localization aware (and so does prog_gallery). I`ve seen people using views for these kind of things (seperating content according to language), the only problem is - views support is not ported for drupal6 version.

mishoboss’s picture

Nope, they are. Everything is localization aware. I did the gallery translation with the little hack I posted above. It works perfect now!

My next step is to make the images translatable too. They are all nodes, so they CAN translate. Now I read the i18n API and hope to hack your module to work properly with i18n. If I have success I will post the code here. Please, if you have any progress on this let me know. I am very very new to Drupal and now I learn everything from the beginning. :)

Jānis Bebrītis’s picture

wait. we have to roll back to "test page". a "test page" is title of page type node. if the title "test page" would be translate-able, so would prog_gallery node`s title too.

mishoboss’s picture

yes, that's right. You can translate title, body and any other CCK field of a node.

mishoboss’s picture

OK, after a day spent on understanding how Drupal actually translates the content I came up with the following solution for making this gallery multilingual:

- on a first place it has to check if there is installed i18n module
- when uploading a new picture there are the following options:
1. create an image node for all active languages, stores the "nid" value in their "tnid" field to asociate them with the original, then pushes the same data into them as the original "title" and "description". This way the user makes automatically translation copies of the just uploaded picture. Then he could edit them and actually translate via your "Edit" button.
2. create an image node for the currentlty selected language only, but then it has to be a "Translate" button next to "Add images", "Edit", "Delete" and so on. This is the way i18n actually works in other modules.

- when sorting and deleteing (but not editing) you have to update the nodes via the "tnid" field, not the "nid" field. This way you select all the copies you made for the different languages.
- you have to update all the SELECT queries to show nodes that are in the current language. This is easy and I did it today.
- in table "prog_gallery_images" in "g_nid" field you have to put the "tnid" of the gallery node, not the "nid"

This is it. It looks hard, but it isn't so hard. I made the half of this in less than a day. But my code is very ugly and I'm sure it could be much more optimized. You know your module better than anyone and I'm sure you could do it much better than I can. I'm also very new to Drupal and all this philosophy is entirely new to me.

wuf31’s picture

Maybe it'd be simpler to use the node clone module and set the "tnid" field instead ??

EDIT: Though even if it works, the updates on one Language will need to be synchronized with the other languages of the same node.

mishoboss’s picture

I made an extension to Rules module to handle i18n and especially to translate nodes. So when a new node of type image is created it automatically translate itself to all other languages. I didn't have time to test it with PROG Gallery so far, but I think it's going to work. I just have to touch a litle PROG Gallery to filter by language and to sync the order and delete for the different languages. There is no other sync needed. I work on a big project right now and I have zero free time, but I hope in a week or two to finish it and then I could work on this :)

There is no true multilingual gallery module so far and hope PROG Gallery will be the first with my help ;)

Jānis Bebrītis’s picture

I`m sorry, I do read this thread, but because my free time is also close to zero, I cannot do this now.

This issue is on really high priority and I really hope to get to this issue in this weekend.

mishoboss’s picture

Hi, any progress on this? :)

Jānis Bebrītis’s picture

unfortunately no - i`m still short on time and this issue scares me. I dont know where to start :/

mishoboss’s picture

Well, this is a serius upgrade to your module, but I'm sure this will affect a lot of people, couse there is no multilingial gallery by now. I still work on my project, but my upcomming project requires a multilingual gallery. If you want and have time we could share contacts and work together on this issue. Otherwise I have to go back to Joomla and use the gallery component I modified to be multilingual. However I really want to forget Joomla and go deep with Drupal :(