Page 1 of 1

type="notice" attribute for note and hazardstatement elements

Posted: Fri Feb 07, 2020 12:56 am
by steinbacherGE
I'm getting unexpected results when publishing the type="notice" attribute for both note and hazardstatement elements.

Publishing to Webhelp Responsive (dita-ot 3.3.1 - WHR 21).

xml:lang="en"

note type="notice"
hazardstatement type="notice"
typeNotice.png
typeNotice.png (8.41 KiB) Viewed 2096 times
Why is gentext for type="notice" still "note"?

xml:lang="de"

note type="notice"
hazardstatement type="notice"
typeNotice-de.png
typeNotice-de.png (8.25 KiB) Viewed 2096 times
Maybe German is not best example because note and notice are both tranlsated into hinweis, but why is the gentext missing for hazardstatement type="notice"?

Thanks,

Leroy

Re: type="notice" attribute for note and hazardstatement elements

Posted: Tue Feb 11, 2020 2:40 pm
by radu_pisoi
Hi,

Thank you for reporting this issue.

There are two cases here for note and hazardstatement elements with @type= notice attribute.

Please note that both issues are related with DITA-OT HTML5 plugin that WebHelp plugin extends.

1. For note element, there is no implementation difference for @type= note and @type= notice, the generated text is the same.
If you want to fix this issue, you can use the dita.xsl.html5 XSLT extension point to override the following XSLT template:

Code: Select all

<xsl:template match="*[contains(@class, ' topic/note ')]" name="topic.note">
XSLT file:

Code: Select all

{$DITA-OT-DIR}/plugins/org.dita.html5/xsl/topic.xsl
2. For hazardstatement element you can override the generated text by modifying the translation files. Please read the Modifying the Existing Strings procedure from our user guide.

Re: type="notice" attribute for note and hazardstatement elements

Posted: Fri Feb 14, 2020 7:32 pm
by steinbacherGE
Thanks for the response. I was able to fix the issue for English output. However, the translated string for "Notice" is still not coming through.

I created a localization plugin and added the string to strings-de-de.xml. I also modified (Dude!) a few others to make sure this file is being used.

Image (Trying to add screenshots but it is not letting me add any more attachments.)

The generated text shows up in Oxygen Editor, but the translation for "Notice" is missing in my German output.

Image (Not sure where my screenshot attachments went)

Re: type="notice" attribute for note and hazardstatement elements

Posted: Mon Feb 17, 2020 2:58 pm
by radu_pisoi
Hi,

As I told you in the previous email, I think it is necessary to implement an XSLT extension point to change the generated text for a note element with @type='notice'.

Code: Select all

<note type="notice">This is a note with @type='notice'</note>
If you want to fix this issue, you can use the dita.xsl.html5 XSLT extension point to override the following XSLT template:

Code: Select all

<xsl:template match="*[contains(@class, ' topic/note ')]" name="topic.note">
XSLT file:

Code: Select all

{$DITA-OT-DIR}/plugins/org.dita.html5/xsl/topic.xsl

Re: type="notice" attribute for note and hazardstatement elements

Posted: Mon Feb 17, 2020 6:55 pm
by steinbacherGE
Thanks Radu. I was able to get the type="notice" translation string to work. I had to rename it notice-GE and add a special conditional statement to specifically pull in that variable. I can share the code if anyone else has the same issue.

Thanks,

Leroy

Re: type="notice" attribute for note and hazardstatement elements

Posted: Wed Feb 24, 2021 6:27 am
by sudarshan_gr
Could you please share the code to change the type="notice" attribute for note and hazard statement elements for webhelp output.

Thanks and regards,
Sudarshan