title: TinyMCE 4 Plugins: Can't get tinymce.Editor.getLang() working
body: <p>I am currently switching a plugin from TinyMCE 3.x to the new version TinyMCE 4.0.26. I encountered heavy problems when trying to internationalize my plugin labels.</p>
  
  <p>Within my plugin.js, I am loading the language pack by calling </p>
  
  <pre><code>tinymce.PluginManager.requireLangPack('myplugin');
  </code></pre>
  
  <p>with my i18n file <em>langs/de.js</em> looking something like this:</p>
  
  <pre><code>tinyMCE.addI18n('de', {
    myplugin: {
      button : 'Link einf\u00FCgen/bearbeiten',
      title : 'Link einf\u00FCgen/bearbeiten'
    }
  });
  </code></pre>
  
  <p>When I access the the static context</p>
  
  <pre><code>tinymce.i18n.data.myplugin
  </code></pre>
  
  <p>I can see that both variables <em>button</em> and <em>title</em> are available.</p>
  
  <p>THE PROBLEM:</p>
  
  <p>When calling <em>editor.getLang('myplugin.button')</em> I get <em>{#myplugin.button}</em> instead of the appropriate variable value.</p>
  
  <p>After I investigated the source code a little bit, I found out that it expects the language code to exist within the tinyMCE.i18n.data....., which is not available</p>
  
  <pre><code>getLang: function(name, defaultVal) {
              return (
                  this.editorManager.i18n[(this.settings.language || 'en') + '.' + name] ||
                  (defaultVal !== undefined ? defaultVal : '{#' + name + '}')
              );
          },
  </code></pre>
  
  <p>@see <a href="https://github.com/tinymce/tinymce/blob/4.0.26/js/tinymce/classes/Editor.js#L1105" rel="noreferrer">https://github.com/tinymce/tinymce/blob/4.0.26/js/tinymce/classes/Editor.js#L1105</a></p>
  
  <p>Have I done something wrong? Has anyone created a plugin for the new TinyMCE version and managed to get the internationalization working?</p>