Hi,
ran into problems with internationalization and path prefixes e.g. en/system/files..... as I see it you would need to alter the preg_macth a bit in line 308+ into

$lg = '';
if(module_exists('i18n')){
   $lg = '('.i18n_get_lang().'\/)?';
}
if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE && preg_match('/^'.$lg.'(\?q\=)?system\/files\//', $local_path)) {
   $local_path = file_directory_path() . '/' . preg_replace('/^'.$lg.'(\?q\=)?system\/files\//', '', $local_path);
}

Didn't go through with all the testing as I realized that it doesn't work with my custom file access settings, but thought someone might find it useful...

CommentFileSizeAuthor
#1 image_resize_filter_locale.patch1.91 KBquicksketch

Comments

quicksketch’s picture

Title: not working with i18n » Does not work with i18n/locale language path prefixes
Status: Active » Fixed
StatusFileSize
new1.91 KB

Thanks for the report. I made some modifications to your code and tested it out with/without path prefixes and it seems to address the problem. There are a few additional cases that needed to be handled by this final code:

- Path prefixes are provided by Drupal core, not i18n, so we shouldn't use any i18n function calls to determine the prefix.
- Image paths may not be in the same languages as the one that's currently in use (there's no reason why an "en" prefix would not be shown on a "fr" page).
- Some languages may not even have a prefix at all and fallback to the default.

This patch hopefully addresses all the problems, at the very least it doesn't cause any problems to existing installations. I've committed this patch to CVS.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.