Improve translator function. Ref #14

This commit is contained in:
Victor Dubiniuk 2013-11-14 16:04:40 +03:00
parent 680ec43ee7
commit b597a972c5

View File

@ -121,6 +121,7 @@ var documentsMain = {
require({}, ["dojo/ready"], function(ready) { require({}, ["dojo/ready"], function(ready) {
ready(function() { ready(function() {
require({}, ["webodf/editor/Editor"], function(Editor) { require({}, ["webodf/editor/Editor"], function(Editor) {
runtime.setTranslator(function(s){return t('documents', s);});
documentsMain.ready = true; documentsMain.ready = true;
if (fileId){ if (fileId){
documentsMain.prepareSession(); documentsMain.prepareSession();
@ -180,7 +181,7 @@ var documentsMain = {
documentsMain.webodfServerInstance = serverFactory.createServer(); documentsMain.webodfServerInstance = serverFactory.createServer();
documentsMain.webodfServerInstance.setToken(oc_requesttoken); documentsMain.webodfServerInstance.setToken(oc_requesttoken);
documentsMain.webodfEditorInstance = new Editor({unstableFeaturesEnabled: documentsMain.useUnstable}, documentsMain.webodfServerInstance, serverFactory); documentsMain.webodfEditorInstance = new Editor({unstableFeaturesEnabled: documentsMain.useUnstable}, documentsMain.webodfServerInstance, serverFactory);
runtime.tr = function(s){return t('documents', s);};
// load the document and get called back when it's live // load the document and get called back when it's live
documentsMain.webodfEditorInstance.openSession(documentsMain.esId, documentsMain.memberId, function() { documentsMain.webodfEditorInstance.openSession(documentsMain.esId, documentsMain.memberId, function() {
documentsMain.webodfEditorInstance.startEditing(); documentsMain.webodfEditorInstance.startEditing();