summaryrefslogtreecommitdiff
path: root/web-ui/test
diff options
context:
space:
mode:
authorCaio Carrara <ccarrara@thoughtworks.com>2016-06-27 16:16:32 -0300
committerCaio Carrara <ccarrara@thoughtworks.com>2016-06-27 16:39:55 -0300
commitadf2d0581393eb590349bd43211cd927feeb722e (patch)
treebb51e7c4adcba72a8da9b609ea71afbcc3940ca0 /web-ui/test
parent25ad94af467ff0efc3765246ef6a1a6df56efb44 (diff)
Initialize specific i18next for tests
This change is necessary due translation file loading and paths.
Diffstat (limited to 'web-ui/test')
-rw-r--r--web-ui/test/test-main.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/web-ui/test/test-main.js b/web-ui/test/test-main.js
index d9fb001e..cc7daaee 100644
--- a/web-ui/test/test-main.js
+++ b/web-ui/test/test-main.js
@@ -43,7 +43,8 @@ requirejs.config({
callback: function () {
'use strict';
- require(['page/events','test/test_data', 'views/i18n', 'monkey_patching/array', 'views/recipientListFormatter', 'test/custom_matchers'], function (events, testData, i18n, mp, recipientListFormatter, customMatchers) {
+ require(['page/events','test/test_data', 'views/i18n', 'i18next', 'i18nextXHRBackend', 'monkey_patching/array', 'views/recipientListFormatter', 'test/custom_matchers'],
+ function (events, testData, i18n, i18next, i18n_backend, mp, recipientListFormatter, customMatchers) {
window.Pixelated = window.Pixelated || {};
window.Pixelated.events = events;
window.Pixelated.testData = testData;
@@ -57,9 +58,19 @@ requirejs.config({
$.fn.typeahead = function() {};
};
- i18n.init('/base/app/');
- // start test run, once Require.js is done
- window.__karma__.start();
+ i18next
+ .use(i18n_backend)
+ .init({
+ lng: 'en_US',
+ backend: {
+ loadPath: '/base/app/locales/en_US/translation.json'
+ }
+ });
+ Handlebars.registerHelper('t', i18n.t);
+
+ i18next.on('loaded', function() {
+ window.__karma__.start();
+ });
});
}
});