I'm not totally sure, but I think the customizable node link text is not only meant for lightboxes with image.module managed images but also for the imagefield/imagecache ones. Which would mean that t('View Image Information') in the imagecache formatter needs to be replaced with variable_get('lightbox2_node_link_text', 'View Image Details') so that the customized link text is also used there.
While rolling this patch, I also noticed that the 'View Image Details' occurrence in the admin form is not translated at all, and the occurrence in the JavaScript settings wraps a t() around the whole variable_get(), which makes this hard to translate because potx (or the former extractor.php) can't extract the string for translators. Wrapping the string itself inside the t() makes the translation for the default value more accessible and also makes the translated value appear on the admin form in case the translation has already been imported. While I was at it, I also did the same thing for the 'lightbox2_image_count_str' variable in addition to 'lightbox2_node_link_text'.
Hope you like it this way.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | lightbox2-use-customizable-node-link_0.patch | 1.69 KB | jpetso |
| lightbox2-use-customizable-node-link.patch | 534 bytes | jpetso |
Comments
Comment #1
jpetso commentedSide note: If this was my module, I would get rid of the outside t() altogether for sanity. Translating an already customized string should be the rarest of edge cases, and if I'm not mistaken this is solved in Drupal 6 anyways (but I guess you know better than I do on this issue). I guess it's really a question of maximum flexibility vs. clean code.
Comment #2
jpetso commentedOops, wrong patch attached. (The above was the original one without all the translation stuff.) This one is the patch as described in comment #1.
Comment #3
jpetso commentedDoh.
Comment #4
stella commentedI applied the first patch - where the variable_get() call is used on the instance of "View Image Details" that I missed. Thanks!
I haven't used the second patch as I believe that what the user inputs should be translatable. However, I've added in some code that will cause the default settings to now be translated. As for the admin form, I don't believe the form element default value entry itself should be translated - i.e. whatever is in the database should be displayed.
Applied to CVS and will be included in the next release.
Cheers,
Stella
Comment #5
(not verified) commentedComment #6
stella commentedReleased in Lightbox V2 5.x-2.2.
Cheers,
Stella