I enabled the i18n module in Drupal, and I have 2 URL for 2 languages. One is http://localhost/drupal/en/, another is http://localhost/drupal/zh-hant/.
When I visit the gallery page (http://localhost/drupal/gallery), Drupal changes the URL to http://localhost/drupal/en/gallery?g2_view=core.ShowItem&g2_itemId=7, and when I switch (use language switch block) to another language, the URL is changed to http://localhost/drupal/zh-hant/gallery?g2_view=core.ShowItem&g2_itemId=7
Although the URL is little strange (not a clean URL), it still works, both the interface of Drupal and embedded Gallery2 use the same language. But I found a problem, if the user is NOT login, everything is ok. But if user is login (admin), then when the language is changed, only Drupal's interface is changed, but Gallery still uses its default language.
btw, the "language selector" of the navigation bar in Gallery2 doesn't work too. I think it's not very important, since the Gallery is embedded in Drupal, we should use the language switcher of Drupal, not Gallery's.
Comment | File | Size | Author |
---|---|---|---|
#12 | htaccess_g2.txt | 2.03 KB | dennys |
Comments
Comment #1
profix898 CreditAttribution: profix898 commentedI guess there is a TODO for this somewhere in the code. I will check as soon as time permits (need to setup a debug install for i18n).
Comment #2
profix898 CreditAttribution: profix898 commentedThere are several issues with url handling (esp. with clean urls and url rewrite) if i18n module is installed. Lets pool all these issues here. For that I marked the following issues 'duplicate':
- search function of navigation bar doesn't work (http://drupal.org/node/185874)
- item action and i18n integration (http://drupal.org/node/186086)
Comment #3
profix898 CreditAttribution: profix898 commentedComment #4
profix898 CreditAttribution: profix898 commentedSome updates on the issues you described:
You should definitely use the Drupal search block and the Drupal language switcher instead of the G2 ones. We are talking about embedded gallery, so the master application (Drupal) should handle this stuff. The language switcher in G2 doesnt work, because Drupal overrides the language in the init() call for G2.
This was indeed buggy in the latest beta of gallery.module. I've just committed a patch to correct the behavior to cvs.
... is quite difficult to handle in this context. I'm inclined to say that URL Rewrite in G2 and i18n is a "won't fix" at the moment :( although some tweaks of the gallery module code might improve the situation. I will play a bit more with it and try to explain how this all belongs together in a follow up.
Comment #5
profix898 CreditAttribution: profix898 commentedLooks like it can work correctly with both URL Rewrite and i18n being enabled. Can you please get the latest cvs version and give it a try? I would really appreciate if you could test 1. with/without i18n and 2. with/without gallery_menu module. Thanks in advance.
Comment #6
dennys CreditAttribution: dennys commentedSorry, it still doesn't work with i18n. It's ok without i18n.
btw, the datestamp of gallery.info is "1193097835", is it the newest version? File time is 2007-10-23 08:03.
Comment #7
profix898 CreditAttribution: profix898 commentedThe packaging script for non-releases (development snapshots) runs every 8 hours only. You can get gallery_base.inc revision 1.6.2.44 and gallery_menu.module revision 1.1.2.19 directly from cvs or wait for the snapshot to be updated.
Comment #8
dennys CreditAttribution: dennys commentedI use cvs to get 1.6.2.44, the following is the test result:
Wihout i18n: everything is ok.
With i18n:
1. Search/Advanced search function: the same (loop to frontpage)
2. Item Action: the same (only 1st album is ok)
3. Switch language: it's ok now. Whatever I'm login or not, the language of the embeded Gallery is correct now.
I didn't install gallery_menu yet, I'm not sure what function should I test for it ?
Comment #9
profix898 CreditAttribution: profix898 commentedHmm. Not sure, but I cant get the search/action issues on my local install. There is a test site at http://scratch.profix898.de/ (user/pass: test1/test1). Could you please try there and tell me exactly what is needed to reproduce the error? Seems to work fine for me ...
Comment #10
dennys CreditAttribution: dennys commentedI checked the configuration in Drupal, both of the 2 sites are the same. I guess mayde the reason is .htaccess file because I found your album url is http://scratch.profix898.de/en/gallery/v/754059.jpg.html, but my is http://localhost/en/v/travel/IMG_1204.JPG.html
I found you said "Your 'Show Item' rule should start with 'gallery/'. Make sure to change the URL Rewrite rule(s) accordingly." in the document, I think it means we should modify .htaccess ourselver, right ?
The following is my .htaccess added by this Gallery module, could you tell me what should I modify? I tried to change all "v/" to "gallery/v/", but it doesn't work.
Comment #11
profix898 CreditAttribution: profix898 commentedThis message should come up on the 'Install' tab whenever 'gallery/' is missing in the rewrite rules. I added this to ensure people having correct rewrite rules configured in G2. Maybe I should also add a link to the actual rewrite configuration screen. However you dont need to modify .htaccess manually. Simply visit the 'URL Rewrite' section in 'Site Admin' of your (embedded) Gallery2. On the 'Rules' tab you can specify the rewrite rules and G2 will automatically modify .htaccess for you. Make sure the 'Show Item' rule is set to 'gallery/v/%path%'.
Comment #12
dennys CreditAttribution: dennys commentedI cannot modify the Rules in the (embedded) Gallery2 (I can save, but it doesn't change). But I can modify the Rules in the standalone Gallery2. But it doesn't fix the problem (the url problem in my previous comment is correct now, but search, item action still doesn't work)
Why I think this is a rewrite problem is because I checked the Apache log (I removed the browser information) and found a "301" redirect, I think the original url "/en/index.php?q=gallery" is correct just like your web, but it's redirected to the frontpage.
My other .htaccess of Drupal is the same as the original Drupal 5.3 and the attachment is the .htaccess file of Gallery2.
Comment #13
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #14
dennys CreditAttribution: dennys commentedSorry, I just downloaded gallery_base.inc,v 1.6.2.47, but it still doesn't work. So, I changed the status to active.
Comment #15
alexandreracine CreditAttribution: alexandreracine commentedDEV version not supported anymore.
------------
Feel free to reopen but please look at the latest version first! It's probably fixed.
http://drupal.org/project/gallery
Closing (cleanup)