WordPress.org

Ready to get started?Download WordPress

Forums

WP jQuery Lightbox
[resolved] How to translate WP jQuery Lightbox? (4 posts)

  1. Milos Spasic
    Member
    Posted 2 years ago #

    OK, I'm totally confused...

    Can somebody tell my how to translate this plugin?
    Not the admin area, only things that users are seeing on the site.

    http://wordpress.org/extend/plugins/wp-jquery-lightbox/

  2. Milos Spasic
    Member
    Posted 2 years ago #

    I have found the solution.

    Open the wp-jquery-lightbox.php and find the following code:

    function jqlb_js() {
    	if(is_admin() || is_feed()){return;}
    	wp_enqueue_script('jquery', '', array(), false, true);
    	wp_enqueue_script('wp-jquery-lightbox', JQLB_SCRIPT_URL,  Array('jquery'), '1.3.3', true);
    	wp_localize_script('wp-jquery-lightbox', 'JQLBSettings', array(
    		'fitToScreen' => get_option('jqlb_resize_on_demand'),
    		'resizeSpeed' => get_option('jqlb_resize_speed'),
    		'displayDownloadLink' => get_option('jqlb_show_download'),
    		'navbarOnTop' => get_option('jqlb_navbarOnTop'),
    		'loopImages' => get_option('jqlb_loopImages'),
    		'resizeCenter' => get_option('jqlb_resizeCenter'),
    		'marginSize' => get_option('jqlb_margin_size'),
    		'linkTarget' => get_option('jqlb_link_target'),
    		//'followScroll' => get_option('jqlb_follow_scroll'),
    		/* translation */
    		'help' => __(get_option('jqlb_help_text'), 'jqlb'),
    		'prevLinkTitle' => __('previous image', 'jqlb'),
    		'nextLinkTitle' => __('next image', 'jqlb'),
    		'prevLinkText' =>  __('« Previous', 'jqlb'),
    		'nextLinkText' => __('Next »', 'jqlb'),
    		'closeTitle' => __('close image gallery', 'jqlb'),
    		'image' => __('Image ', 'jqlb'),
    		'of' => __(' of ', 'jqlb'),
    		'download' => __('Download', 'jqlb')
    	));
    }

    Replace the:

    'previous image'
    'next image'
    '« Previous'
    'Next »'
    'close image gallery'
    'Image '
    ' of '
    'Download'

    with words on your language, save the file and upload it back to the host.

    Edit image wp-jquery-lightbox/styles/images/closelabel.gif and change the text with the word on your language, save it and upload to the server.

    You are done, user part of the plugin is translated now.

  3. jacek606
    Member
    Posted 2 years ago #

    Plugin is translation ready.
    But I couldn't get translation to work (wordpress 3.3) until I changed:
    load_plugin_textdomain('jqlb', false, plugin_dir_path(__FILE__).'languages/');
    to:
    load_plugin_textdomain( 'jqlb', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );

  4. ulfben
    Member
    Plugin Author

    Posted 2 years ago #

    Maybe I misunderstood the dirname when replacing it with plugin_dir_path for 1.3.4?

    I've reverted the change now. If anyone else runs into the same problem you should re-download the plugin.

    I'll have to remember to try this again for next release but test it more. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic