Producing guides - add a "Cleaned" directory

Hi,

I suggest to include file cleaning in the workflow. In cleaning one
removes direct formatting, which is necessary for translation. Currently
I do that after a guide is published - the cleaned files can be found
here:

https://nextcloud.documentfoundation.org/index.php/apps/files?dir=/Shared/SK%20community/Cleaned

The current problem is that nobody knows about them and a new version of
a guide starts from an uncleaned version in the Published and thus I
have to repeat the laborious manual cleaning part again an again.

My suggestion is to add another step after step 7 in the "How to publish
a chapter" section (page 15, 2 - Producing LO Guides.odt): a "Cleaned"
directory, the contents of which will then be used to start a next
version of the guide. I will then produce the cleaned files.

Milos

Hi Milos, All

Hi,

I suggest to include file cleaning in the workflow. In cleaning one
removes direct formatting, which is necessary for translation. Currently
I do that after a guide is published - the cleaned files can be found
here:

https://nextcloud.documentfoundation.org/index.php/apps/files?dir=/Shared/SK%20community/Cleaned

The current problem is that nobody knows about them and a new version of
a guide starts from an uncleaned version in the Published and thus I
have to repeat the laborious manual cleaning part again an again.

BTW, last time I tried odtclean.py in my Linux box it failed, something
related to python version. Actually, is it still of use?

My suggestion is to add another step after step 7 in the "How to publish
a chapter" section (page 15, 2 - Producing LO Guides.odt): a "Cleaned"
directory, the contents of which will then be used to start a next
version of the guide. I will then produce the cleaned files.

I think the cleaned files should be the published files. In other words,
only publish cleaned files.

Olivier

Hi, Milos,

I completely agree with you and +1 from me.

There were some reports about the script not working on GNU/Linux, maybe
someone can elaborate?

Lp, m.

V V čet., 17. dec. 2020 ob 20:42 je oseba Milos Sramek <
sramek.milos@gmail.com> napisala:

Hi,
I have a new version - I'll put it on github, so that there is a well
defined place to find it.
m

Hi,
I've uploaded the script and some documentation to github:
https://github.com/milossramek/translation-scripts/tree/master/odtclean
This should solve the problem of 'some' version found 'somewhere'.

Olivier, you wrote:

I think the cleaned files should be the published files. In other words,
only publish cleaned files.

It is not clear to me who should clean the files. The author? Maybe that
using the script may be a problem for them.
If somebody (for example, I) should do the cleaning, then it is not
clear when should I do that. As soon as a file appears in the Published
directory? Or, when all are finished?

From the point of view of publication of a guide cleaning is not
important (there should be no visible differences between cleaned and
uncleaned document). I would therefore prefer batch cleaning after a
guide has been published. In that case I would prefer to place the
cleaned files to the Cleaned directory, so that I do not need to change
the Published ones. Or, by cleaning we may start a new version of the
guide - by placing them to the Work in Progress directory of the new
version and to add an appropriate record to the Guide Status...ods file

Milos

So, Miloš,

this is probably the place with your updated script odtcleant:
https://github.com/milossramek/translation-scripts/tree/master/odtclean

Lp, m.

V V pet., 18. dec. 2020 ob 09:42 je oseba Milos Sramek <
sramek.milos@gmail.com> napisala:

Hi Olivier and all,
now that CG70 and MG70 are published I have cleaned the documents
manually and by the script. You can find the archives in
https://nextcloud.documentfoundation.org/apps/files/?dir=/Shared/SK%20community/Cleaned&fileid=322834

I suggest to replace the chapter files in the Published directory by
their cleaned versions without producing the full odt and pdf book.
Thus, the next version will start from the cleaned document.
If you agree, I will replace them.

I've created a simple extension, which highlights the character styles
used in the guides:
https://github.com/milossramek/translation-scripts/tree/master/odtclean
https://github.com/milossramek/translation-scripts/blob/master/odtclean/LOGuidesStyles.oxt

If highlighted, an author can see if styles are really used instead of
direct formatting - in that case additional manual cleaning would not be
necessary and it would be sufficient only to run the script. I suggest
then to produce the cleaned files after publishing the guide.

To summarize, I suggest to include two additional steps to the Producing
LO Guides document
- for authors: use the extension and use the character styles consistently
- for a specific person (me for now): to run the script after publishing
the guide and to replace the chapter files in the published directory

Milos

Attempting to install the oxt in LO 7.0.4.2 (x64) and 6.4.7.2 (x86) on
Win10 generates the following error:

(com.sun.star.lang.WrappedTargetRuntimeException) { { { Message = "Bad
Zip File, ZipException: Zip END signature not found!", Context =
(com.sun.star.uno.XInterface) @1d35768a930 (ImplementationName =
"com.sun.star.packages.comp.ZipPackage") } }, TargetException = (any) {
(com.sun.star.packages.zip.ZipIOException) { { { Message = "Bad Zip
File, ZipException: Zip END signature not found!", Context =
(com.sun.star.uno.XInterface) @1d35768a930 (ImplementationName =
"com.sun.star.packages.comp.ZipPackage") } } } } }

Strangely it installs in AOO 4.1.8 without any error.

Dave

Hi Milos

Thanks for the cleaner and the extension.

One small adjustment... It happens that LOGuidesStyles.oxt does not
check if the character style exist in the file. So before accessing one
of the Guide character style (highlight on/off), can we check if the
style exist in the document (may have been removed).

Kind regards

(1) https://extensions.libreoffice.org/en/extensions/show/875

Hi Dave,
thank you for testing.
The extension was created on Linux, so maybe the zip utilities are not
really compatible. But I've tried that also on Windows using LO 6.3 and
7.0 and it worked without problems. I do not know where can the problem be.

I've created the extension on Windows, too, please download it from
here. If it works for you, I'll replace that one on Github
https://www.sospreskoly.org/~milos/LOGuidesWin.oxt
Milos

Hi Milos,

This edition of the extension installs and seems to work OK in LO
7.0.4.2 (x64) and 6.4.7.2 (x86) on Win10.

Dave

Hi Dave,

meanwhile, I've fixed a bug (tests for nonexisting styles were added)
and zipped the extension on Windows. Please, get the copy from github (

https://github.com/milossramek/translation-scripts/blob/master/odtclean/LOGuidesStyles.oxt)
Milos

All,

As discussed at a recent Document Team meeting, I am working on an update to Chapter 13 of the 7.0 Calc Guide (Calc as a Database).

I have assumed that the best ODT file to start with is the cleaned version in the folder that Milos identified below (https://nextcloud.documentfoundation.org/apps/files/?dir=/Shared/SK%20community/Cleaned&fileid=322834).

Please advise if this assumption is incorrect!

Regards,

Steve

Hi Steve,

yes, please, use that file.

I would like to ask you (and anybody else) to help in testing of the
LoGuidesStyles.oxt extension and document cleaning.

The extension is available from
https://github.com/milossramek/translation-scripts/tree/master/odtclean
and it highlights character styles. I created it to be used in manual
style checking, but if used during editing it enables full control over
direct formatting/styles and thus makes additional checking not
necessary. But, maybe, all these colors are disturbing in editing – I
would like to know your opinion on that.

I have written here several times about using the script odtclean.py. It
is, however possible, that it is not necessary to use it at all, since
the Format/Clear Direct Formatting works good enough. I wrote the script
5 years ago because the Clear Direct Formatting command corrupted the
LOGuides documents (mostly lists). I've tested Clear Direct Formatting
on several documents now and it works without problems (I've noticed
just insignificant changes in paragraph spacing in some documents). It
cleans the document nearly as good as the script (does not clean image
captions and does not merge neighboring styles of the same type, but
these are not a problem).

Please, test it, too. One cannot run the command on the whole document
(CTRL-A) – it is necessary to use it in two steps: first on the text
before the table of contents and then on the rest after the table of
contents.

If these two steps work well, the extra cleaning step in the workflow
will not be necessary

thanks
Milos

Two questions:

1) What are the OS that this will work with?

2) Where are the directions on how to use it?

Dan

HI Milos

Hi Steve,

yes, please, use that file.

I would like to ask you (and anybody else) to help in testing of the
LoGuidesStyles.oxt extension and document cleaning.

The extension is available from
https://github.com/milossramek/translation-scripts/tree/master/odtclean
and it highlights character styles. I created it to be used in manual
style checking, but if used during editing it enables full control over
direct formatting/styles and thus makes additional checking not
necessary. But, maybe, all these colors are disturbing in editing – I
would like to know your opinion on that.

Recently I manually cleaned some translated files (before latest
odtclean.py) by changing the color font (instead of the font
background). My personal taste. Of course the font color must absolutely
contrast with normal font color, so for example, I used
Strong Enphasis -> Purple
Emphasis -> Orange
Keystroke -> Light blue
...
Code style has enough visual contrast to be touched

I have written here several times about using the script odtclean.py. It
is, however possible, that it is not necessary to use it at all, since
the Format/Clear Direct Formatting works good enough. I wrote the script
5 years ago because the Clear Direct Formatting command corrupted the
LOGuides documents (mostly lists). I've tested Clear Direct Formatting
on several documents now and it works without problems (I've noticed
just insignificant changes in paragraph spacing in some documents). It
cleans the document nearly as good as the script (does not clean image
captions and does not merge neighboring styles of the same type, but
these are not a problem).

Please, test it, too. One cannot run the command on the whole document
(CTRL-A) – it is necessary to use it in two steps: first on the text
before the table of contents and then on the rest after the table of
contents.

If these two steps work well, the extra cleaning step in the workflow
will not be necessary

On a side note, LibreOffice (ODF) can store the user interface tweaks
(menus, toolbars, shortcuts, other) in the document. That means we can
create a special user interface for Guide editing and formatting and
have it available when opening the chapter file. This UI can hide direct
formatting toolbar and replace by a custom toolbar where all templates
styles are available as buttons, just for a start...

Just my EUR 0,02....

Olivier

Hi Dan,

Two questions:

1) What are the OS that this will work with?

The procedure described below is OS independent (in this new version of
the "cleaning" procedure the odtclean.py script is not required, which
is a significant simplification)

2) Where are the directions on how to use it?

LoGuidesStyles.oxt is a simple extension and should be installed as any
other extension. Its usage is described on
https://github.com/milossramek/translation-scripts/tree/master/odtclean
in the last section:

The extension can be used to |Highlight Character Styles| and to |Reset
Character Styles|. These functions can be accessed either using a tool
bar |Add On 2| or in |Tools > Add-Ons|.

The rest is described below.

Milos