After some digging into the source code, I've created a solution that sort-of works, but certainly requires improving in the long term.
Within i18n.addjQueryFunct()
's definition, add this to access resStore (the translation storage variable):
$.i18n._getResStore = _getResStore;
$.i18n._writeResStore = _writeResStore;
function _getResStore() {
return resStore;
}
function _writeResStore(r) {
resStore = r;
}
When you want to load an extra namespace, simply do something like this:
// define options, run $.i18n.init, etc...
// suppose ns = "namespace_foobar_new"
options.ns.namespaces.push(ns);
$.i18n.sync._fetchOne(lang, ns, $.extend({}, $.i18n.options, options),
function(err, data) {
store = {};
store[lang] = {}; store[lang][ns] = data;
newResStore = $.extend(true, {}, $.i18n._getResStore(), store);
$.i18n._writeResStore(newResStore);
});
Phew.