Module: Multilanguage Support for Gallery3

gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Sun, 2011-02-06 21:28

EDIT: Latest multilang version can be downloaded from: multilang3_4.0.zip

Hello,

I have developed a module for multi-language for gallery 3. Using this the publisher can publish it's gallery in multiple languages. This is like Multilang module in Gallery2, with some additional features:

Features:
1. Allows publishing of photo items in multiple languages
2. Allows publisher to have language specific TAGs
3. Gives advantage of having an optional extra field Short Description. This can be used by the theme (e.g. $item->short_description) to boost the SEO
4. The filename can also be entered language specific, giving the advantage of image indexing by SE in multiple languages
5. A G3 Sidebar (see screenshots below), that shows all the alternative locales, in which the current item is available.

The multilang edit is accessible through
1. context menu
[img]http://gallery.menalto.com/files/multilang-context-menu.png[/img]

2. sidebar
[img]http://gallery.menalto.com/files/multilang-sidebar_0.png[/img]

The multilang edit dialog:
[img]http://gallery.menalto.com/files/multilang-edit.png[/img]

you can check the discussion thread at for more detail:
http://gallery.menalto.com/node/98170
--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Sun, 2011-02-06 21:38

Can this be added to contrib repository? is there any procedure for it?
--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
joe7rocks
joe7rocks's picture

Joined: 2004-10-07
Posts: 560
Posted: Mon, 2011-02-07 23:51

Could be added as a pull request in case you are familiar with GIT, otherwise will just get someone to take the zip and add it :)

Dog Photos | Gallery2 Themes Demo

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2011-02-13 01:40

I have created a skeletal codex page:
http://codex.gallery2.org/Gallery3:Modules:multilang
perhaps the community can help out with the documentation.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Cluster5020

Joined: 2010-05-08
Posts: 35
Posted: Sun, 2011-02-13 13:27

yaa, nice work gopu!! Thanks a lot!

How is the best way to update from my preVersion?

greetings.

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Sun, 2011-02-13 15:37

Just replace the old files with new ones
Deactivate the module, then activate it again.
--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
Cluster5020

Joined: 2010-05-08
Posts: 35
Posted: Wed, 2011-02-16 19:08

edit: Solved!

Thanks gopu.

Problem was caused by the old Beta Version I used ;)

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Mon, 2011-02-14 01:13

Is it happening when you try to edit a photo?
Or is it happening when you try to do multilang edit?

How can you help me in reproducing the bug?
- if it's your local setup, can I have the DB dump?
- if it's online, can I have the admin access?

--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
krikman

Joined: 2011-02-22
Posts: 24
Posted: Thu, 2011-02-24 12:20

Hi there/

Something badly wrong with interface of this useful plugin.
I cannot choose same destination folder for 2 languiges.

It writes:
"There is already a movie, photo or album with this internet address"

and does not save multilang editing.

what's may be wrong?

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Thu, 2011-02-24 13:24

You can not have same Album Internet address for two languages ...
If somebody browses that folder how the module will know which language internet address you want to browse to, accordingly which it can fetch you the texts
Unless the internet address for languages unique, there is no way to identify the locale of a URL

--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Fri, 2011-03-04 02:52

Any luck with automated Google Translate translations?

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
Materials, Courses, Resources

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Fri, 2011-03-04 03:09

No yet :)
As soon as i get time I will look into stuff as per the priority that I have set.

--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Fri, 2011-03-04 04:10

Also, can you think about making this work with Captionator and BatchTag modules? So that just like we do for default language, we can also mass tag/caption in additional languages...

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
Materials, Courses, Resources

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Fri, 2011-03-04 09:38

Another idea - Different headers based on viewing language selected

Themes like Greydragon allow users to input custom headers. Now, if you are running more than just a gallery, there is a fair chance that you use text in the header...even menus may be....so it is important to show different headers for different languages....

Obviously different people's headers have different text items...so what this would entail from this module's perspective is - having one field for header that can be entered in multiple languages...but this one field permits input of code (HTML, JS, PHP etc)

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
Materials, Courses, Resources

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Sat, 2012-09-08 13:13

EDIT: New version updated

Those who are using TAGs, one critical bug has been fixed regarding Tags.

If you are using it, you must upgrade to

http://gallery.menalto.com/files/multilang3_4.0.zip

--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
krikman

Joined: 2011-02-22
Posts: 24
Posted: Tue, 2011-04-19 22:51

About 2 months ago I play with this wonderful module and got some troubles. Now I more familiar with it and finally conclude that troubles with naming begins after repetitive changing _default_ locale in G3. Don't change defaults and module works as expected. Thanks.

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Wed, 2011-04-20 03:18

That's the reason why there is a warning about this before it gets installed.

The problem with changing the default language is that, the information on default language is maintained in core table (i.e. items)
Now if you change the default language, you could have changed to one of the languages, data on which is present in multilang_items table. That's where we have trouble.
We can swap the content of the multilang_items and items for ALL the photos/albums (could be in thousands) but that would bring unnecessary complication.

It could have been supported but beside the effort in development it requires lot of hours in testing also and that's for to support a unlikely scenario.
Default language is like mother tongue, it cannot/shouldn't be changed :)

--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
ignacio_db

Joined: 2011-04-22
Posts: 1
Posted: Fri, 2011-04-22 19:14

Hi,
First and foremost, thank you very much for this module. I've been using it for a while and it works fine. Only question is that I haven't found a way to edit multilanguage versions of the title and description for the root album. Any hints? Is it possible?
cheers

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Sat, 2011-04-23 05:27

Yes, you can.

For this you need to have multilang sidebar enabled.
Once you do that go to your root gallery page.
There through sidebar (click on the locale icons) you can edit the info for root item.

-gopu
--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Sat, 2011-04-23 13:38

Any change of getting Batchtag to work with multilingual? :-)

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
Materials, Courses, Resources

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Sat, 2012-09-08 13:15

hi sooskriszta,

EDIT: updated the download link
There was a critical data loss bug in TAG. If anybody using tag feature would have got affected by that.
Did you download the update and applied: http://gallery.menalto.com/files/multilang3_4.0.zip

To know whether you got affected or not, you can click on the individual tag names.
If you see the expected number of items for each than its fine. Else you too got affected by the tags.

Anybody who got affected by the bug, please report to me.

I have no plan for batch tag feature until all the basic are present and COMPLETELY bug free.

- gopu

--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Sat, 2011-04-30 14:51

I didn't get affected, as I don't have multilingual working on production site yet. At various times I have tested it on test installs.

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
Materials, Courses, Resources

 
krikman

Joined: 2011-02-22
Posts: 24
Posted: Wed, 2011-05-11 22:34

Thank you. There was an unpredictable mess with tags losses.
So I placed all tags in default language.

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Thu, 2011-05-12 02:10

hi krikman, sorry about your tag losses. with the updated one this bug is fixed.
--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
karin_de
karin_de's picture

Joined: 2011-06-16
Posts: 3
Posted: Thu, 2011-06-16 20:19

Thank you for this great addon, gopu! I have only used it for testing yet but I already like it a lot.

I wonder if you or someone else could help me with this one: I just imported my gallery2 into gallery3 but it doesn't seem to have imported the multi-lingual descriptions. Neither in the gallery itself I can find them nor directly in the database. (Using phpmyadmin the field ..multilang_items is showed to be gray.)
I installed the multilanguage support module, activated it and afterwards started the import.

Is there any somewhat automatic way to import the multi-lingual descriptions from gallery2?

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Fri, 2011-06-17 04:09

I am working on the feature to migrate the multilang content of G2 to G3.
In a week you will get it.
--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
karin_de
karin_de's picture

Joined: 2011-06-16
Posts: 3
Posted: Fri, 2011-06-17 21:13

That's great news! I'm really looking forward to it.

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Sun, 2011-06-19 08:46

Google Translations next in line? ;-)

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Sun, 2011-06-19 16:43

SoosKriszta, thanks for your patience. Yes, translation next in line.
--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Sun, 2011-06-19 16:46

karin_de,
Would it be possible for you to test multilang G2->G3 migration, if I give you a private drop of the code.

please let me know...
--------------------------------------------------------------------------------
my wings of love - work, experience, learnings, open source, technologies on my way to God

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Mon, 2011-06-20 04:54

Hello,

I have added the feature to import multilang data from Gallery2.

To import is very simple.
1. Update to this attached Multilang module
2. Click on Admin->Settings->Gallery 2 Import

It does not matter if you have already imported your G2 once.
Just for multilang you can to do it again, it will not affect anything else.

Enjoy.
--------------------------------------------------------------------------------
my wings of love - work, experience, learnings, open source, technologies on my way to God

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Mon, 2011-06-20 16:46

Good job! I hadn't started using multilang in G2, so can't test it, but I am certain this is a critical feature for many people who are still sticking with G2 for they are scared of losing the multilang capability.

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Thu, 2011-08-04 16:27

Hey Gopu, Still waiting with bated breath for Google Translate integration ;-)

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Thu, 2011-08-04 18:13

:) this weekend for sure i will work on it..
the problem is that no feedback from end users - no motivation to work
now since it looks like you are serious about this feature, i will work on it this weekend.
--------------------------------------------------------------------------------
my wings of love - work, experience, learnings, open source, technologies on my way to God

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Thu, 2011-08-04 18:26

I would greatly appreciate it.

This is the only thing stopping me from deploying this module on my production site.

Waiting eagerly.

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Tue, 2011-08-09 20:02

Gopu, hope you had a good weekend. Any good news on the Google Translate front?

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com

 
karin_de
karin_de's picture

Joined: 2011-06-16
Posts: 3
Posted: Tue, 2011-08-09 22:36

Hi gopu,
I am really sorry I haven't given you feedback for your new feature yet.
My problem is that I don't got the original g2 installation anymore since I have moved to another server. I only got copies of the (hopefully) right files and a virtual machine that resembles my old server. The past weeks I was too busy to get g2 running with these copies but I'm still really interested in your feature.
I hope to get it run and be able to give you feedback within this week. (Unfortunately I'm also struggeling with hdd issues so I can't make any promises.)

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Wed, 2011-08-10 04:33

SoosKriszta, i have started working on it.

I realized that the AJAX scripts that i tried for this, will no more be supported in post December 2011.
Hence, i need to use some other way. I found the new approach, there are issues. It only takes the language to translate.
I still have not got a AJAX way where I can give both the source and destination language to translate.

--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Thu, 2011-08-11 17:37

Hi sooskriszta,

it looks like Google Translation will be paid.
Read this http://googlecode.blogspot.com/2011/05/spring-cleaning-for-some-of-our-apis.html

The one that they are currently offering, will soon be deprecated.

I am dropping this task of implementing Language translation G3 multilang, unless a way is found to do it FREE.

-gopu
--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
betuska

Joined: 2011-09-06
Posts: 1
Posted: Tue, 2011-09-06 16:55

Hello Gopu.
Thank you very much for this module. It's perfect ^_^

Thanks

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Thu, 2011-09-29 11:08
sooskriszta wrote:
Also, can you think about making this work with Captionator and BatchTag modules?

Batchtag module allows the admin to apply a tag to all items in an album. Would be good if we can do this in other languages too...i.e. somehow making your multilingual play ball with rWatcher's Batchtag.

Similarly, captionator allows setting descriptions, titles etc of all photos in an album on one page. It would be good if we can do the same for other languages, not just default one. http://gallery.menalto.com/node/103744

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Wed, 2011-09-28 09:12
gopu wrote:
it looks like Google Translation will be paid.
Read this http://googlecode.blogspot.com/2011/05/spring-cleaning-for-some-of-our-apis.html

Damn! How about the free Microsoft APIs
http://msdn.microsoft.com/en-us/library/ff512404.aspx
http://msdn.microsoft.com/en-us/library/ff512435.aspx

SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Thu, 2011-09-29 15:03

I do NOT prefer to use Microsoft APIs for open source product.
--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Thu, 2011-09-29 15:28

What about BatchTag and Captionator functionality for non-default languages?
SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com

 
krikman

Joined: 2011-02-22
Posts: 24
Posted: Fri, 2011-11-04 19:00

Justs a little thanks to Gupu - Module still works.

http://photo.marktim.ru

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Sat, 2011-11-05 05:01

Thanks for you feedback. I appreciate it.
--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
letic

Joined: 2011-12-23
Posts: 13
Posted: Thu, 2011-12-29 18:48

Hey Gopu,

I tested the import features with the multilang module but it crashed with the following error :

2011-12-29 17:02:30 +00:00 --- error: exception 'Exception' with message '@todo G2_FUNCTION_FAILED' in /var/www/clients/client1/web1/web/gallery3/modules/g2_import/helpers/g2_import.php:1368
Stack trace:
#0 /var/www/clients/client1/web1/web/gallery3/modules/multilang3/helpers/MY_g2_import.php(57): g2(Array)
#1 /var/www/clients/client1/web1/web/gallery3/modules/multilang3/helpers/MY_g2_import.php(47): g2_import::g2_multilang_import(7, '1')
#2 /var/www/clients/client1/web1/web/gallery3/modules/g2_import/helpers/g2_import_task.php(137): g2_import::import_album(Array)

I scratched my head for a while as the code seemed ok until I enabled the mysql logs and found out that the MySQL query was wrong (at least with my DB, maybe the table was renamed later on and not by the the upgrade scripts), so here is a small patch to solve the issue :

--- multilang3/helpers/MY_g2_import.php 2011-12-29 18:25:31.000000000 +0000
+++ multilang3/helpers/MY_g2_import.php 2011-12-29 18:25:37.000000000 +0000
@@ -53,8 +53,8 @@
     global $gallery;
     if ($g2_id && $g3_id){
       $results = g2($gallery->search(
-                                                                 "Select [MultilangItemMap::language], [MultilangItemMap::title], [MultilangItemMap::summary], [MultilangItemMap::description] ".
-                                                                 "from [MultilangItemMap] where [MultilangItemMap::itemId] = ".$g2_id));
+                                                                 "Select [MultiLangItemMap::language], [MultiLangItemMap::title], [MultiLangItemMap::summary], [MultiLangItemMap::description] ".
+                                                                 "from [MultiLangItemMap] where [MultiLangItemMap::itemId] = ".$g2_id));
 
       while ($results && $result = $results->nextResult()) {
         $multilang = ORM::factory("multilang_item")

Or simply run :
sed -i.bak 's/MultilangItemMap/MultiLangItemMap/g' multilang3/helpers/MY_g2_import.php

After that the import module does run fine and most of the albums translations are correctly imported but some aren't (need to investigate why).

Anyway hope this help and thanks for the module
LeTic

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Sat, 2011-12-31 07:15

Thanks letic. I ll analyze and get back to this ASAP... probably by next weekend only
--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God

 
OC2PS
OC2PS's picture

Joined: 2010-09-08
Posts: 428
Posted: Sun, 2012-01-01 15:17

Hey, Gopu!

Any chance you'll get time to look at making BatchTag and Captionator multilingual soon?
SoosKriszta
Csillamvilag.com

Bodypainting, Facepainting, Glitter, Henna
HennaLap.com
GMAT coaching and MBA Admissions Consulting

 
Dogen

Joined: 2012-01-09
Posts: 10
Posted: Mon, 2012-01-09 17:25

Hello friends,
First of all thank you for great plugin.
As I actually installed it and tried to use, I faced following problems:
1. I added a new languages (snapshot in attachment) to specific thumbnail, but after page refresh edited thumnail displayed with "empty" image.
2. I entered a thumbnail to see "big" picture and it also displayed "empty"
3. As I clicked on picture I got "ORM_Validation_Exception [ Database Error ]:
ORM Validation has failed for multilang_items model" exception (see attachment)

Any ideas about that?

P.S: My gallery 3 was migrated previously from gallery 2

Thank you!
Dogen

 
gopu
gopu's picture

Joined: 2009-08-28
Posts: 137
Posted: Mon, 2012-01-09 18:33

Hello Dogen,

Is it possible to have admin access to your site? That's only easiest and fastest way to solve your problem.

-gopu
--------------------------------------------------------------------------------
my wings of love - work, experince, learnings, open source, technologies on my way to God