Captcha Internationalization

Liferay is providing Captcha implementation using Numeric. It would be all that you might require. But in case if customer is asking for the internationalization for his regional language. It might be possible that customer would like to have a captcha with regional language. This hook will let you implement internationalized captcha with very simple way. Once you will enable this hook, it will fetch languageId of user. And according to the languageId, hook will try to find captcha textProducer implementation.

Liferay is using SimpleCaptcha for implementing Captcha functionality. I have also used the same API. This API is currently providing following text Producer. Please find the following link for the API also.
1) ArabicTextProducer
2) ChineseTextProducer
3) FiveLetterFirstNameTextProducer
4) NumbersAnswerProducer
http://simplecaptcha.sourceforge.net/

In case you need for some other language. You just simply need to implement text producer. It is also very simple implementation that any developer can do. Please find the following link for the reference to develop new text producer.
http://wellofjava.blogspot.com/2014/07/simple-captcha-text-producer.html

For using this hook, simply install the hook in Liferay and specify the property by overriding the following settings in your hook's portal.properties:
#
# Set whether or not to use captcha checks for create account. Hook will make this to false. This will disable Liferay’s captcha for create account page.
#
captcha.check.portal.create_account=false

#
# Set whether or not to use custom captcha checks for create account. Hook will make this to true. This will enable custom captcha for create account page.
#
captcha.check.portal.create_account.custom=true

#
# Following is the example of how to use custom Text Producer. For adding more language support for the captcha. You just need to add one property with the languageId as suffix.
#
captcha.engine.simplecaptcha.text.producers.en_US=nl.captcha.text.producer.NumbersAnswerProducer
captcha.engine.simplecaptcha.text.producers.ar_SA=nl.captcha.text.producer.ArabicTextProducer
captcha.engine.simplecaptcha.text.producers.zh_CN=nl.captcha.text.producer.ChineseTextProducer

There is one open issue with language portlet for guest user.
https://issues.liferay.com/browse/LPS-42075
Till this issue gets fixed, you will need to change portal default language to test this hook.
Go to Control Panel -> Portal settings -> Display Settings.

Clientes que viram este também compraram