Download & Extend

Option for user to change the instruction "what code is in the image"

Project:CAPTCHA
Version:7.x-1.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:pavel.karoukin
Status:closed (fixed)

Issue Summary

Many users comment that the phrase "What code is in the image" is very odd.

In English it may be: "Type the characters shown in the image"

But then other people may have better ideas - Could the user decide what instruction to give?

Comments

#1

Version:6.x-2.2» 7.x-1.x-dev

I'm certainly open for a better phrase there.
However, I would change it in the Drupal 7 version,
and leave it in the Drupal 6 version, otherwise all translations will break.

FYI: it's already possible to change the string (in Drupal 6) with help of the String overrides module.

#2

How about we add a setting in the admin section, which will let admin user define the message for a site?

#3

How about we add a setting in the admin section, which will let admin user define the message for a site?

That's a good idea, but the problem is how to handle translation/localization. Take for example the general CAPTCHA description text on the general CAPTCHA admin page. It's possible but it requires quite a bit of code and UI overhead.
I've heard of an alternative/more clean solution for this, but I can't the pointers at the moment.

#4

How about we follow the same translation/localization method as menu system ? A menu can be translated to various languages and yet configured via a UI.

#5

I've not looked into that system in detail for D7, but if doesn't require a lot of code, that should be a good option.

#6

Assigned to:Anonymous» pavel.karoukin

#7

Status:active» needs review

This patch actually fix the whole image_captcha.module for D7, not just option for changing strings. I had to test this so I had to fix module =)

There is quite a bit of changes, so comments and review welcome!

AttachmentSizeStatusTest resultOperations
captcha-[893170].patch8.86 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch captcha-[893170]_0.patch.View details

#8

#7: captcha-[893170].patch queued for re-testing.

#9

Oh. Completely forgot about it. Will checkout latest captcha version and update this patch once will get back home.

#10

Here we go.

AttachmentSizeStatusTest resultOperations
captcha-[893170].patch2.36 KBIdlePASSED: [[SimpleTest]]: [MySQL] 285 pass(es).View details

#11

Hi Hippich,

Sorry for the delay, but I couldn't review your patch until now. Anyway, thanks.

The current patch works around this system:

<?php
t
(variable_get('captcha_response_title', 'What code is in the image?'))
?>

According to the experts, this is not right way to use the t-function: String translation: why using t() for user specified text is evil?.
As noted in #3, I tried to solve this for the CAPTCHA description UI-text with quite a bit of custom code (look for "locale" in the CAPTCHA module files). I'm not really happy with it because it is ugly code and does not follow a standard Drupal workflow.
Apparently, there seem to be alternative solutions, depending on the Internationalisation (aka i18n) module, but this needs some more investigation (e.g. is i18n already stable enough for Drupal 7?). Here are already some pointers I found (but may be outdated for D7):
http://drupal.org/node/609364
http://drupal.org/node/313293
http://drupal.org/node/789286

#12

So main idea is that user supplied string could be in any language, not just in english. And the only way to do it right now - do it trhough i18n, which is not even in alpha for d7.

what I think we could do - introduce new function like "captcha_translate", which will be proxy to translate code. For now it could contain direct passthru call to t(), but later it could be replaced by i18n code.

What do you think?

#13

indeed, as illustrated in http://drupal.org/node/609364, I agree that something like captcha_translate, with easily swappable implementation, should be used for translatable user defined strings.

Maybe we should first do this in the Drupal 6 version were i18n is stable?

#14

We will not be able to do this in D7 version anyway (until i18n will be stable enough for D7). So these should be separate issues. I will redo this patch with separate translation "proxy" function tomorrow.

#15

I used the string overrides module to do the job.

#16

The string overrides module works when you want to change the text below the text input field but NOT the part above it that says "What code is in the image?". Can this be fixed? (I need to translate it to different languages for a multilingual site).

Nevermind - it worked when I tried it a second time for some reason.

#17

Hello,
I see you found a solution for my problem : how translate
«What code is in the image ?»
and
Enter the characters shown in the image.

Could you explain me how you do that ?
Thanks for help

#18

Hello,
I see you found a solution for my problem : how translate
«What code is in the image ?»
and
Enter the characters shown in the image.

Could you explain me how you do that ?
Thanks for help

#19

Status:needs review» fixed

Latest patch still has the issue Soxofaan mentioned in 11, and I think String override is better suited to this task, so I'm marking as fixed.

#20

Status:fixed» closed (fixed)

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

nobody click here