Complete i18n handling for D6
| Project: | Gallery |
| Version: | 6.x-1.x-dev |
| Component: | Code / API |
| Category: | task |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
First, thanks for the great module!!
I am new to drupal, so please excuse for perhaps silly questions.
I just succeded in installing
drupal 6.1
module gallery from cvs ( -r DRUPAL-6--1)
gallery latest svn (Revision: 17490)
with url rewriting enabled and working in both drupal and gallery2 and *NOT* using i10n.
Usually the site runs with default language german. But since I got 404s for all items while being in gallery with links like:
http://abanq-de.dyndns.org/abanq/index.php?q=de/gallery&g2_itemId=41
http://abanq-de.dyndns.org/abanq/index.php?q=de/gallery&g2_itemId=68
that all worked correctly, when de/ language parameter was removed, I tried to set default language (back) to english, which did the trick.
So this issue seems somewhat related to http://drupal.org/node/185877, it doesn't seem to be the same, because I do *NOT* use i10n module and it is just a single language site.
In the module section I have activated Locale 6.1, but Localization client (disabled), Content translation (disabled)
Thanks for looking into it!

#1
Multi-lingual support is not yet fully implemented in the D6 development version of gallery module. We will be working on that as soon as the basic functionality is completed.
FYI: Drupal 6 incorporates many i18n features into core, so the extra module is only needed for additional features now.
#2
One thing I noticed is that if multiple languages are added and then the locale module is disabled the gallery uri is still rewritten with the language code. Perhaps a check for the locale module status is needed in gallery_base.
#3
Thanks a lot!
Sorry, wrote this two days ago, but forgot to send:
As a quick and dirty workaround I commented out lines 75-77 in gallery_base.inc ( // Language-prefix url rewrite), what just seems to work for the moment, since I don't need localization for this site.
#4
(bump)
#5
Patch to support multilingual sites committed to 6.x-1.x-dev. I didnt have time for in-depth testing, but so far everything appears working as expected. Please try yourself and report issues to the queue (create new issues for new problems, only use this thread if the old problem persists).
#6
#7
I have already installed the last version and still getting
/index.php?q=en
in my URLs.
They look like
http://mysite.com/index.php?q=en/mygallery2/whateveralbumoritem
and they return a page not found.
If I change per hand the query for just the language prefix, then it works and it links me to the album.
I don't know why it is not transforming "index.php?q=en" into just the language prefix in each case. It is very strange because the i18n block has already the prefixes right, also it is right the link to my embedded gallery2 in the drupal navigation menu but when navigating inside the embedded galleries, all links of albums and photos are having that query string.
Am I doing something wrong? Did I miss anything?
Thanks.
psc
#8
Automatically closed -- issue fixed for two weeks with no activity.
#9
This issue is still not fixed, so I changed the status.
As I wrote in another request which is also not answered, there is still a problem with multilaguage installation and clean URLs.
I repeat it here as long the other issue is set as a duplicate and maybe some people are not reading it.
I just want to resume and add some issues I've detected... I've been as systematic as possible.
In the next notation [lang] could be "en" "de" or "es", my three languages. Everything else works in Drupal in the three languages and Locale and i18n modules are activated. Clean URLs in Drupal are on and working.
____________________________________________________________________________
1.- With or without clean URLs in embedded Gallery2 enabled
Language prefixes don't get transform in embedded Gallery2. In both cases I get always /index.php?q=[lang]/
I loose all my blocks and primary/secondary links in top of my pages when being in a album or item page in embedded Gallery2. Exceptions to this are the grid block, Languages block and a block I create my self. No navigation block, no primary or secondary blocks on my side bars. Embedded Gallery2 Admin page is displaying everything and the root album (/mygallery2) is also displaying every block.
([lang] could be "en" "de" or "es")
____________________________________________________________________________
2.- Clean URLs in G2 activated:
- With clean URLs in embedded Gallery2 enabled my URLs look like
http://mysite.com/index.php?q=[lang]/mygallery2/whateveralbumoritem
and they return a page not found.
But if I change per hand the query for the language prefix alone, then it works and it links me to the album.
- The Languages block in Drupal it's not working properly. The URLs of Language block are like:
if I'm coming from the english page of embedded Gallery2 (/en/mygallery2)
http://mysite.com/en/index.php%3Fq%3Den/mygallery2/whateveralbumoritem
http://mysite.com/de/index.php%3Fq%3Den/mygallery2/whateveralbumoritem
http://mysite.com/es/index.php%3Fq%3Den/mygallery2/whateveralbumoritem
and they take me to the english version, no matter what language I click in the Languages menu block.
if I'm coming from the german page of embedded Gallery2 (/de/mygallery2)
http://mysite.com/en/index.php%3Fq%3Dde/mygallery2/whateveralbumoritem
http://mysite.com/de/index.php%3Fq%3Dde/mygallery2/whateveralbumoritem
http://mysite.com/es/index.php%3Fq%3Dde/mygallery2/whateveralbumoritem
and they take me to the german version, no matter what language I click in the Languages menu block.
if I'm coming from the spanish page of embedded Gallery2 (/es/mygallery2)
http://mysite.com/en/index.php%3Fq%3Des/mygallery2/whateveralbumoritem
http://mysite.com/de/index.php%3Fq%3Des/mygallery2/whateveralbumoritem
http://mysite.com/es/index.php%3Fq%3Des/mygallery2/whateveralbumoritem
and they take me to the spanish version, no matter what language I click in the Languages menu block.
The admin pages get redirect to the root album in the right language each case.
The root album (mygallery2) get the right links in the Languages block and is redirect to its version in each language.
- The G2 grid block doesn't take me to the item and I get an error:
ACCESS DENIED
warning: Invalid argument supplied for foreach() in /htdocs/mysite.com/drupal/includes/menu.inc on line 376.
You are not authorized to access this page.
([lang] could be "en" "de" or "es")
_______________________________________________________________________________
3.- Clean URLs in G2 NOT activated:
- With clean URLs not enabled my URLs look like
http://mysite.com/index.php?q=[lang]/mygallery2&g2_itemId=30
and fortunately they return the page of the album or item as expected.
- The G2 grid block does work as well and takes me to the item (photo).
- But the Languages block in Drupal cannot take me to the other languages album page. It returns a page not found. The links in the Languages block are of the form:
if I'm coming from the english page of embedded Gallery2 (/en/mygallery2)
http://mysite.com/en/index.php%3Fq%3Den
http://mysite.com/de/index.php%3Fq%3Den
http://mysite.com/es/index.php%3Fq%3Den
if I'm coming from the german page of embedded Gallery2 (/de/mygallery2)
http://mysite.com/en/index.php%3Fq%3Dde
http://mysite.com/de/index.php%3Fq%3Dde
http://mysite.com/es/index.php%3Fq%3Dde
if I'm coming from the spanish page of embedded Gallery2 (/es/mygallery2)
http://mysite.com/en/index.php%3Fq%3Des
http://mysite.com/de/index.php%3Fq%3Des
http://mysite.com/es/index.php%3Fq%3Des
I hope this can help!
I have been reading all the documentation several times and as far as I can tell, my installation is done properly, although it took me some time to understand how to set up everything.
I am using D6.3 and G2.3 and all modules are up to date.
Thanks.
psc
#10
I dont know enough about the gallery2 module and gallery2 itself, however I looked into the fix, and I am very sure this fix never was actually tested...
The original looked like this (Its in gallery_base.inc):
<?phpLanguage-prefix url rewrite
if (function_exists('language_url_rewrite') && $language->prefix) {
$embed_uri = str_replace('index.php?q=', 'index.php?q='. $language->prefix .'/', $embed_uri);
}
?>
The current version has just copied this attempt into a special case, however the str_replace in the first place is wrong.
I fixed it like that:
<?php// Language-prefix url rewrite
if (function_exists('language_url_rewrite') && variable_get('language_count', 1) > 1 && !empty($language->prefix)) {
switch (variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE)) {
case LANGUAGE_NEGOTIATION_PATH_DEFAULT:
$default = language_default();
if ($language->language == $default->language) {
break;
}
case LANGUAGE_NEGOTIATION_PATH:
$embed_uri = str_replace('index.php?q=', $language->prefix.'/', $embed_uri);
break;
default:
}
}
?>
In principle this is working, however it looks like this is only the ROOT Album (gallery), and doesn't include the sub albums(gallery/v) [is this part of g2 itself maybe?]. However this leads to the wrong language in most of the cases, since the "prefix" is not recognized by Gallery2, Gallery2 has a manual Language switch which is called g2_language=
So the urls should not look like
/de/gallery/v/
it should look like
/gallery/v/?g2_language=de
This should be possible to fix with a rewrite rule, right? At least I haven't found a rewrite rule for the language.
The fix above at least lets you browse the sub-albums, even though in the standard language, its similar to the hack in http://drupal.org/node/228864 (post 3 I think)
Argh now I wroted all this I see that there is something wrong with the breadcrumbs now...
but for tonight I have enough... (Sorry for double post into the duplicate thread)
cya
Apophis
#11
I chekced the patch of #10, but it's already in 2008-Aug-05 version. Just like you said, it still doesn't work for sub-albums.
And I cannot find any patch in #3, is there any suggestions for sub-albums ?
#12
Have the same problem,
Any solution as for now ???
#13
Here is the solution I came up with, http://drupal.org/node/168903#comment-1961804
#14
I would really like to see this fully implemented .. i am in the process of setting up and multilanguage site and would love to have gallery full implemented with i8n... Also i have located another issue logo translations do not work properly with the gallery module. I have a site where the logo translates properly except on the gallery page.. If you could post a patch just to add this functionality i would appreciate this.
#15
Thx for all the good work, confirm the same problem with
Drupal : 6.13
Gallery2 : 2.3
i18n : 6.x.1.0
When switching default language and rebuilding links the problem moves to the other language.
Would be a real accomplishment to get these 3 work together of the shelf. Multi-language sites with picture albums seem to grow in demand.