Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter andersha

    (@andersha)

    I managed to do it myself with shortcodes and two groups, one for each language.

    In order to use WPML with the plugin there must be a XML file from WPML. Maybe the developer can contact the people from WPML and ask them to work this out. They volunteer to do this for my plugin so I think this people will help.

    Regards !!

    Hi!
    I managed to insert inside tip text the following shortcode
    [lang idioma="en"]ENGLISH TEXT[/lang] [lang idioma="es"]SPANISH TEXT[/lang]

    and make it work. I have the shortcode registered in fuctions.php

    /* ---------------------------------------------------------------------------
     * Shortcode [lang idioma="en"] [/lang]
    * --------------------------------------------------------------------------- */
    add_shortcode( 'lang', 'wpml_find_language');
    
    function wpml_find_language( $attr, $content = null ){
    
        extract(shortcode_atts(array(
    
            'idioma' => '',
    
        ), $attr));
    
        $current_language = ICL_LANGUAGE_CODE;
    
        if($current_language == $idioma){
            $output = do_shortcode($content);
        }else{
            $output = "";
        }
    
        return $output;
    }

    The point is I’m using exactly the same shortcode and fuctions.php in another site, and the output text includes the shortcode instead of executing it.

    Plugin Author Dhara Shah

    (@dharashah)

    Hi ind3lirium,

    This beats me. As we have not used WPML.
    If anyone can help, we would be grateful to them.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Daily Tip multi lingual, WPML’ is closed to new replies.