Heya,

I'm having a problem with i18n and Gallery2, an image gallery module. When I activate i18n, it adds the language prefixes to the links inside this module.

For example,

Without i18n active a link looks (and works) like this,

http://mysite.com/drupal/index.php/v/image.jpg.html?q=gallery

When i18n is active,

http://mysite.com/drupal/en/index.php/v/image.jpg.html?q=gallery
http://mysite.com/drupal/fr/index.php/v/image.jpg.html?q=gallery

Which breaks the links. I tried installing the localizer module which supposedly can remove the prefix, unfortunately, this didn't work, I don't think it can be applied to modules.

It seems like a fairly simple problem, unfortunately my googling/searching forums hasn't turned up anything. I did find someone else who mentioned offhand he wanted to fix the proble (EdinJapan I think, something like that) but nothing concrete. Any help would be greatly appreciated.

Here is a link to the Gallery2 module for drupal, http://drupal.org/project/gallery

Comments

rootdown’s picture

I tried creating symlinks, where the directory /en/ would simply redirect to the parent directory.

It kinda works, but unfortunately the url retains the language prefix and breaks a few other things in the process. I suppose I could try a php redirect but I'm not sure that will work properly either, maybe since most of the info being transferred using GET and that will translate, not sure what else is under the hood though.

rootdown’s picture

Alright, I've come up with a better fix, kinda. I created the directory /en/ and /fr/ that these links refer to, then I created an index.php file for each with the following code:

$requested = $_SERVER['REQUEST_URI'];
$newstring = str_replace("/fr","",$requested);
header('Location:' . $newstring);

Replace /fr with /en or whatever language necessary. It works pretty well, the only problem is that switching languages does not work when browsing the gallery, pictures, or anything involving the embedded module.

I will try and figure out why.

jose reyero’s picture

Status: Active » Closed (fixed)

Cleaning issue queue for old versions. If you want to get any support consider using the forum or updating to 6.x.

See #626858: Internationalization 5.x Maintenance Policy. Approaching end of support.