conditional shortcodes

Thank you, @Howdy_McGee! current_filter() is exactly what I’ve been looking for. Here is what I did:

function french_example( $atts , $content = null ) {
        $currentFilter = current_filter();
    if ($currentFilter == the_content) {
      return '<span class="ex" xml:lang="fr" lang="fr">' . do_shortcode($content) . '</span>';  
    }
    elseif ($currentFilter == the_title) {
      return '<span class="ex" xml:lang="fr" lang="fr">' . do_shortcode($content) . '</span>';  
    }
    else {
      return do_shortcode($content);
    }
}
add_shortcode( 'ex', 'french_example' );