Posted by jack13 on December 7, 2007 at 6:02pm
Jump to:
| Project: | Image watermark |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | jack13 |
| Status: | active |
Issue Summary
Watermark works only with English language. When you make use of the Locale module and switch to another language (e.g. German) it wont work.
Because $size['label'] (on code line 141) holds the translated string and not the array-key defined by image module.
Fix suggestion:
replace following code in watermark.module (line 140 to 152):
foreach (_image_get_sizes() as $size) {
$label_list[] = $size['label'];
}
$label_list[] = IMAGE_ORIGINAL;
foreach ($label_list as $label) {
$label_var = WATERMARK . $label;
$form['watermark']['labels'][$label_var] = array(
'#type' => 'checkbox',
'#title' => $label,
'#default_value' => variable_get($label_var, false),
);
}with:
foreach (_image_get_sizes() as $key => $size) {
$label_list[$key] = $size['label'];
}
foreach ($label_list as $key => $label) {
$label_var = WATERMARK . $key;
$form['watermark']['labels'][$label_var] = array(
'#type' => 'checkbox',
'#title' => $label,
'#default_value' => variable_get($label_var, false),
);
}
Comments
#1
OK i understand. I created the last dev version of watermark to use it on a german website ;-) We also use the locale module, that's why I changed the title.
To have an overview of issues for the next version, please give me your drupal and image module version here.
#2
sorry, I forgot
Drupal Version 5.3
Image Module Version 5.x-1.6
Image Watermark Version 5.x-1.x-dev