Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi cksong,
    as soon as you have the .po and .mo files, you only need to get WP to scan for these files. I’ve put them into a subdirectory named “languages” underneath this plugin’s directory.
    Add a function to captcha_bank.php:

    function captcha_bank_init()
    {
    	load_plugin_textdomain( 'captcha-bank', false, CAPTCHA_BK_PLUGIN_DIRNAME . '/languages/' );
    }
    add_action('plugins_loaded', 'captcha_bank_init');

    This makes the textdomain “captcha-bank” available to WP.

    There’s a bit more to do, if you want a complete translation, because a number of lib functions is not yet written for i18n. As I was only interested in adding a captcha to the comment form, I’ve modified this particular function only.
    For example, in captcha_bank_class.php’ function function captcha_bank_form() search for the code around “refresh” and modify the lines to

    <a id="Refresh" style="border-style: none;" href="#" title="<?php _e('Refresh Image','captcha-bank');?>" ><img src="<?php echo CAPTCHA_BK_PLUGIN_URL ."/refresh.png"?>" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0" /></a><br />
    			<strong><?php _e('Enter Code*:','captcha-bank');?></strong><br />

    You can then localize ‘Refresh image’ and ‘Enter Code*:’ as well.
    I was yet unable to find, where the textdomain variable was set, so I hardcoded it to ‘captcha-bank’ in the code.

    Feel free to rewrite as many functions as you wish according to your needs. Caution: You’ll lose all of this, once you update the plugin, until the developers include such code in the original files (I’m not too familiar with code management systems, yet so I would rely on the guys to add it.)

    HTH!

    Plugin Author Varun Sharma

    (@contact-banker)

    Hi,

    Please update to the latest version and you will find po and mo files in languages folder. You can translate to your native language.

    Thanks

    Support Team
    Tech Banker

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Translation’ is closed to new replies.