[DE mobile] Added replacement of company name in translations

This commit is contained in:
JuliaSvinareva 2021-04-12 15:10:14 +03:00
parent 8d6ea8f464
commit 0f76a31706
2 changed files with 11 additions and 4 deletions

View file

@ -319,6 +319,12 @@ class MainController extends Component {
applyLicense () { applyLicense () {
const _t = this._t; const _t = this._t;
const warnNoLicense = _t.warnNoLicense.replace(/%1/g, __COMPANY_NAME__);
const warnNoLicenseUsers = _t.warnNoLicenseUsers.replace(/%1/g, __COMPANY_NAME__);
const textNoLicenseTitle = _t.textNoLicenseTitle.replace(/%1/g, __COMPANY_NAME__);
const warnLicenseExceeded = _t.warnLicenseExceeded.replace(/%1/g, __COMPANY_NAME__);
const warnLicenseUsersExceeded = _t.warnLicenseUsersExceeded.replace(/%1/g, __COMPANY_NAME__);
const appOptions = this.props.storeAppOptions; const appOptions = this.props.storeAppOptions;
if (appOptions.config.mode !== 'view' && !EditorUIController.isSupportEditFeature()) { if (appOptions.config.mode !== 'view' && !EditorUIController.isSupportEditFeature()) {
let value = LocalStorage.getItem("de-opensource-warning"); let value = LocalStorage.getItem("de-opensource-warning");
@ -346,9 +352,9 @@ class MainController extends Component {
) { ) {
license = (license === Asc.c_oLicenseResult.ExpiredLimited) ? _t.warnLicenseLimitedNoAccess : _t.warnLicenseLimitedRenewed; license = (license === Asc.c_oLicenseResult.ExpiredLimited) ? _t.warnLicenseLimitedNoAccess : _t.warnLicenseLimitedRenewed;
} else if (license === Asc.c_oLicenseResult.Connections || license === Asc.c_oLicenseResult.UsersCount) { } else if (license === Asc.c_oLicenseResult.Connections || license === Asc.c_oLicenseResult.UsersCount) {
license = (license===Asc.c_oLicenseResult.Connections) ? _t.warnLicenseExceeded : _t.warnLicenseUsersExceeded; license = (license===Asc.c_oLicenseResult.Connections) ? warnLicenseExceeded : warnLicenseUsersExceeded;
} else { } else {
license = (license === Asc.c_oLicenseResult.ConnectionsOS) ? _t.warnNoLicense : _t.warnNoLicenseUsers; license = (license === Asc.c_oLicenseResult.ConnectionsOS) ? warnNoLicense : warnNoLicenseUsers;
buttons = [{ buttons = [{
text: _t.textBuyNow, text: _t.textBuyNow,
bold: true, bold: true,
@ -378,7 +384,7 @@ class MainController extends Component {
if (now - value > 86400000) { if (now - value > 86400000) {
LocalStorage.setItem("de-license-warning", now); LocalStorage.setItem("de-license-warning", now);
f7.dialog.create({ f7.dialog.create({
title: _t.textNoLicenseTitle, title: textNoLicenseTitle,
text : license, text : license,
buttons: buttons buttons: buttons
}).open(); }).open();

View file

@ -164,7 +164,8 @@ module.exports = {
__PUBLISHER_PHONE__: JSON.stringify('+371 633-99867'), __PUBLISHER_PHONE__: JSON.stringify('+371 633-99867'),
__PUBLISHER_URL__: JSON.stringify('https://www.onlyoffice.com'), __PUBLISHER_URL__: JSON.stringify('https://www.onlyoffice.com'),
__PUBLISHER_NAME__: JSON.stringify('Ascensio System SIA'), __PUBLISHER_NAME__: JSON.stringify('Ascensio System SIA'),
__APP_TITLE_TEXT__: JSON.stringify(process.env.APP_TITLE_TEXT ? process.env.APP_TITLE_TEXT : 'ONLYOFFICE') __APP_TITLE_TEXT__: JSON.stringify(process.env.APP_TITLE_TEXT ? process.env.APP_TITLE_TEXT : 'ONLYOFFICE'),
__COMPANY_NAME__: JSON.stringify(process.env.COMPANY_NAME ? process.env.COMPANY_NAME : 'ONLYOFFICE')
}), }),
...(env === 'production' ? [ ...(env === 'production' ? [