Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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... :(
Comment | File | Size | Author |
---|---|---|---|
#6 | Capture.PNG | 128.91 KB | mishoboss |
#6 | Capture2.PNG | 126.97 KB | mishoboss |
#6 | Capture3.PNG | 126.41 KB | mishoboss |
#6 | Capture4.PNG | 68.13 KB | mishoboss |
#4 | Capture.PNG | 55.59 KB | mishoboss |
Comments
Comment #1
Jānis Bebrītis CreditAttribution: Jānis Bebrītis commented- 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!
Comment #2
mishoboss CreditAttribution: mishoboss commentedI 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.
Comment #3
Jānis Bebrītis CreditAttribution: Jānis Bebrītis commentedwhat l18n modules did You enable? I still want to reproduce this situation.
Comment #4
mishoboss CreditAttribution: mishoboss commentedI made a screenshot and attached it.
Comment #5
Jānis Bebrītis CreditAttribution: Jānis Bebrītis commented.. all of them :)
can You also post srceenshots of what has to be translated and where galleries/my galleries are duplicated?
Thanks!
Comment #6
mishoboss CreditAttribution: mishoboss commentedI 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.
Comment #7
Jānis Bebrītis CreditAttribution: Jānis Bebrītis commentedWell, 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)
Comment #8
mishoboss CreditAttribution: mishoboss commentedTitles 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?
Comment #9
mishoboss CreditAttribution: mishoboss commentedI 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 :(
Comment #10
Jānis Bebrītis CreditAttribution: Jānis Bebrītis commentedi 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."
Comment #11
mishoboss CreditAttribution: mishoboss commentedAs 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().
Comment #12
Jānis Bebrītis CreditAttribution: Jānis Bebrītis commentedwell, 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.
Comment #13
mishoboss CreditAttribution: mishoboss commentedNope, 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. :)
Comment #14
Jānis Bebrītis CreditAttribution: Jānis Bebrītis commentedwait. 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.
Comment #15
mishoboss CreditAttribution: mishoboss commentedyes, that's right. You can translate title, body and any other CCK field of a node.
Comment #16
mishoboss CreditAttribution: mishoboss commentedOK, 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.
Comment #17
wuf31 CreditAttribution: wuf31 commentedMaybe 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.
Comment #18
mishoboss CreditAttribution: mishoboss commentedI 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 ;)
Comment #19
Jānis Bebrītis CreditAttribution: Jānis Bebrītis commentedI`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.
Comment #20
mishoboss CreditAttribution: mishoboss commentedHi, any progress on this? :)
Comment #21
Jānis Bebrītis CreditAttribution: Jānis Bebrītis commentedunfortunately no - i`m still short on time and this issue scares me. I dont know where to start :/
Comment #22
mishoboss CreditAttribution: mishoboss commentedWell, 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 :(