By ycc on
I have just started using the excellent CAPTCHA-module. Space is tight on my page and I want to reduce the text in it. (The topmost text can be changed in the administrator panel.) Below the imagecaptcha the following text appears. Where can I find it and change it for the shorter?
What code is in the image?: *
<Then comes the form>
Copy the characters (respecting upper/lower case) from the image.Thanks
Comments
I found the strings, but still cannot make it work
I found the strings I want to change in:
/sites/all/modules/captcha/translations/captcha-module.pot
I tried to change them but nothing happened on the site. I will have to look further, if someone can give advice how to change this string, please do.
(This string also appears in every file translating to every other language, so just changing it here may also break the system of translations?)
Thanks
(What I found seems to be an id (?) for the string. I think one can find the "real" strings for other languages in the same directory, but the string for English still eludes me :) )
The passage above seems to be the place to change the strings. I hope changing them will not break the system for translations. The two relevant strings seem to be located on lines 145 and 146 of image_captcha/image_captcha.module. I hope the change will not break the system for translations.
The numbers described in the previous post refer to 144 and 145 (very close, but not exactly the same):
I really hope my fiddling around will not bread up the system for translations :)
Finally ... I think these
Finally ... I think these are the places where one changes the messages of the image-captcha dialog:
1. Surfing to the administration page (of course): admin > CAPTCHA > challenge description. (Entering one blank character will make the frame show but no message appears.)
2. captcha/captcha.module line 215: Message written in the top border of the frame.
3. captcha/image_captcha/image_captcha.module lines 145, 146: Text above and below the form.
(html can also be used) Maybe this is all elementary to most of you, I just put it here for the sake of completeness. :)
Another way
I believe the method you would use would break the translations if you're using them. You also want to avoid editing the module files directly as it would complicate things when you want to apply updates to the module later.
I also tried editing the translations file at /sites/all/modules/captcha/translations/captcha-module.pot without success. I also tried creating an en.po file but this wasn't used even after enabling the Locale module. Also, using the Locale module incurs an additional overhead which is unnecessary when multiple languages aren't used.
The solution I finally settled on was to go to the end of settings.php to the section: String overrides. By enabling this section and adding a line for the text I wanted to change worked for me.
So my code at the end of settings.php looked like:
Note that this is only suitable if you want to change small amounts of text, if you want to make lots of changes it would be worth investigating how to change the translations in the CAPTCHA modules translation folder.