title: i18next jquery help migrating to i18next jquery v3.0.0
body: <p>Good day all,</p>
  
  <p>i need a little bit of help migrating from i18next jquery 1.11.1 to version 3.0.0
  currently this is my setup</p>
  
  <pre><code>&lt;!-- Core JS files --&gt;
  &lt;script type="text/javascript" src="../js/jquery-2.2.4.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="../js/i18next.min.js"&gt;&lt;/script&gt; (v1.11.1)
  
  $(function(){
      // i18next Configuration
      // -------------------------
      var namespaces = ["nav" ,"common" ];
      var options = {
              ns: {
                  namespaces: namespaces,
                  defaultNs: namespaces[0]
              },
              resGetPath: '../assets/locales/__ns__/__lng__.json',
              debug: false,
              load: 'unspecific',
              detectLngQS: 'lang',
              fallbackLng : 'en',
              cookieName: 'applang',
              //cookieExpirationTime : ,
              useLocalStorage: false,
              cookieDomain: '*.mydomain.com',
              useCookie: true,
              lngWhitelist: ['en','es', 'de', 'fr']
          };
      i18n.init(options ,function (err,t) {
          $('body').i18n(); // Init 18n
  
      });
  })
  </code></pre>
  
  <p>and when i want to load additional namespace i do this</p>
  
  <pre><code>var namespaces = ["newFile"];
  i18n.loadNamespaces(namespaces, function (err, t) {
          // init i18n
          $('body').i18n();
     .............. other stuff in here
  })
  </code></pre>
  
  <p>but when i try to use the latest i18next v3 with the jquery-i18next (<a href="https://github.com/i18next/jquery-i18next" rel="nofollow">https://github.com/i18next/jquery-i18next</a>) keeping the same logic i get errors on the loadNamespaces function (Uncaught TypeError: namespaces.forEach is not a function), below is the new setup</p>
  
  <pre><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.js" &gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/i18next/3.0.0/i18next.min.js" &gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-i18next/0.0.2/i18next-jquery.min.js" &gt;&lt;/script&gt;
  
  i18next
    .use(i18nextXHRBackend)
    .init({
        lng: 'de',
        backend: {
            loadPath: '../assets/locales/{{lng}}/{{ns}}.json'
        }
      }, function(err, t) {
        jqueryI18next.init(i18next, $);
        $('.body').localize();
  
    });
  
    var namespaces = ["newFile"];
    i18n.loadNamespaces(namespaces, function (err, t) {
          // init i18n
          $('body').localize();
     .............. other stuff in here
  })
  </code></pre>