Bug 75109 - Other: LibreLogo
Summary: Other: LibreLogo
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.0.3 rc
Hardware: Other Windows (All)
: medium normal
Assignee: László Németh
URL:
Whiteboard: BSA target:4.3.0 target:4.2.3
Keywords: regression
Depends on:
Blocks:
 
Reported: 2014-02-17 18:00 UTC by Kolbjørn Stuestøl
Modified: 2014-03-31 09:34 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kolbjørn Stuestøl 2014-02-17 18:00:56 UTC
Problem description:  Not able to define my own functions TO ... END

Steps to reproduce:
1. TO test
FORWARD 40 ; or whatever 
END...
2. ....
3. ....

Current behavior: (LO version 4.2.1.1) Calling the function test does not work. Nothing happens, not even an error message.

Expected behavior: Well, it obviously should do something when called.
Defining functions worked in previous vesions, not sure when the bug occured for the first time. Perhaps in 4.2.0.3?

              
Operating System: Windows 7
Version: 4.2.0.4 release
Comment 1 retired 2014-03-28 12:14:03 UTC
Please attach a test document so this can be tested. Also I'm not sure if "LibreLogo" is a good title for this bug. Please change it to something useful.
Comment 2 Stanislav Horacek 2014-03-28 14:59:46 UTC
I think no test document is needed, it is pretty straightforward to write:

TO test
FORWARD 40
END
test

However, I can't reproduced the error, the turtle moves as expected.
Tested on LO 4.2.3 RC1, Ubuntu 13.10.
Comment 3 László Németh 2014-03-28 15:33:39 UTC
LibreLogo uses localized commands, if they exist, or the original English ones, but the missing warning message signs other problem, too. 
Is the turtle able to draw (1) by turtle moving icons (2) or by commands?

Check the localized commands, eg.
https://translations.documentfoundation.org/nb/libo_ui/librelogo/
https://translations.documentfoundation.org/nn/libo_ui/librelogo/
or change the language of the document to English.

Maybe the missing message box is a platform specific problem, I will check it under Windows. (There was a fix at this time for Linux platform, related to the missing message boxes:

--- a/librelogo/source/LibreLogo/LibreLogo.py
+++ b/librelogo/source/LibreLogo/LibreLogo.py
@@ -275,9 +275,9 @@ def MessageBox(parent, message, title, msgtype = "messbox", buttons = __OK__):
     d.WindowAttributes = buttons
     tk = parent.getToolkit()
     msgbox = tk.createWindow(d)
-    msgbox.setMessageText(message)
+    msgbox.MessageText = message
     if title:
-        msgbox.setCaptionText(title)
+        msgbox.CaptionText = title
     return msgbox.execute()
)

Thanks for your bug report! László
Comment 4 Kolbjørn Stuestøl 2014-03-28 17:15:39 UTC
(In reply to comment #2)
> I think no test document is needed, it is pretty straightforward to write:
> 
> TO test
> FORWARD 40
> END
> test
> 
> However, I can't reproduced the error, the turtle moves as expected.
> Tested on LO 4.2.3 RC1, Ubuntu 13.10.

I am using LO 4.2.1.1, Widows 7 
It works when "Default laguage for documents" (in Tools -> Language) is set to English (USA), but not if set to Norwegian nn or nb. Of course using english commands.
The settings "User interface" and "Locale setting" doesn't matter.
I have not tried other languages.
In the file pythonpath.po (nn) the translations are:
#. HyJKJ
#: LibreLogo_en_US.properties
msgctxt ""
"LibreLogo_en_US.properties\n"
"TO\n"
"property.text"
msgid "to"
msgstr "til|to"

#. qMmGB
#: LibreLogo_en_US.properties
msgctxt ""
"LibreLogo_en_US.properties\n"
"END\n"
"property.text"
msgid "end"
msgstr "slutt|end"

If there is an error in the pythonpath.po file, what to look for?
Comment 5 Kolbjørn Stuestøl 2014-03-28 17:26:16 UTC
If I write on the page, not the command line, and then run for example
BACK 100
LEFT 90

and then writing the test function 
TO test
FORWARD 40
END
test

and try to run it, at the first click on the "Run" icon nothing happens. At the second click the first written commands are executed. 

I do not know if this is an error (bug).
Comment 6 Kolbjørn Stuestøl 2014-03-28 21:01:22 UTC
Tested with default language set to Danish, Swedish, Icelandic and German respectively. (Danish and Swedish not actually translated, but the English text is copied to the language fields in the po file). In text area I wrote:

FD 120  ; (command)
LEFT 45 ; (command)

TO test ; (procedure)
  LEFT 90
  FD 100
END

test

Clicking on the start button and:
Using Norwegian (nn, nb) nothing happens. Not even an error message.
Using Swedish and German (commands in German) both the commands and the procedure draw the expected lines.
Using Danish and Icelandic only the commands where run, not the procedure. No error message.
Ran the test about five times for each language.
All other settings are the daufult settings. 
(LO 4.2.1.1. Windows 7).
Comment 7 László Németh 2014-03-28 21:43:22 UTC
Many thanks for the test! Do you get a message box with a 

PRINT 0

command in an English language document?

If you get, could you create a log file in the Windows command line with the following commands:

set PYUNO_LOGLEVEL=ARGS
set PYUNO_LOGTARGET=file:///c:/temp/log
[your_libreoffice_installation]/program/soffice.exe

and attach the result, (eg. c:/temp/log.process_id).

Maybe the problem is the missing PENCAP item in the localized LibreLogo_nn.properties etc. files ([installation]/share/Scripts/python/LibreLogo/...). 

Could you attach it?

Thanks in advance!
Comment 8 Kolbjørn Stuestøl 2014-03-29 15:16:26 UTC
(In reply to comment #7)
> Many thanks for the test! Do you get a message box with a 
> 
> PRINT 0
> 
> command in an English language document?
No error message.
> > 
> Maybe the problem is the missing PENCAP item in the localized
> LibreLogo_nn.properties etc. files
> ([installation]/share/Scripts/python/LibreLogo/...). 
> 
> Could you attach it?
There is a translated PENCAP: 
PENCAP=linjeende|pencap|linecap
(In addition to the Norwegian translations I also have kept some of the original commands).  

Made a copy of the file LibreLogo_en_US.properties and renamed it to LibreLogo_nn.properties. (Giving the original nn file another name to preserve it). All works fine, but English commands of course.
When using the original nn file again, all is back as described abowe.
Restarted LO between changes.
Comment 9 László Németh 2014-03-30 00:08:34 UTC
PYUNO_LOGLEVEL=ARGS debugging has helped to list the following comment from LibreLogo.py

[ \t]*\b(?:%(END)s)\b""" % __l12n__(_.lng), s, re.X) ] # final END (XXX multiple names of "END" doesn't supported)

So there is a limitation for the translations of "END". I'm very sorry, it was my fault. I forgot to solve it or add same warnings for the translators. There are a few languages with the same problems, yet (
LibreLogo_ca.properties:END=final|fi
LibreLogo_ca_valencia.properties:END=final|fi
LibreLogo_el.properties:END=\u03C4\u03AD\u03BB\u03BF\u03C2|end
LibreLogo_ja.properties:END=\u304A\u308F\u308A|end
LibreLogo_nb.properties:END=slutt|end
LibreLogo_ro.properties:END=sf\u00E2r\u0219it|end
LibreLogo_zh_TW.properties:END=\u7D50\u675F|\u8FC4|end
), so I will fix it in the source code within a few days, so next bug fix release of LibreOffice will be able to run Logo procedures with these localizations, too.

A temporary fix to test the Norwegian localization: change the END=slutt|end with

END=slutt

in LibreLogo_nn.properties.

Thanks for your bug report and your testing!
Comment 10 Kolbjørn Stuestøl 2014-03-30 10:38:56 UTC
(In reply to comment #9)
Thank you a lot. :-)
Kolbjoern
Comment 11 Commit Notification 2014-03-31 09:16:57 UTC
Laszlo Nemeth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2fc50ff8bea6f64b367d44a1760b8dd9fb69a401

fdo#75109 librelogo: fix localized procedures



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2014-03-31 09:30:08 UTC
Laszlo Nemeth committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1a883af91567fd86b966d6fb4d7d33c1110067db&h=libreoffice-4-2

fdo#75109 librelogo: fix localized procedures


It will be available in LibreOffice 4.2.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2014-03-31 09:30:23 UTC
Laszlo Nemeth committed a patch related to this issue.
It has been pushed to "libreoffice-4-2-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=236d87d529ed4c5c4b19320f222ac2cc8b0312ae&h=libreoffice-4-2-3

fdo#75109 librelogo: fix localized procedures


It will be available already in LibreOffice 4.2.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 14 László Németh 2014-03-31 09:34:27 UTC
fixed in the next bug fix release, too, marked as a regression

Kolbjoern: thanks for your report and help, again!