tdf#152323 drop name attribute from <link> elements

Replacement done with

find . -name \*.xhp -print0 |xargs -0 -P 0 perl -CS -pi -e \
        's#(<link[^>]*?) +name *="[^"]*" *( [^>]+|) *>#$1$2>#g'

(note some inconsistencies with space between name and = and also having
empty value, and some more complicated expression to also clear up
double space before/after the attribute)

translation files will be prepped with:

find */helpcontent2 -name \*.po -print0 |xargs -0 -P 0 perl -CS -pi -e \
    $'s#(<link[^>]*?) +name=(?:\\\\"[^"]*\\\\"|\'[^\']*\') *( [^>]+|) *(/?>)#$1$2$3#g unless /^#/'

(note that not all languages use the " as quote character for the
attributes, but that also single quotes appera in the po file. Hence
the use of the shell $'string' syntax to be able to quote ' as \'
It also requires to quote the backslash, so that it needs to be escaped
once for the shell, then another time for perl. Also don't work on
obsolete strings (those are prefixed with #~ in the po files)
Also note that <link..></link> gets turned into <link ../> during
translation extraction (along with removal of the space between the
attribute name and the value), so the pattern needs to be slightly
different here)

Change-Id: I95e53a08e6b0095cd894109ea0de154cc4859d8f
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/143713
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
This commit is contained in:
Ilmari Lauhakangas
2022-12-06 14:05:20 +02:00
committed by Christian Lohmaier
parent 490d42493e
commit 7e42394ecb
2085 changed files with 4560 additions and 4560 deletions

View File

@ -26,7 +26,7 @@
<bookmark_value>API;lang.EventObject: Monitoring Document Event</bookmark_value>
</bookmark>
<section id="pythonmonitor1">
<h1 id="N0527"><variable id="pythonmonitor"><link href="text/sbasic/python/python_document_events.xhp" name="Monitoring Document Events">Listening to Document Events</link></variable></h1>
<h1 id="N0527"><variable id="pythonmonitor"><link href="text/sbasic/python/python_document_events.xhp">Listening to Document Events</link></variable></h1>
<paragraph role="paragraph" id="par_id641630582314861">Listening to document events can help in the following situations:</paragraph>
<list type="unordered">
<listitem>
@ -42,7 +42,7 @@
<paragraph id="par_id601630582398998" role="listitem">Import math Python packages before opening a Calc document. Release these packages when the document closes.</paragraph>
</listitem>
</list>
<paragraph role="paragraph" id="N0528">Next to <link href="text/sbasic/shared/01040000.xhp" name ="assigning macros to events">assigning macros to events</link>, one can monitor events raised by %PRODUCTNAME documents. Application Programming Interface (API) broadcasters are responsible for calling event scripts. Unlike listeners that require to define all supported methods, even if unused, document monitors require only two methods next to hooked event scripts.</paragraph>
<paragraph role="paragraph" id="N0528">Next to <link href="text/sbasic/shared/01040000.xhp">assigning macros to events</link>, one can monitor events raised by %PRODUCTNAME documents. Application Programming Interface (API) broadcasters are responsible for calling event scripts. Unlike listeners that require to define all supported methods, even if unused, document monitors require only two methods next to hooked event scripts.</paragraph>
</section>
<h2 id="N0529">Monitoring Document Events</h2>
<paragraph role="paragraph" id="N0530">Monitoring is illustrated herewith for Basic and Python languages using object-oriented programming. Assigning <literal>OnLoad</literal> script, to the <menuitem>Open Document</menuitem> event, suffices to initiate and terminate document event monitoring. <menuitem>Tools - Customize</menuitem> menu <menuitem>Events</menuitem> tab is used to assign either scripts.</paragraph>
@ -163,7 +163,7 @@
<paragraph role="pycode" localize="false" id="N0646"> return xScript</paragraph>
</pycode>
<warning id="N0647">Mind the misspelled <literal>documentEventOccured</literal> method that inherits a typo from %PRODUCTNAME Application Programming Interface (API).</warning>
<paragraph role="tip" id="N0648"><menuitem>Start application</menuitem> and <menuitem>Close application</menuitem> events can respectively be used to set and to unset Python path for user scripts or %PRODUCTNAME scripts. In a similar fashion, document based Python libraries or modules can be loaded and released using <menuitem>Open document</menuitem> and <menuitem>Document closed</menuitem> events. Refer to <link href="text/sbasic/python/python_import.xhp" name ="Importing Python Modules">Importing Python Modules</link> for more information.</paragraph>
<paragraph role="tip" id="N0648"><menuitem>Start application</menuitem> and <menuitem>Close application</menuitem> events can respectively be used to set and to unset Python path for user scripts or %PRODUCTNAME scripts. In a similar fashion, document based Python libraries or modules can be loaded and released using <menuitem>Open document</menuitem> and <menuitem>Document closed</menuitem> events. Refer to <link href="text/sbasic/python/python_import.xhp">Importing Python Modules</link> for more information.</paragraph>
<h3 id="N0649">With %PRODUCTNAME Basic</h3>
<bookmark xml-lang="en-US" branch="index" id="bm_id591622446367707">
<bookmark_value>API;GlobalScope.BasicLibraries</bookmark_value>
@ -269,7 +269,7 @@
<paragraph role="pycode" localize="false" id="N0745"> </paragraph>
<paragraph role="pycode" localize="false" id="N0746">g_exportedScripts = (displayAvailableEvents,)</paragraph>
</pycode>
<note id="N0747">The <link href="https://extensions.libreoffice.org/extensions/apso-alternative-script-organizer-for-python" name ="Alternative Python Script Organizer">Alternative Python Script Organizer (APSO)</link> extension is used to render events information on screen.</note>
<note id="N0747">The <link href="https://extensions.libreoffice.org/extensions/apso-alternative-script-organizer-for-python">Alternative Python Script Organizer (APSO)</link> extension is used to render events information on screen.</note>
<h3 id="N0748">With %PRODUCTNAME Basic</h3>
<bascode>
<paragraph role="bascode" localize="false" id="N0749">Sub DisplayAvailableEvents</paragraph>