[common] Add editor name in instruction for macros ai

This commit is contained in:
Alexey Koshelev
2025-05-30 12:57:10 +03:00
parent b6ceef103b
commit 60b38ac80f
2 changed files with 9 additions and 1 deletions

View File

@ -36,7 +36,9 @@
*
*/
define([], function () { 'use strict';
define([
'common/main/lib/component/TextareaField',
], function () { 'use strict';
Common.Views.MacrosAiDialog = Common.UI.Window.extend(_.extend({

View File

@ -768,10 +768,15 @@ define([], function () {
langName = null;
}
var editorName = 'Document Editor';
if(window.PE) editorName = 'Presentation Editor';
if(window.SSE) editorName = 'Spreadsheet Editor';
if(item.value == 'create') {
title = this.textCreateMacrosFromDesc;
instruction = '' +
'Create a macro for OnlyOffice. ' +
'The macro should be written specifically for the OnlyOffice ' + editorName + '. ' +
'Return only code with comments, as plain text without markdown. ' +
'The format of the code is JavaScript. ' +
'Write comments in the same language as the user prompt. ' +
@ -780,6 +785,7 @@ define([], function () {
title = this.textConvertMacrosFromVBA;
instruction = '' +
'Convert macro for OnlyOffice from VBA. ' +
'The macro should be written specifically for the OnlyOffice ' + editorName + '. ' +
'Return only code with comments, as plain text without markdown. ' +
'The code format is JavaScript. ' +
'Write comments in ' + langCode + (langName ? '(' + langName + ')' : '') + ' language. ' +