Created attachment 176864 [details] Cryptic messages scares end users Attached is a dialog that sparks uncountable demand for help in Brazilian public forums and may be in other languages too. The message box has intermixed language and cryptic contents for the average end-user. It must be brought to translation in full in layman terms. -----8<----- Ocorreu um erro de Scripting Framework durante a execução do script Basic vnd.sun.star.script:Standard.Module1.www?language=Basic&location=document. Mensagem: The following Basic script could not be found: library: 'Standard' module: 'Module1' method: 'www' location: 'document' /home/buildslave/source/libo-core/scripting/source/basprov/basprov.cxx:365 -----8<----- Terms senseless to average end user, non-English speaker: --------------------------------------------------------- "Scripting Framework" "vnd.sun.star.script ...." "script" Untranslated strings: --------------------- message content, e.g. 'The following Basic script could not be found:' 'library', 'module', 'method', 'location', document Affected string in cui/inc/strings.hrc -------------------------------------- https://opengrok.libreoffice.org/xref/core/cui/inc/strings.hrc?r=335ffc0f#248 #define RID_CUISTR_ERROR_TITLE NC_("RID_SVXSTR_ERROR_TITLE", "%PRODUCTNAME Error") #define RID_CUISTR_ERROR_LANG_NOT_SUPPORTED NC_("RID_SVXSTR_ERROR_LANG_NOT_SUPPORTED", "The scripting language %LANGUAGENAME is not supported.") #define RID_CUISTR_ERROR_RUNNING NC_("RID_SVXSTR_ERROR_RUNNING", "An error occurred while running the %LANGUAGENAME script %SCRIPTNAME.") #define RID_CUISTR_EXCEPTION_RUNNING NC_("RID_SVXSTR_EXCEPTION_RUNNING", "An exception occurred while running the %LANGUAGENAME script %SCRIPTNAME.") #define RID_CUISTR_ERROR_AT_LINE NC_("RID_SVXSTR_ERROR_AT_LINE", "An error occurred while running the %LANGUAGENAME script %SCRIPTNAME at line: %LINENUMBER.") #define RID_CUISTR_EXCEPTION_AT_LINE NC_("RID_SVXSTR_EXCEPTION_AT_LINE", "An exception occurred while running the %LANGUAGENAME script %SCRIPTNAME at line: %LINENUMBER.") #define RID_CUISTR_FRAMEWORK_ERROR_RUNNING NC_("RID_SVXSTR_FRAMEWORK_ERROR_RUNNING", "A Scripting Framework error occurred while running the %LANGUAGENAME script %SCRIPTNAME.") #define RID_CUISTR_ERROR_TYPE_LABEL NC_("RID_SVXSTR_ERROR_TYPE_LABEL", "Type:") #define RID_CUISTR_ERROR_MESSAGE_LABEL NC_("RID_SVXSTR_ERROR_MESSAGE_LABEL", "Message:") Missing translatable strings (suggestion) ----------------------------------------- #define RID_CUISTR_ERROR_LIBRARY_LABEL #define RID_CUISTR_ERROR_MODULE_LABEL #define RID_CUISTR_ERROR_METHOD_LABEL #define RID_CUISTR_ERROR_LOCATION_LABEL Affected strings in scripting/source/basprov/basprov.cxx#355 if ( !xScript.is() ) { throw provider::ScriptFrameworkErrorException( "The following Basic script could not be found:\n" "library: '" + aLibrary + "'\n" "module: '" + aModule + "'\n" "method: '" + aMethod + "'\n" "location: '" + aLocation + "'\n", Reference< XInterface >(), scriptURI, "Basic", provider::ScriptFrameworkErrorType::NO_SUCH_SCRIPT ); }
Do you have an example script that throws this error?
Created attachment 176898 [details] file with missing macro, throw scripting error.
How about "The macro Standard:Module1.macronotfound not found. Please check whether all files are placed at the right position" taking the concatenated text from what is shown at assigned actions. However this would hide method and location.
I agree that this error message does not help casual programmers. Starting with "A Scripting Framework error" does not emphasize the real cause of the problem. Following Heiko's idea, I would also include a few of the fields that are currently displayed in the error message: ----------------------- The Basic macro Standard.Module1.macronotfound could not be found. The macro is expected to be located at: Location: Document Library: Standard Module: Module 1 Macro name: macronotfound -----------------------
No further input, let's follow Rafael's suggestion.
Proposed patch at: https://gerrit.libreoffice.org/c/core/+/130024
(In reply to Rafael Lima from comment #6) > Proposed patch at: > https://gerrit.libreoffice.org/c/core/+/130024 Hi all. My proposed patch failed at some cases, returning wrong messages to the user. The problem is that passing a string from "scripting" to "cui" feels hacky and I don't feel confident with the proposed patch. So I am unassigning it from myself for the moment.