How to create shortcode in wordpress? : <p>When I run the following i get:</p>

<blockquote>
  <p>Parse error: syntax error, unexpected 'if' (T_IF) in
  /home3/</p>
</blockquote>

<pre><code>function list_pages_function( $atts, $content ) {
    return
    if(ICL_LANGUAGE_CODE=='en'){
        echo "Define topic and title";
      }
      if(ICL_LANGUAGE_CODE=='es'){
        echo "Definir el tema y título";
      }
      if(ICL_LANGUAGE_CODE=='it'){
        echo "Definisci il topic ed il titolo";
      }
      if(ICL_LANGUAGE_CODE=='fr'){
        echo "Définir le sujet et le titre";
      }
    }
  add_shortcode( 'output_pages', 'list_pages_function' );
</code></pre>

<p>If I remove <code>return</code> it is fine but when I place <code>&lt;li id="a"&gt;&lt;strong&gt;1.&lt;/strong&gt;[output_pages]&lt;/li&gt;</code> the output won't be within the <code>&lt;li&gt;</code> but it will be right at the top of the content breaking the layout</p>
