Closed (fixed)
Project:
Gallery
Version:
5.x-2.x-dev
Component:
User interface / Theming
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Feb 2007 at 00:03 UTC
Updated:
20 May 2007 at 21:31 UTC
Jump to comment: Most recent file
Comments
Comment #1
profix898 commentedI guess you have the locale module enabled in Drupal and your default language is set to spanish!? Whats the language settings for your standalone G2? Please try to replace
'activeLanguage' => gallery_get_language($user),in gallery_base.inc (line 46) with'activeLanguage' => 'es',. Does your embedded G2 appear in spanish now?Just to make sure: Some strings in G2 such as image/album titles (all actual content) will stay in your previous G2 language. Only the user interface is supposed to change the language. You can set G2 standalone to spanish for comparison.
Comment #2
profix898 commentedhttp://drupal.org/node/101423 is a similar issue, please let us continue there ... Thanks.
Comment #3
jgarabot commentedThank you profix898, it worked great. How do I change to that other thread? I am new in this forum stuff .
Comment #4
profix898 commentedDont worry, I thought you could simply post all your comments on this topic to the other issue instead.
Regarding "it worked great": You mean embedded G2 is switching to spanish if you use the snippet? That means there is a bug in
gallery_get_language(). It would be really helpful if you could make some more changes and post back the results. I cant reproduce this issue on my install.1. What PHP version are you running?
2. Make sure you are using the latest version of the gallery module.
3. Please apply the patch (attached to this post), browse to your main embedded gallery page (/?q=gallery) and post or mail me the output.
In case you dont know how to apply patches read http://drupal.org/node/60108 or simply copy/paste the few lines into gallery_base.inc.
Comment #5
jgarabot commentedGallery version = 2.1.2 core 1.1.0.2
PHP version = 4.4.1 apache
Webserver = Apache/1.3.34 (Unix) PHP/4.4.1 mod_ssl/2.8.25 OpenSSL/0.9.7a FrontPage/5.0.2.2635
Database = mysql 4.0.26, lock.system=flock
Toolkits = ArchiveUpload, Exif, Ffmpeg, Getid3, NetPBM, SquareThumb, Thumbnail, Gd
Acceleration = none, none
Operating system = Linux webster.worldispnetwork.com 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686
Default theme = matrix
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1
http://www.eloasisrd.org/?q=gallery&g2_0=gallery&g2_fromNavId=xb6eb5aab
uid>0) ? $user->uid : '';
$params = array('embedUri' => $embedUri,
'g2Uri' => $g2Uri,
'loginRedirect' => url('user/login', null, null, true),
'activeUserId' => $active_id,
'activeLanguage' => 'es',
'fullInit' => $full);
I hope this helps
Comment #6
profix898 commentedActually it would be more helpful, if you'd apply the patch and send me the results ... To see how
gallery_get_language()works on your configuration could help to fix that function!Comment #7
jgarabot commented"Actually it would be more helpful, if you'd apply the patch"
I would really like to help, but I read the "how to apply a patch", and I really do not understand, since I am not very technical. if you could tell me where to go in my hosting account to do that step by step I will be glad to do it.
Comment #8
profix898 commentedThat shouldnt be the problem. Attached is a ready-patched version of gallery_base.inc (you can simply remove the .txt at the end). Replace the file in your install with the attached one and browse to your gallery page. You should see some debug variables printed. Restore the original file, send me the debug output and hope it will help to fix this issue. Thanks a lot for your help.
(You can also mail (http://drupal.org/user/35192/contact) the output, if you dont want to post it here.)
Comment #9
jgarabot commented"That shouldnt be the problem."
I attached the patch results. I hope this is what you need.
Comment #10
profix898 commentedThanks again jgarabot! That is what I needed, yes! If I got this right from the debug output you are using a custom language code ('esl/spa es'). Is there any reason to no use the Drupal buildin "Spanish (es)"? Gallery2 only supports the ISO 639-1 language codes (alias alpha-2 code) AFAIK. See http://www.loc.gov/standards/iso639-2/php/code_list.php for details. What means language switching for embedded G2 works nicely with Drupal buildin language codes, but not with your custom one.
I will write a regexp based filter to extract the alpha-2 code or translate alpha-3 codes accordingly, but I doubt there will be support for mixed codes (such as yours) ...
Comment #11
kiz_0987 commentedGood pick up. The string regexp is a great idea. It would be useful to provide an error message if the language code will not work for Gallery2 (ideally Gallery2 embed code would have done this) but perhaps something is possible in gallery.module. One issue though will be turning off the error log (or watchdog) once you know there is a language arror but choose not to fix it (otherwise a log will occur on every gallery page view).
Comment #12
jgarabot commentedI am using the Drupal build in "Spanish (es), I just imported it as a custom language and wrote that code name by mistake, because I did not understood very well the process when I first installed it.
Comment #13
jgarabot commentedIs there a way I can change the code to (es)?, I tried importing Spanish again and the translation is only 69%.
Comment #14
profix898 commentedThere is no UI to do that in Drupal, but you can make the changes to the database manually. Try to run the following 2 queries:
You should check the language codes again and make a backup of your database tables!
Comment #15
jgarabot commentedI imported the Spanish again this time with the right code and added the 4.7 Spanish. now it is working fine. with the (es)
Comment #16
dsp1 commentedi am glad i found this post. i did not know and and it seems there are many posts with people struggling with this issue on drupal and gallery forums.
As far as I can tell, correct me if i am wrong, the USER must change the language in the account to see the language in Gallery2. The anonymous user, drupal language switching or gallery2 language selector (embedded) will not work. is this a bug? is there a fix?
Comment #17
profix898 commentedSimple regexp added for Drupal-5--2 branch. We will need to check this again for Drupal-6, because it will support full RFC4646 language codes ...
Comment #18
profix898 commentedLooks like this is a reasonable solution. Marking fixed as it is part of the 5--2 branch.
Comment #19
(not verified) commented