type="notice" attribute for note and hazardstatement elements

steinbacherGE
Posts: 26
Joined: Tue Mar 13, 2018 6:07 pm

type="notice" attribute for note and hazardstatement elements

Post by steinbacherGE » Fri Feb 07, 2020 12:56 am

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 395 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 395 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

radu_pisoi
Posts: 375
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

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

Post by radu_pisoi » Tue Feb 11, 2020 2:40 pm

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.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

steinbacherGE
Posts: 26
Joined: Tue Mar 13, 2018 6:07 pm

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

Post by steinbacherGE » Fri Feb 14, 2020 7:32 pm

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)
Attachments
Notice-Sting-de.png
Notice-Sting-de.png (21.72 KiB) Viewed 312 times
Notice-Sting-de.png
Notice-Sting-de.png (21.72 KiB) Viewed 312 times

radu_pisoi
Posts: 375
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

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

Post by radu_pisoi » Mon Feb 17, 2020 2:58 pm

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
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

steinbacherGE
Posts: 26
Joined: Tue Mar 13, 2018 6:07 pm

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

Post by steinbacherGE » Mon Feb 17, 2020 6:55 pm

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

Post Reply