[DE] Refactoring for localization

This commit is contained in:
Julia Radzhabova 2019-09-18 18:12:50 +03:00
parent bd44f6b773
commit c0507f7749
3 changed files with 43 additions and 45 deletions

View file

@ -56,8 +56,8 @@ Common.Locale = new(function() {
obj = obj[p[i]]; obj = obj[p[i]];
} }
if (obj) { if (obj && obj.prototype) {
obj[p[p.length - 1]] = l10n[prop]; obj.prototype[p[p.length - 1]] = l10n[prop];
} }
} }
} }

View file

@ -62,7 +62,7 @@ define([
], function ($, _, Backbone, template, template_view) { ], function ($, _, Backbone, template, template_view) {
'use strict'; 'use strict';
DE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend((function(){ DE.Views.Toolbar = Common.UI.Mixtbar.extend((function(){
return { return {
el: '#toolbar', el: '#toolbar',
@ -2326,5 +2326,5 @@ define([
textRemWatermark: 'Remove Watermark', textRemWatermark: 'Remove Watermark',
tipWatermark: 'Edit watermark' tipWatermark: 'Edit watermark'
} }
})(), DE.Views.Toolbar || {})); })());
}); });

View file

@ -159,8 +159,6 @@ require([
] ]
}); });
Common.Locale.apply(
function() {
require([ require([
'documenteditor/main/app/controller/Viewport', 'documenteditor/main/app/controller/Viewport',
'documenteditor/main/app/controller/DocumentHolder', 'documenteditor/main/app/controller/DocumentHolder',
@ -196,10 +194,10 @@ require([
,'common/main/lib/controller/Desktop' ,'common/main/lib/controller/Desktop'
], function() { ], function() {
window.compareVersions = true; window.compareVersions = true;
Common.Locale.apply(function () {
app.start(); app.start();
}); });
} });
);
}, function(err) { }, function(err) {
if (err.requireType == 'timeout' && !reqerr && window.requireTimeourError) { if (err.requireType == 'timeout' && !reqerr && window.requireTimeourError) {
reqerr = window.requireTimeourError(); reqerr = window.requireTimeourError();