WordPress.org

Ready to get started?Download WordPress

Forums

Multisite Language Switcher
widget output "translation no available" (5 posts)

  1. alainwoll
    Member
    Posted 1 year ago #

    I use the widget. My setting is 1 0 1 0 (I use: display if a translation is available - do not display the current language link). I would also like the widget displays a message when there is no translation available. It will be more presentable than empty. I think you have already answered this simple question but I have not found the solution in the wiki or in the forum.
    Thank you for your reply.

    http://wordpress.org/extend/plugins/multisite-language-switcher/

  2. realloc
    Member
    Plugin Author

    Posted 1 year ago #

    I'm not sure but I think that I cannot offer a solution for your problem - at least for the current version. If you don't mind please create a ticket for a feature request here: https://github.com/lloc/Multisite-Language-Switcher/issues

  3. alainwoll
    Member
    Posted 1 year ago #

    Thank you very much. I sent the request and I will notify you when I realized something ...

  4. alainwoll
    Member
    Posted 1 year ago #

    the code in mslswidget.php`

    /**
         * Output of the widget in the frontend
         *
         * @param array $args
         * @param array instance
         * @uses MslsOutput
         */
        public function widget( $args, $instance ) {
            extract( $args );
            echo $before_widget;
            $title = apply_filters( 'widget_title', $instance['title'] );
            if ( $title )
                echo $before_title . $title . $after_title;
            $obj = new MslsOutput();
            echo $obj;
    		<strong>if ($obj == ' ')
    		    _e( 'No translation available', 'msls' );</strong>
            echo $after_widget;
        }

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your posted code may now have been permanently damaged/corrupted by the forum's parser.]

  5. realloc
    Member
    Plugin Author

    Posted 1 year ago #

    Please use the repository at https://github.com/lloc/Multisite-Language-Switcher if you'd like to contribute.

    Regarding your code: Please keep in mind that when the code prints the object the MslsOutput::__toString() method will be used. In my opinion the check has to be earlier for not generating 2 times the same output.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.