• 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.

    https://www.ads-software.com/extend/plugins/multisite-language-switcher/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Dennis Ploetner

    (@realloc)

    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

    Thread Starter alainwoll

    (@alainwoll)

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

    Thread Starter alainwoll

    (@alainwoll)

    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.]

    Plugin Author Dennis Ploetner

    (@realloc)

    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘widget output "translation no available"’ is closed to new replies.