Description: Crash during the execution of BASIC macro with L10N procedures also with the example itself from the help: https://help.libreoffice.org/24.2/pl/text/sbasic/shared/03/sf_l10n.html?&DbPAR=SHARED&System=WIN --- System info: Library : ScriptForge Service : L10N Method : ExportToPOTFile The ScriptForge library has crashed. The reason is unknown. Maybe a bug that could be reported on https://bugs.documentfoundation.org/ More details : Location : FileSystem.OpenTextFile/1567 Wystąpił wyjątek Type: com.sun.star.ucb.ContentCreationException Message: Unable to create Content for <file:///myFile.pot>: at C:/cygwin/home/tdf/jenkins/daily_workspace/tb/src_master/ucb/source/ucp/file/prov.cxx:122 at C:/cygwin/home/tdf/jenkins/daily_workspace/tb/src_master/ucbhelper/source/client/content.cxx:264. THE EXECUTION IS CANCELLED. Steps to Reproduce: 1. write simple basic sub with service L10N and with export to po file (exaple lines from help are enough good) 2. execute it 3. that's all Actual Results: THE EXECUTION IS CANCELLED. Expected Results: create PO file and go on macro execution Reproducible: Always User Profile Reset: No Additional Info: Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community Build ID: 8566b767a24bc2c382391b6eb154f410c9f865b8 CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win Locale: pl-PL (pl_PL); UI: pl-PL Calc: threaded
There are several snippets in the help page, could you attach a file with the macro so it would be quick to reproduce?
Created attachment 191033 [details] TestExportToPOTFile BASIC sub Error reproduction macro.
Thank you for the file, I could reproduce this.
I debugged it and I think you should just replace: myPO.ExportToPOTFile("myFile.pot", Header := "First line of the header\nSecond line of the header") by: myPO.ExportToPOTFile("c:\myFile.pot", Header := "First line of the header\nSecond line of the header") I mean, on Linux, when putting: myPO.ExportToPOTFile("/tmp/myFile.pot", Header := "First line of the header\nSecond line of the header") I got a myFile.pot in /tmp containing: # # This pristine POT file has been generated by LibreOffice/ScriptForge # Full documentation is available on https://help.libreoffice.org/ # # First line of the header # Second line of the header # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice&bug_status=UNCONFIRMED&component=UI\n" "POT-Creation-Date: 2023-11-25 12:59:35\n" "PO-Revision-Date: YYYY-MM-DD HH:MM:SS\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <EMAIL@ADDRESS>\n" "Language: en_US\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" "X-Generator: LibreOffice - ScriptForge\n" "X-Accelerator-Marker: ~\n" msgid "This is a string to be included in a POT file" msgstr "" msgctxt "CTX1" msgid "A string with a context" msgstr "" #. Do not translate the word String msgid "Provide a String value" msgstr "" so perhaps not a bug after all. Jean-Pierre: put you in cc if you got some opinion here.
Yes, you are right, thx! Then bug is no in code but in help :-). In this line of help: myPO.ExportToPOTFile("en-US.pot") should be: myPO.ExportToPOTFile("/path-to/en-US.pot") or something similar. Ok, I see now that is: FileSystem.FileNaming in description, but taking the example you are confused :-) Thank you very much and sorry for the false alarm r :-)
Thank you for the feedback Racho! Olivier: I put you in cc of https://gerrit.libreoffice.org/c/help/+/159899 don't hesitate to comment if needed. (I put "C:\en-US.pot" or "C:\myFile.pot" to show it requires to put the path in addition to the filename)
I confirm that the help file, i.o. filename: The output file in FileSystem.FileNaming notation. should better contain sth like: filename: The complete output filename in FileSystem.FileNaming notation. Thanks, Racho, for reporting the help approximate text. Thanks, Julien, for your debugging effort.
(In reply to Jean-Pierre Ledure from comment #7) > I confirm that the help file, i.o. > filename: The output file in FileSystem.FileNaming notation. > should better contain sth like: > filename: The complete output filename in FileSystem.FileNaming notation. > ... I updated the help file in https://gerrit.libreoffice.org/c/help/+/159899/4
Let's put this one to NOTABUG since the help change I submitted on gerrit is just to make it clearer.
Julien Nabet committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/help/commit/2fc5ab8916f741bfea022ccfe770ce65efb90494 Related tdf#158364: improve help for ExportToPOTFile