Italian localization of SLOWDRAW doesn't affect localized movements
A Logo programming environment for Microsoft Windows
Brought to you by:
david_costanzo
The way that SLOWDRAW is implemented operates redefining the FORWARD and BACK procedures but the corresponding localized italian versions (AVANTI and INDIETRO) stay the same.
The proposed solution is to patch the startup-1040.logoscript file to not simply COPYDEF "rallenta to "slowdraw but to implement it as a proxy that reuses the native version.
Please see the attached patch [attached to the first comment here below]
I forgot to bury the newly created RALLENTA procedure, and once I'm there, I'd like to add a couple of COPYDEFs for the missing ELLIPSE, ELLIPSE2 and ELLIPSEARC2.
See the new attached patch please.
Diff:
Diff:
I split the two changes out of a general development practice of keeping each bugfix isolated to just the fix.
[r4373] The fix for Bug #493.
[r4374] The translations for ELLIPSE and friends
In general, I let the translators do what they want under the assumption that they know what's best for their language. However, I do make changes to prevent obvious mistakes and explain the implications of changes.
In this case, I added a commented out COPYDEF so that it continues to show up in the translation tables. This is something you couldn't have know, but it's how make-translations-tables.pl works.
Also, the way you have translated SLOWDRAW works for RALLENTA, but it means that SLOWDRAW and RALLENTA are not equivalent. In particular SLOWDRAW won't change the Italian forms and mixing RALLENTA and SLOWDRAW causes errors.
To see what I mean run
I think it would be better to keep RALLENTA completely separate from SLOWDRAW as Daniel Ajoy did for the Spanish translation, or copy the definition of SLOWDRAW into logostartup-1040.logoscript, modify it to overwrite both English and Italian movement commands, and use COPYDEF to copy it to RALLENTA. Putting SLOWDRAW in logostartup-1040.logoscript should mean that FMSLogo doesn't load the English one (unless it's erased, of course).
Related
Commit: [r4373]
Commit: [r4374]
Indeed, the way I implemented it calling SLOWDRAW within RALLENTA makes them not equivalent and causes the misbehavior you pointed out.
Since you've already committed that version, though, I will provide a further patch against the current version of startup-1040.logoscript and I will implement it the way you suggested, overwriting SLOWDRAW completely for Italian as Daniel Ajoy did for Spanish.
And, yes, I was wondering why we had those commented out COPYDEFs in the localized strartup scripts... now that makes sense and I see why I was wrong deleting the COPYDEF of RALLENTA.
Uhm... I didnt't really realize that those were actually two different approaches... I ended up overwriting SLOWDRAW and COPYDEFing RALLENTA to it.
The attached patch applies to the latest version I've took out from the current sourcebase and operates on both the italian and english versions of the forward / back movements, so that now SLOWDRAW and RALLENTA will be completely interchangeable.
I hope the diff file is now fine, I've edited the first two lines to make them point to the same filename... I also wonder if it's customary to give unique names to the diff files themselves... this is actually the very first open source project to which I seriously propose patches, so I'm not really used to it.
Also, I'm not sure whether the way I refactored the code is fine: the original SLOWDRAW indents, the use of the "~" line continuation instead of taking advantage of brackets, the use of NOT = instead of <>... it all looked weird to me, but I could be biased by other languages' syntax.
If there is any convention in writing Logo code that I should respect I will rewrite my patch.
Reopened for fixing the bug I introduced with reusing SLOWDRAW inside of RALLENTA, please see the attached patch in this comment above.
Last edit: entuland 2017-05-23
I have committed your update as [r4381]. Thanks for the update.
I think the ~ thing was just George's preferred style of bracket (the C++ code looked like that when I took over the project). NOT = is because <> didn't exist when SLOWDRAW was written. I assume that LOCALMAKE was implemented after SLOWDRAW because it's used in other library routines, but both predate my involvement, so that's just speculation. In all three cases, I prefer the style which you used.
Related
Commit: [r4381]
Neat, thanks for committing the latest version. I'm also glad to read that my style in writing that Logo procedure is fine.
Sorry for reopening this bug over and over again, but I noticed that the way translations get extracted from the startup-1040.logoscript file I've modified for fixing RALLENTA end up creating multiple entries in the translation tables of the manual - for example, FD maps 4 times, twice to A, once to FORWARD and once to AVANTI, the same happens with BK, I, BACK and INDIETRO
I noticed that as well. I tried several ways of fixing it, but ultimately decided to ignore any COPYDEF within a procedure definition [r4399]. This may come back to bite me if someone decides to implement procedure that contains meaninful COPYDEFs. If that happens, I'll revert this change and update the SLOWDRAW in startup-1040.logoscript to use "copiadef".
Related
Commit: [r4399]