#927 Option to add translatable tags to HTML Filter 2.

3.0
open
nobody
None
5
2013-12-04
2013-11-24
Guido Leenders
No

Many file formats have a strong resemblance with HTML, but add some extra processing tags. For instance ascx or Invantive Server Pages. They may contain translatable elements too and are sometimes fit for automatic translation.

We have a DotNetNuke website with forms in ascx and I would like them translated. However, the input fields are formatted in the HTML as:

<div class="dnnFormItem">
<dnn:label runat="server" Text="Email" HelpText="Please enter your email address in the space provided" Suffix=":" />
<asp:textbox id="Email" runat="server" CssClass="dnnFormRequired" />
<asp:RequiredFieldValidator ID="Email_req" ControlToValidate="Email" cssclass="dnnFormMessage dnnFormError" runat="server" Text="Email Address is required" />
</div>

The Text and HelpText tag can not be translated without manual intervention using the HTML2 filter. For now, I've added in FilterVisitor.java:

        // Translate attributes of tags if they are not null.
        // START OF HACK
        maybeTranslateAttribute(tag, "Text");
        maybeTranslateAttribute(tag, "HelpText");
        // END OF HACK
        maybeTranslateAttribute(tag, "abbr");
        maybeTranslateAttribute(tag, "alt");

But I think OmegaT would be more versatile when this could be configured similar to checkIgnoreTags but then the other way around.

Discussion

  • Didier Briel
    Didier Briel
    2013-12-04

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -2,11 +2,11 @@
    
     We have a DotNetNuke website with forms in ascx and I would like them translated. However, the input fields are formatted in the HTML as:
    
    -<div class="dnnFormItem">
    -<dnn:label runat="server" Text="Email" HelpText="Please enter your email address in the space provided" Suffix=":" />
    -<asp:textbox id="Email" runat="server" CssClass="dnnFormRequired" />
    -<asp:RequiredFieldValidator ID="Email_req" ControlToValidate="Email" cssclass="dnnFormMessage dnnFormError" runat="server" Text="Email Address is required" />
    -</div>
    +&lt;div class="dnnFormItem"&gt;
    +&lt;dnn:label runat="server" Text="Email" HelpText="Please enter your email address in the space provided" Suffix=":" /&gt;
    +&lt;asp:textbox id="Email" runat="server" CssClass="dnnFormRequired" /&gt;
    +&lt;asp:RequiredFieldValidator ID="Email_req" ControlToValidate="Email" cssclass="dnnFormMessage dnnFormError" runat="server" Text="Email Address is required" /&gt;
    +&lt;/div&gt;
    
     The Text and HelpText tag can not be translated without manual intervention using the HTML2 filter. For now, I've added in FilterVisitor.java: