title: How to translate hardcoded strings in theme's functions.php with wpml string translation?
body: <p>I added a login/register and a logout menu item to my navigation. Therefore I used following code in my theme's functions.php script:</p>
  
  <pre><code>add_filter( 'wp_nav_menu_items', 'add_loginout_link', 10, 2 );
  function add_loginout_link( $items, $args ) {
      if (is_user_logged_in() &amp;&amp; $args-&gt;theme_location == 'footer') {
          $items .= '&lt;li&gt;&lt;a href="'. wp_logout_url() .'"&gt;Logout&lt;/a&gt;&lt;/li&gt;';
      }
      elseif (!is_user_logged_in() &amp;&amp; $args-&gt;theme_location == 'footer') {
          $items .= '&lt;li&gt;&lt;a href="'. site_url('my-account') .'"&gt;Login/Register&lt;/a&gt;&lt;/li&gt;';
      }
      return $items;
  }
  </code></pre>
  
  <p>So if the user is logged in the logout menu item will show up, otherwise the login/register menu item. But I have a bilingual website using wpml and would like to know how to make the "Login/Register"-string translatable.</p>
  
  <p>I already tried this:</p>
  
  <pre><code>$items .= '&lt;li&gt;&lt;a href="'. site_url('my-account') .'"&gt;'.__('Login/Register').'&lt;/a&gt;&lt;/li&gt;'; 
  </code></pre>
  
  <p>and also this:</p>
  
  <pre><code>$items .= '&lt;li&gt;&lt;a href="'. site_url('my-account') .'"&gt;'.__('Login/Register', 'theme_name').'&lt;/a&gt;&lt;/li&gt;'; 
  </code></pre>
  
  <p>but it didn't work. According to <a href="http://wpml.org/faq/getting-string-translation-to-work/" rel="nofollow">this</a> it should be enough to display the string in the dashboard menu -> wpml -> string translation </p>
  
  <p>So what did I wrong?</p>