[Mobile] Fix translation on loading (open as anonymous)
This commit is contained in:
parent
a0437e9dbc
commit
4a66c76aeb
|
@ -80,8 +80,8 @@ class MainController extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadConfig = data => {
|
const loadConfig = data => {
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Main', {returnObjects:true});
|
||||||
EditorUIController.isSupportEditFeature();
|
EditorUIController.isSupportEditFeature();
|
||||||
|
|
||||||
this.editorConfig = Object.assign({}, this.editorConfig, data.config);
|
this.editorConfig = Object.assign({}, this.editorConfig, data.config);
|
||||||
|
@ -183,13 +183,15 @@ class MainController extends Component {
|
||||||
const onEditorPermissions = params => {
|
const onEditorPermissions = params => {
|
||||||
const licType = params.asc_getLicenseType();
|
const licType = params.asc_getLicenseType();
|
||||||
|
|
||||||
|
const { t } = this.props;
|
||||||
|
const _t = t('Main', {returnObjects:true});
|
||||||
// check licType
|
// check licType
|
||||||
if (Asc.c_oLicenseResult.Expired === licType ||
|
if (Asc.c_oLicenseResult.Expired === licType ||
|
||||||
Asc.c_oLicenseResult.Error === licType ||
|
Asc.c_oLicenseResult.Error === licType ||
|
||||||
Asc.c_oLicenseResult.ExpiredTrial === licType) {
|
Asc.c_oLicenseResult.ExpiredTrial === licType) {
|
||||||
f7.dialog.create({
|
f7.dialog.create({
|
||||||
title : this._t.titleLicenseExp,
|
title : _t.titleLicenseExp,
|
||||||
text : this._t.warnLicenseExp
|
text : _t.warnLicenseExp
|
||||||
}).open();
|
}).open();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -409,7 +411,9 @@ class MainController extends Component {
|
||||||
this.api.asc_continueSaving();
|
this.api.asc_continueSaving();
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
return this._t.leavePageText;
|
const { t } = this.props;
|
||||||
|
const _t = t('Main', {returnObjects:true});
|
||||||
|
return _t.leavePageText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -536,7 +540,8 @@ class MainController extends Component {
|
||||||
|
|
||||||
onServerVersion (buildVersion) {
|
onServerVersion (buildVersion) {
|
||||||
if (this.changeServerVersion) return true;
|
if (this.changeServerVersion) return true;
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Main', {returnObjects:true});
|
||||||
|
|
||||||
if (About.appVersion() !== buildVersion && !About.compareVersions()) {
|
if (About.appVersion() !== buildVersion && !About.compareVersions()) {
|
||||||
this.changeServerVersion = true;
|
this.changeServerVersion = true;
|
||||||
|
@ -807,7 +812,9 @@ class MainController extends Component {
|
||||||
this.api.asc_OnSaveEnd(data.result);
|
this.api.asc_OnSaveEnd(data.result);
|
||||||
|
|
||||||
if (data && data.result === false) {
|
if (data && data.result === false) {
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Main', {returnObjects:true});
|
||||||
|
|
||||||
f7.dialog.alert(
|
f7.dialog.alert(
|
||||||
(!data.message) ? _t.errorProcessSaveResult : data.message,
|
(!data.message) ? _t.errorProcessSaveResult : data.message,
|
||||||
_t.criticalErrorTitle
|
_t.criticalErrorTitle
|
||||||
|
@ -824,7 +831,9 @@ class MainController extends Component {
|
||||||
Common.Notifications.trigger('api:disconnect');
|
Common.Notifications.trigger('api:disconnect');
|
||||||
|
|
||||||
if (!old_rights) {
|
if (!old_rights) {
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Main', {returnObjects:true});
|
||||||
|
|
||||||
f7.dialog.alert(
|
f7.dialog.alert(
|
||||||
(!data.message) ? _t.warnProcessRightsChange : data.message,
|
(!data.message) ? _t.warnProcessRightsChange : data.message,
|
||||||
_t.notcriticalErrorTitle,
|
_t.notcriticalErrorTitle,
|
||||||
|
@ -837,7 +846,9 @@ class MainController extends Component {
|
||||||
onDownloadAs () {
|
onDownloadAs () {
|
||||||
const appOptions = this.props.storeAppOptions;
|
const appOptions = this.props.storeAppOptions;
|
||||||
if ( !appOptions.canDownload && !appOptions.canDownloadOrigin) {
|
if ( !appOptions.canDownload && !appOptions.canDownloadOrigin) {
|
||||||
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, this._t.errorAccessDeny);
|
const { t } = this.props;
|
||||||
|
const _t = t('Main', {returnObjects:true});
|
||||||
|
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, _t.errorAccessDeny);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -864,7 +875,8 @@ class MainController extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onUpdateVersion (callback) {
|
onUpdateVersion (callback) {
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Main', {returnObjects:true});
|
||||||
|
|
||||||
this.needToUpdateVersion = true;
|
this.needToUpdateVersion = true;
|
||||||
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||||
|
@ -956,7 +968,8 @@ class MainController extends Component {
|
||||||
if (value === 1) {
|
if (value === 1) {
|
||||||
this.api.asc_runAutostartMacroses();
|
this.api.asc_runAutostartMacroses();
|
||||||
} else if (value === 0) {
|
} else if (value === 0) {
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Main', {returnObjects:true});
|
||||||
f7.dialog.create({
|
f7.dialog.create({
|
||||||
title: _t.notcriticalErrorTitle,
|
title: _t.notcriticalErrorTitle,
|
||||||
text: _t.textHasMacros,
|
text: _t.textHasMacros,
|
||||||
|
|
|
@ -73,7 +73,8 @@ class MainController extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadConfig = data => {
|
const loadConfig = data => {
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Controller.Main', {returnObjects:true});
|
||||||
|
|
||||||
EditorUIController.isSupportEditFeature();
|
EditorUIController.isSupportEditFeature();
|
||||||
|
|
||||||
|
@ -289,7 +290,9 @@ class MainController extends Component {
|
||||||
this.api.asc_continueSaving();
|
this.api.asc_continueSaving();
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
return this._t.leavePageText;
|
const { t } = this.props;
|
||||||
|
const _t = t('Controller.Main', {returnObjects:true});
|
||||||
|
return _t.leavePageText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -607,7 +610,8 @@ class MainController extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onUpdateVersion (callback) {
|
onUpdateVersion (callback) {
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Controller.Main', {returnObjects:true});
|
||||||
|
|
||||||
this.needToUpdateVersion = true;
|
this.needToUpdateVersion = true;
|
||||||
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||||
|
@ -626,7 +630,8 @@ class MainController extends Component {
|
||||||
|
|
||||||
onServerVersion (buildVersion) {
|
onServerVersion (buildVersion) {
|
||||||
if (this.changeServerVersion) return true;
|
if (this.changeServerVersion) return true;
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Controller.Main', {returnObjects:true});
|
||||||
|
|
||||||
if (About.appVersion() !== buildVersion && !window.compareVersions) {
|
if (About.appVersion() !== buildVersion && !window.compareVersions) {
|
||||||
this.changeServerVersion = true;
|
this.changeServerVersion = true;
|
||||||
|
@ -774,7 +779,8 @@ class MainController extends Component {
|
||||||
if (value === 1) {
|
if (value === 1) {
|
||||||
this.api.asc_runAutostartMacroses();
|
this.api.asc_runAutostartMacroses();
|
||||||
} else if (value === 0) {
|
} else if (value === 0) {
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Controller.Main', {returnObjects:true});
|
||||||
f7.dialog.create({
|
f7.dialog.create({
|
||||||
title: _t.notcriticalErrorTitle,
|
title: _t.notcriticalErrorTitle,
|
||||||
text: _t.textHasMacros,
|
text: _t.textHasMacros,
|
||||||
|
@ -816,7 +822,8 @@ class MainController extends Component {
|
||||||
this.api.asc_OnSaveEnd(data.result);
|
this.api.asc_OnSaveEnd(data.result);
|
||||||
|
|
||||||
if (data && data.result === false) {
|
if (data && data.result === false) {
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Controller.Main', {returnObjects:true});
|
||||||
f7.dialog.alert(
|
f7.dialog.alert(
|
||||||
(!data.message) ? _t.errorProcessSaveResult : data.message,
|
(!data.message) ? _t.errorProcessSaveResult : data.message,
|
||||||
_t.criticalErrorTitle
|
_t.criticalErrorTitle
|
||||||
|
@ -833,7 +840,8 @@ class MainController extends Component {
|
||||||
Common.Notifications.trigger('api:disconnect');
|
Common.Notifications.trigger('api:disconnect');
|
||||||
|
|
||||||
if (!old_rights) {
|
if (!old_rights) {
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Controller.Main', {returnObjects:true});
|
||||||
f7.dialog.alert(
|
f7.dialog.alert(
|
||||||
(!data.message) ? _t.warnProcessRightsChange : data.message,
|
(!data.message) ? _t.warnProcessRightsChange : data.message,
|
||||||
_t.notcriticalErrorTitle,
|
_t.notcriticalErrorTitle,
|
||||||
|
|
|
@ -91,7 +91,8 @@ class MainController extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadConfig = data => {
|
const loadConfig = data => {
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Controller.Main', {returnObjects:true});
|
||||||
|
|
||||||
EditorUIController.isSupportEditFeature();
|
EditorUIController.isSupportEditFeature();
|
||||||
|
|
||||||
|
@ -749,7 +750,8 @@ class MainController extends Component {
|
||||||
if (value === 1) {
|
if (value === 1) {
|
||||||
this.api.asc_runAutostartMacroses();
|
this.api.asc_runAutostartMacroses();
|
||||||
} else if (value === 0) {
|
} else if (value === 0) {
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Controller.Main', {returnObjects:true});
|
||||||
f7.dialog.create({
|
f7.dialog.create({
|
||||||
title: _t.notcriticalErrorTitle,
|
title: _t.notcriticalErrorTitle,
|
||||||
text: _t.textHasMacros,
|
text: _t.textHasMacros,
|
||||||
|
@ -796,7 +798,8 @@ class MainController extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeUnload () {
|
onBeforeUnload () {
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Controller.Main', {returnObjects:true});
|
||||||
|
|
||||||
LocalStorage.save();
|
LocalStorage.save();
|
||||||
|
|
||||||
|
@ -818,7 +821,8 @@ class MainController extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onUpdateVersion (callback) {
|
onUpdateVersion (callback) {
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Controller.Main', {returnObjects:true});
|
||||||
|
|
||||||
this.needToUpdateVersion = true;
|
this.needToUpdateVersion = true;
|
||||||
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
|
||||||
|
@ -837,7 +841,8 @@ class MainController extends Component {
|
||||||
|
|
||||||
onServerVersion (buildVersion) {
|
onServerVersion (buildVersion) {
|
||||||
if (this.changeServerVersion) return true;
|
if (this.changeServerVersion) return true;
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Controller.Main', {returnObjects:true});
|
||||||
|
|
||||||
if (About.appVersion() !== buildVersion && !About.compareVersions()) {
|
if (About.appVersion() !== buildVersion && !About.compareVersions()) {
|
||||||
this.changeServerVersion = true;
|
this.changeServerVersion = true;
|
||||||
|
@ -923,7 +928,8 @@ class MainController extends Component {
|
||||||
this.api.asc_OnSaveEnd(data.result);
|
this.api.asc_OnSaveEnd(data.result);
|
||||||
|
|
||||||
if (data && data.result === false) {
|
if (data && data.result === false) {
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Controller.Main', {returnObjects:true});
|
||||||
f7.dialog.alert(
|
f7.dialog.alert(
|
||||||
(!data.message) ? _t.errorProcessSaveResult : data.message,
|
(!data.message) ? _t.errorProcessSaveResult : data.message,
|
||||||
_t.criticalErrorTitle
|
_t.criticalErrorTitle
|
||||||
|
@ -940,7 +946,8 @@ class MainController extends Component {
|
||||||
Common.Notifications.trigger('api:disconnect');
|
Common.Notifications.trigger('api:disconnect');
|
||||||
|
|
||||||
if (!old_rights) {
|
if (!old_rights) {
|
||||||
const _t = this._t;
|
const { t } = this.props;
|
||||||
|
const _t = t('Controller.Main', {returnObjects:true});
|
||||||
f7.dialog.alert(
|
f7.dialog.alert(
|
||||||
(!data.message) ? _t.warnProcessRightsChange : data.message,
|
(!data.message) ? _t.warnProcessRightsChange : data.message,
|
||||||
_t.notcriticalErrorTitle,
|
_t.notcriticalErrorTitle,
|
||||||
|
@ -952,7 +959,9 @@ class MainController extends Component {
|
||||||
|
|
||||||
onDownloadAs () {
|
onDownloadAs () {
|
||||||
if ( this.props.storeAppOptions.canDownload) {
|
if ( this.props.storeAppOptions.canDownload) {
|
||||||
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, this._t.errorAccessDeny);
|
const { t } = this.props;
|
||||||
|
const _t = t('Controller.Main', {returnObjects:true});
|
||||||
|
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, _t.errorAccessDeny);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this._state.isFromGatewayDownloadAs = true;
|
this._state.isFromGatewayDownloadAs = true;
|
||||||
|
|
Loading…
Reference in a new issue