From 6ac821c8444809f3ff50d918a1ce122d096b3aa3 Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Wed, 21 Nov 2018 17:26:10 +0000 Subject: [PATCH] Migrate dictionary loading in extensions --- .../module/scripts/index/database-import-controller.js | 5 +++-- .../database/module/scripts/project/database-exporters.js | 5 +++-- .../gdata/module/scripts/index/importing-controller.js | 5 +++-- extensions/gdata/module/scripts/project/exporters.js | 5 +++-- extensions/wikidata/module/scripts/menu-bar-extension.js | 5 +++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/extensions/database/module/scripts/index/database-import-controller.js b/extensions/database/module/scripts/index/database-import-controller.js index c480718b2..636af183c 100644 --- a/extensions/database/module/scripts/index/database-import-controller.js +++ b/extensions/database/module/scripts/index/database-import-controller.js @@ -39,10 +39,11 @@ $.ajax({ module : "database", }, success : function(data) { - dictionary = data; + dictionary = data['dictionary']; + lang = data['lang']; } }); -$.i18n.setDictionary(dictionary); +$.i18n().load(dictionary, lang); // End internationalization Refine.DatabaseImportController = function(createProjectUI) { diff --git a/extensions/database/module/scripts/project/database-exporters.js b/extensions/database/module/scripts/project/database-exporters.js index eacb5a488..c83b097f8 100644 --- a/extensions/database/module/scripts/project/database-exporters.js +++ b/extensions/database/module/scripts/project/database-exporters.js @@ -37,10 +37,11 @@ $.ajax({ }, success : function(data) { - dictionary = data; + dictionary = data['dictionary']; + dictionary = data['lang']; } }); -$.i18n.setDictionary(dictionary); +$.i18n().load(dictionary, lang); // End internationalization (function() { diff --git a/extensions/gdata/module/scripts/index/importing-controller.js b/extensions/gdata/module/scripts/index/importing-controller.js index 5953a1a1e..eda0afa16 100644 --- a/extensions/gdata/module/scripts/index/importing-controller.js +++ b/extensions/gdata/module/scripts/index/importing-controller.js @@ -44,10 +44,11 @@ $.ajax({ // lang : lang }, success : function(data) { - dictionary = data; + dictionary = data['dictionary']; + lang = data['lang']; } }); -$.i18n.setDictionary(dictionary); +$.i18n().load(dictionary, lang); // End internationalization Refine.GDataImportingController = function(createProjectUI) { diff --git a/extensions/gdata/module/scripts/project/exporters.js b/extensions/gdata/module/scripts/project/exporters.js index b83354b28..92e244746 100644 --- a/extensions/gdata/module/scripts/project/exporters.js +++ b/extensions/gdata/module/scripts/project/exporters.js @@ -41,10 +41,11 @@ $.ajax({ // lang : lang }, success : function(data) { - dictionary = data; + dictionary = data['dictionary']; + lang = data['lang']; } }); -$.i18n.setDictionary(dictionary); +$.i18n().load(dictionary, lang); // End internationalization (function() { diff --git a/extensions/wikidata/module/scripts/menu-bar-extension.js b/extensions/wikidata/module/scripts/menu-bar-extension.js index e50406af2..2855d9168 100644 --- a/extensions/wikidata/module/scripts/menu-bar-extension.js +++ b/extensions/wikidata/module/scripts/menu-bar-extension.js @@ -9,10 +9,11 @@ $.ajax({ // lang : lang }, success : function(data) { - dictionary = data; + dictionary = data['dictionary']; + lang = data['lang']; } }); -$.i18n.setDictionary(dictionary); +$.i18n().load(dictionary, lang);