import vue from 'vue';
import vuex from 'vuex';
import router from 'vue-router';
import vueintl from 'vue-intl';

vue.prototype.Kolibri = {};
vue.config.silent = true;
vue.use(vuex);
vue.use(router);
require('intl');
require('intl/locale-data/jsonp/en.js');
vue.use(vueintl, { defaultLocale: 'en-us' });

vue.mixin({
  store: new vuex.Store({}),
});

function $trWrapper(formatter, messageId, args) {
  if (args) {
    if (!Array.isArray(args) && typeof args !== 'object') {
      logging.error(`The $tr functions take either an array of positional
                      arguments or an object of named options.`);
    }
  }
  const defaultMessageText = this.$options.$trs[messageId];
  const message = {
    id: `${this.$options.$trNameSpace}.${messageId}`,
    defaultMessage: defaultMessageText,
  };
  return formatter(message, args);
}

vue.prototype.$tr = function $tr(messageId, args) {
  return $trWrapper.call(this, this.$formatMessage, messageId, args);
};

export default vue;

@@ -105,16 +105,70 @@
 e-intl';
+%0Aimport 'intl';%0Aimport 'intl/locale-data/jsonp/en.js';
 %0A%0Avue.pr
@@ -251,179 +251,103 @@
 r);%0A
-require('intl');%0Arequire('intl/locale-data/jsonp/en.js');%0Avue.use(vueintl, %7B defaultLocale: 'en-us' %7D);%0A%0Avue.mixin(%7B%0A  store: new vuex.Store(%7B%7D),%0A%7D);%0A%0Afunction $trWrapper(
+vue.use(vueintl, %7B defaultLocale: 'en-us' %7D);%0A%0Afunction $trWrapper(nameSpace, defaultMessages, 
 form
@@ -456,15 +456,15 @@
     
-logging
+console
 .err
@@ -625,33 +625,30 @@
 eText = 
-this.$options.$tr
+defaultMessage
 s%5Bmessag
@@ -688,26 +688,9 @@
  %60$%7B
-this.$options.$trN
+n
 ameS
@@ -755,16 +755,17 @@
 t,%0A  %7D;%0A
+%0A
   return
@@ -852,34 +852,124 @@
 %7B%0A  
-return $trWrapper.call(thi
+const nameSpace = this.$options.name %7C%7C this.$options.$trNameSpace;%0A  return $trWrapper(nameSpace, this.$options.$tr
 s, t

Copy new implementation of $trWrapper and $tr from i18n.js