Skip to content

Commit

Permalink
Merge pull request #3014 from ONLYOFFICE/fix/bugfix
Browse files Browse the repository at this point in the history
Fix/bugfix
  • Loading branch information
JuliaRadzhabova authored May 29, 2024
2 parents 3796f50 + d7c0226 commit b0d7746
Show file tree
Hide file tree
Showing 13 changed files with 126 additions and 38 deletions.
7 changes: 4 additions & 3 deletions apps/common/locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ Common.Locale = new(function() {

var _requireLang = function (l) {
typeof l != 'string' && (l = null);
var lang = (l || _getUrlParameterByName('lang') || defLang);
var idx4Letters = _4letterLangs.indexOf(lang.replace('_', '-').toLowerCase()); // try to load 4 letters language
lang = (idx4Letters<0) ? lang.split(/[\-_]/)[0] : _4letterLangs[idx4Letters];
var lang = (l || _getUrlParameterByName('lang') || defLang).toLowerCase().split(/[\-_]/);
lang = lang[0] + (lang.length>1 ? '-' + lang[1] : '');
var idx4Letters = _4letterLangs.indexOf(lang); // try to load 4 letters language
lang = (idx4Letters<0) ? lang.split(/[\-]/)[0] : _4letterLangs[idx4Letters];
currentLang = lang;
fetch('locale/' + lang + '.json')
.then(function(response) {
Expand Down
16 changes: 14 additions & 2 deletions apps/documenteditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ define([
var me = this,
styleNames = ['Normal', 'No Spacing', 'Heading 1', 'Heading 2', 'Heading 3', 'Heading 4', 'Heading 5',
'Heading 6', 'Heading 7', 'Heading 8', 'Heading 9', 'Title', 'Subtitle', 'Quote', 'Intense Quote', 'List Paragraph', 'footnote text',
'Caption', 'endnote text'],
'Caption', 'endnote text', 'Default Paragraph Font', 'No List', 'Intense Emphasis', 'Intense Reference', 'Subtle Emphasis', 'Emphasis',
'Strong', 'Subtle Reference', 'Book Title', 'footnote reference', 'endnote reference'],
translate = {
'Series': this.txtSeries,
'Diagram Title': this.txtDiagramTitle,
Expand Down Expand Up @@ -3600,7 +3601,18 @@ define([
textText: 'Text',
warnLicenseBefore: 'License not active.<br>Please contact your administrator.',
titleLicenseNotActive: 'License not active',
warnLicenseAnonymous: 'Access denied for anonymous users. This document will be opened for viewing only.'
warnLicenseAnonymous: 'Access denied for anonymous users. This document will be opened for viewing only.',
txtStyle_Default_Paragraph_Font: 'Default paragraph font',
txtStyle_No_List: 'No list',
txtStyle_Intense_Emphasis: 'Intense emphasis',
txtStyle_Intense_Reference: 'Intense reference',
txtStyle_Subtle_Emphasis: 'Subtle emphasis',
txtStyle_Emphasis: 'Emphasis',
txtStyle_Strong: 'Strong',
txtStyle_Subtle_Reference: 'Subtle reference',
txtStyle_Book_Title: 'Book Title',
txtStyle_footnote_reference: 'Footnote reference',
txtStyle_endnote_reference: 'Endnote reference'
}
})(), DE.Controllers.Main || {}))
});
11 changes: 11 additions & 0 deletions apps/documenteditor/main/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,17 @@
"DE.Controllers.Main.txtStyle_Quote": "Quote",
"DE.Controllers.Main.txtStyle_Subtitle": "Subtitle",
"DE.Controllers.Main.txtStyle_Title": "Title",
"DE.Controllers.Main.txtStyle_Default_Paragraph_Font": "Default paragraph font",
"DE.Controllers.Main.txtStyle_No_List": "No list",
"DE.Controllers.Main.txtStyle_Intense_Emphasis": "Intense emphasis",
"DE.Controllers.Main.txtStyle_Intense_Reference": "Intense reference",
"DE.Controllers.Main.txtStyle_Subtle_Emphasis": "Subtle emphasis",
"DE.Controllers.Main.txtStyle_Emphasis": "Emphasis",
"DE.Controllers.Main.txtStyle_Strong": "Strong",
"DE.Controllers.Main.txtStyle_Subtle_Reference": "Subtle reference",
"DE.Controllers.Main.txtStyle_Book_Title": "Book Title",
"DE.Controllers.Main.txtStyle_footnote_reference": "Footnote reference",
"DE.Controllers.Main.txtStyle_endnote_reference": "Endnote reference",
"DE.Controllers.Main.txtSyntaxError": "Syntax error",
"DE.Controllers.Main.txtTableInd": "Table index cannot be zero",
"DE.Controllers.Main.txtTableOfContents": "Table of contents",
Expand Down
13 changes: 12 additions & 1 deletion apps/documenteditor/mobile/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,18 @@
"X Axis": "X Axis XAS",
"Y Axis": "Y Axis",
"Your text here": "Your text here",
"Zero Divide": "Zero Divide"
"Zero Divide": "Zero Divide",
"Default Paragraph Font": "Default Paragraph Font",
"No List": "No list",
"Intense Emphasis": "Intense Emphasis",
"Intense Reference": "Intense Reference",
"Subtle Emphasis": "Subtle Emphasis",
"Emphasis": "Emphasis",
"Strong": "Strong",
"Subtle Reference": "Subtle Reference",
"Book Title":"Book Title",
"footnote reference": "Footnote reference",
"endnote reference": "Endnote reference"
},
"textAnonymous": "Anonymous",
"textBuyNow": "Visit website",
Expand Down
13 changes: 12 additions & 1 deletion apps/documenteditor/mobile/src/controller/Main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,18 @@ class MainController extends Component {
"X Axis": "X Axis XAS",
"Y Axis": "Y Axis",
"Your text here": "Your text here",
"Zero Divide": "Zero Divide"
"Zero Divide": "Zero Divide",
"Default Paragraph Font": "Default Paragraph Font",
"No List": "No list",
"Intense Emphasis": "Intense Emphasis",
"Intense Reference": "Intense Reference",
"Subtle Emphasis": "Subtle Emphasis",
"Emphasis": "Emphasis",
"Strong": "Strong",
"Subtle Reference": "Subtle Reference",
"Book Title":"Book Title",
"footnote reference": "Footnote reference",
"endnote reference": "Endnote reference"
}

this._state = {
Expand Down
10 changes: 5 additions & 5 deletions apps/presentationeditor/main/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
}

.loadmask > .sktoolbar li.big {
width: 50px;
width: 40px;
height: 46px;
margin-top: -46px;
}
Expand All @@ -132,12 +132,12 @@
right: 0;
top: 0;
bottom: 0;
left: 800px;
left: 795px;
width: inherit;
height: 44px;
}
.rtl .loadmask > .sktoolbar li.fat {
right: 800px;
right: 795px;
left: 0;
}

Expand Down Expand Up @@ -294,8 +294,8 @@
<div><div class="loading-logo"><img src="../../common/main/resources/img/header/header-logo_s.svg"></div><div class="spacer"></div><div class="circle"></div></div><div><span class="rect"></span><span class="rect"></span><span class="rect"></span><span class="rect"></span><div class="spacer"></div></div>
</div>
<div class="sktoolbar" style="display: none;">
<ul><li class="compact" style="width: 30px;display: none;"></li><li class="compact space" style="display: none;"></li><li class="compact" style="width: 90px;display: none;"></li><li class="not-compact" style="width: 63px;"></li><li class="space" style="width: 54px;"/><li class="split" /><li class="space"/><li style="width: 216px;"/><li class="space"/><li style="width: 136px;"/><li class="space" style="width: 168px;"/><li class="space"/><li style="width: 65px;"/><li class="fat"/></ul>
<ul><li class="compact" style="width: 30px;display: none;"></li><li class="compact space" style="display: none;"></li><li class="compact" style="width: 90px;display: none;"></li><li class="not-compact" style="width: 63px;"></li><li class="space"/><li class="big" style="width: 48px;"/><li class="split" /><li class="space"/><li style="width: 216px;"/><li class="space"/><li style="width: 136px;"/><li class="space"/><li class="big"/><li class="big"/><li class="big"/><li class="space"/><li style="width: 65px;"/></ul>
<ul><li class="compact" style="width: 30px;display: none;"></li><li class="compact space" style="display: none;"></li><li class="compact" style="width: 90px;display: none;"></li><li class="not-compact" style="width: 63px;"></li><li class="space" style="width: 54px;"/><li class="split" /><li class="space"/><li style="width: 236px;"/><li class="space"/><li style="width: 136px;"/><li class="space" style="width: 138px;"/><li class="space"/><li style="width: 70px;"/><li class="fat"/></ul>
<ul><li class="compact" style="width: 30px;display: none;"></li><li class="compact space" style="display: none;"></li><li class="compact" style="width: 90px;display: none;"></li><li class="not-compact" style="width: 63px;"></li><li class="space"/><li class="big" style="width: 48px;"/><li class="split" /><li class="space"/><li style="width: 236px;"/><li class="space"/><li style="width: 136px;"/><li class="space"/><li class="big"/><li class="big"/><li class="big"/><li class="space"/><li style="width: 70px;"/></ul>
</div>
<div class="placeholder" style="display: none;">
<div class="slide-h"><div class="slide-v"><div class="slide-container"><div class="line"></div><div class="line empty"></div><div class="line"></div></div></div></div>
Expand Down
10 changes: 5 additions & 5 deletions apps/presentationeditor/main/index.html.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
}

.loadmask > .sktoolbar li.big {
width: 50px;
width: 40px;
height: 46px;
margin-top: -46px;
}
Expand All @@ -120,12 +120,12 @@
right: 0;
top: 0;
bottom: 0;
left: 800px;
left: 795px;
width: inherit;
height: 44px;
}
.rtl .loadmask > .sktoolbar li.fat {
right: 800px;
right: 795px;
left: 0;
}

Expand Down Expand Up @@ -281,8 +281,8 @@
<div><div class="loading-logo"><img src="../../../apps/common/main/resources/img/header/header-logo_s.svg"></div><div class="spacer"></div><div class="circle"></div></div><div><span class="rect"></span><span class="rect"></span><span class="rect"></span><span class="rect"></span><div class="spacer"></div></div>
</div>
<div class="sktoolbar" style="display: none;">
<ul><li class="compact" style="width: 30px;display: none;"></li><li class="compact space" style="display: none;"></li><li class="compact" style="width: 90px;display: none;"></li><li class="not-compact" style="width: 63px;"></li><li class="space" style="width: 54px;"/><li class="split" /><li class="space"/><li style="width: 216px;"/><li class="space"/><li style="width: 136px;"/><li class="space" style="width: 168px;"/><li class="space"/><li style="width: 65px;"/><li class="fat"/></ul>
<ul><li class="compact" style="width: 30px;display: none;"></li><li class="compact space" style="display: none;"></li><li class="compact" style="width: 90px;display: none;"></li><li class="not-compact" style="width: 63px;"></li><li class="space"/><li class="big" style="width: 48px;"/><li class="split" /><li class="space"/><li style="width: 216px;"/><li class="space"/><li style="width: 136px;"/><li class="space"/><li class="big"/><li class="big"/><li class="big"/><li class="space"/><li style="width: 65px;"/></ul>
<ul><li class="compact" style="width: 30px;display: none;"></li><li class="compact space" style="display: none;"></li><li class="compact" style="width: 90px;display: none;"></li><li class="not-compact" style="width: 63px;"></li><li class="space" style="width: 54px;"/><li class="split" /><li class="space"/><li style="width: 236px;"/><li class="space"/><li style="width: 136px;"/><li class="space" style="width: 138px;"/><li class="space"/><li style="width: 70px;"/><li class="fat"/></ul>
<ul><li class="compact" style="width: 30px;display: none;"></li><li class="compact space" style="display: none;"></li><li class="compact" style="width: 90px;display: none;"></li><li class="not-compact" style="width: 63px;"></li><li class="space"/><li class="big" style="width: 48px;"/><li class="split" /><li class="space"/><li style="width: 236px;"/><li class="space"/><li style="width: 136px;"/><li class="space"/><li class="big"/><li class="big"/><li class="big"/><li class="space"/><li style="width: 70px;"/></ul>
</div>
<div class="placeholder" style="display: none;">
<div class="slide-h"><div class="slide-v"><div class="slide-container"><div class="line"></div><div class="line empty"></div><div class="line"></div></div></div></div>
Expand Down
11 changes: 9 additions & 2 deletions apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -3502,9 +3502,16 @@ define([
functip.parentEl = $('<div id="tip-container-functip" style="position: absolute; z-index: 10000;"></div>');
this.documentHolder.cmpEl.append(functip.parentEl);
}

var funcdesc = this.getApplication().getController('FormulaDialog').getDescription(Common.Utils.InternalSettings.get("sse-settings-func-locale")),
hint = ((funcdesc && funcdesc[name]) ? (this.api.asc_getFormulaLocaleName(name) + funcdesc[name].a) : '').replace(/[,;]/g, this.api.asc_getFunctionArgumentSeparator());
hint = '';
if (funcdesc && funcdesc[name]) {
hint = this.api.asc_getFormulaLocaleName(name) + funcdesc[name].a;
hint = hint.replace(/[,;]/g, this.api.asc_getFunctionArgumentSeparator());
} else {
var custom = this.api.asc_getCustomFunctionInfo(name),
arr_args = custom ? custom.asc_getArg() || [] : [];
hint = this.api.asc_getFormulaLocaleName(name) + '(' + arr_args.map(function (item) { return item.asc_getIsOptional() ? '[' + item.asc_getName() + ']' : item.asc_getName(); }).join(this.api.asc_getFunctionArgumentSeparator() + ' ') + ')';
}

if (functip.ref && functip.ref.isVisible()) {
if (functip.text != hint) {
Expand Down
45 changes: 35 additions & 10 deletions apps/spreadsheeteditor/main/app/controller/FormulaDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,17 @@ define([
origin = this.api.asc_getFormulaNameByLocale(name),
descrarr = this.getDescription(Common.Utils.InternalSettings.get("sse-settings-func-locale")),
custom = this.api.asc_getCustomFunctionInfo(origin),
funcprops = {
args = '';
if (custom) {
var arr_args = custom.asc_getArg() || [];
args = '(' + arr_args.map(function (item) { return item.asc_getIsOptional() ? '[' + item.asc_getName() + ']' : item.asc_getName(); }).join(this.api.asc_getFunctionArgumentSeparator() + ' ') + ')';
}
var funcprops = {
name: name,
origin: origin,
args: ((descrarr && descrarr[origin]) ? descrarr[origin].a : '').replace(/[,;]/g, this.api.asc_getFunctionArgumentSeparator()),
desc: (descrarr && descrarr[origin]) ? descrarr[origin].d : custom ? custom.asc_getDescription() || '' : ''
args: (descrarr && descrarr[origin]) ? descrarr[origin].a.replace(/[,;]/g, this.api.asc_getFunctionArgumentSeparator()) : args,
desc: (descrarr && descrarr[origin]) ? descrarr[origin].d : custom ? custom.asc_getDescription() || '' : '',
custom: !!custom
};

(new SSE.Views.FormulaWizard({
Expand Down Expand Up @@ -315,16 +321,20 @@ define([
for (var j = 0; j < arr.length; j++) {
var funcname = arr[j],
custom = descrarr && descrarr[funcname] ? null : this.api.asc_getCustomFunctionInfo(funcname),
desc = (descrarr && descrarr[funcname]) ? descrarr[funcname].d : custom ? custom.asc_getDescription() || '' : '';

desc = (descrarr && descrarr[funcname]) ? descrarr[funcname].d : custom ? custom.asc_getDescription() || '' : '',
args = '';
if (custom) {
var arr_args = custom.asc_getArg() || [];
args = '(' + arr_args.map(function (item) { return item.asc_getIsOptional() ? '[' + item.asc_getName() + ']' : item.asc_getName(); }).join(this.api.asc_getFunctionArgumentSeparator() + ' ') + ')';
}
if (!desc && allFunctions && !_.find(allFunctions, function(item){ return item.get('origin')===funcname; }))
continue;
functions.push(new SSE.Models.FormulaModel({
index : j,
group : 'Last10',
name : this.api.asc_getFormulaLocaleName(funcname),
origin: funcname,
args : ((descrarr && descrarr[funcname]) ? descrarr[funcname].a : '').replace(/[,;]/g, separator),
args : (descrarr && descrarr[funcname]) ? descrarr[funcname].a.replace(/[,;]/g, separator) : args,
desc : desc
}));
}
Expand Down Expand Up @@ -391,13 +401,19 @@ define([

for (j = 0; j < ascFunctions.length; j += 1) {
var funcname = ascFunctions[j].asc_getName(),
custom = descrarr && descrarr[funcname] ? null : this.api.asc_getCustomFunctionInfo(funcname);
custom = descrarr && descrarr[funcname] ? null : this.api.asc_getCustomFunctionInfo(funcname),
args = '';
if (custom) {
var arr_args = custom.asc_getArg() || [];
args = '(' + arr_args.map(function (item) { return item.asc_getIsOptional() ? '[' + item.asc_getName() + ']' : item.asc_getName(); }).join(this.api.asc_getFunctionArgumentSeparator() + ' ') + ')';
}

var func = new SSE.Models.FormulaModel({
index : funcInd,
group : ascGroupName,
name : ascFunctions[j].asc_getLocaleName(),
origin: funcname,
args : ((descrarr && descrarr[funcname]) ? descrarr[funcname].a : '').replace(/[,;]/g, separator),
args : (descrarr && descrarr[funcname]) ? descrarr[funcname].a.replace(/[,;]/g, separator) : args,
desc : (descrarr && descrarr[funcname]) ? descrarr[funcname].d : custom ? custom.asc_getDescription() || '' : ''
});

Expand Down Expand Up @@ -463,13 +479,18 @@ define([
ascFunctions = info[i].asc_getFormulasArray();
for (j = 0; j < ascFunctions.length; j += 1) {
var funcname = ascFunctions[j].asc_getName(),
custom = this.api.asc_getCustomFunctionInfo(funcname);
custom = this.api.asc_getCustomFunctionInfo(funcname),
args = '';
if (custom) {
var arr_args = custom.asc_getArg() || [];
args = '(' + arr_args.map(function (item) { return item.asc_getIsOptional() ? '[' + item.asc_getName() + ']' : item.asc_getName(); }).join(this.api.asc_getFunctionArgumentSeparator() + ' ') + ')';
}
var func = new SSE.Models.FormulaModel({
index : funcInd,
group : customGroupName,
name : ascFunctions[j].asc_getLocaleName(),
origin: funcname,
args : '',
args : args,
desc : custom ? custom.asc_getDescription() || '' : ''
});

Expand All @@ -484,6 +505,10 @@ define([
}
}
this.formulaTab && this.formulaTab.updateCustom();

var group = this.formulasGroups.findWhere({name : 'Last10'});
group && group.set('functions', this.loadingLast10Formulas(this.getDescription(Common.Utils.InternalSettings.get("sse-settings-func-locale"))));
this.formulaTab && this.formulaTab.updateRecent();
}
},

Expand Down
Loading

0 comments on commit b0d7746

Please sign in to comment.