WordPress.org

Forums

WordPress Countdown Widget
[resolved] LANGUAGE (5 posts)

  1. Marketto
    Member
    Posted 2 years ago #

    How can I change the language of the displayed plugin?

    http://wordpress.org/extend/plugins/wordpress-countdown-widget/

  2. Metin Saylan
    Member
    Plugin Author

    Posted 2 years ago #

    It should use wordpress core language.

    Language files are located in js folder of the plugin.

  3. Ursula S.
    Member
    Posted 2 years ago #

    Unfortunately it does not change language in my blog. My blog is in German, but the count down is in English.

    What can I do to change this?

    Thank you for your help.

  4. Frank P. Walentynowicz
    Member
    Posted 2 years ago #

    This code in class constructor is incorrect:

    if($lang!='en' && file_exists( plugins_url('js/jquery.countdown-' . $lang . '.js', __FILE__)) ){
        wp_enqueue_script('countdown-l10n', plugins_url('js/jquery.countdown-' . $lang . '.js',__FILE__), 'countdown', '1.0', false);
    }

    The file_exists function requires a path to the file not url! The condition is never true and the script is not loaded.

    Replace the code above with:

    if($lang!='en' && file_exists( plugin_dir_path(__FILE__) . 'js/jquery.countdown-' . $lang . '.js') ){
        wp_enqueue_script('countdown-l10n', plugins_url('js/jquery.countdown-' . $lang . '.js',__FILE__), 'countdown', '1.0', false);
    }

    That's it. Enjoy.

  5. wonthewarp
    Member
    Posted 2 years ago #

    Good work Frank P. Talentynowicz

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress Countdown Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.