配置 HTML 4 文件类型

您可以配置 HTML 4 设置,以便自定义在翻译或审校期间处理这种文件类型的方式。

过程

  1. Decide for which projects you want to configure file type settings:
    • For the active project, go to the Projects view, and on the Home tab, select Project Settings.
    • For all future projects, go to File > Options.
  2. 展开文件类型列表,然后选择 HTML 4 筛选条件。
  3. Select theDetection page, to specify the settings which will match the content of the file with its file type:
    • If Process HTML fragments is enabled, SDL Trados Studio can open and process HTML documents with the HTML file type, even if the documents are missing the HTML root element. For example, you may have an *.htm file that only contains one HTML fragment: <H3> This is a Heading </H3>. SDL Trados Studio cannot normally open the file without the <html> </html> root element, even if the file has a recognized HTML extension. You can find what document extensions are associated with the HTML file type on the main page of the HTML file type, in the File dialog wildcard expression field.
    • If Process HTML fragments is not enabled, use any combination of the following XML items to identify a file type:
    UnderDo the following
    DOCTYPE declaration

    Type the element name.

    For example:

    <!DOCTYPE html>

    Root elements

    Select Add and enter the element name without the brackets.

    For example:
    <html> 
    <title>Hello world!</title> 
    </html>

    If SDL Trados Studio finds an <html> element in the selected file, it will process the file as an HTML document and apply the HTML extraction settings.

    Namespace Declaration

    Select Add and enter the URI (Uniform Resource Indicator) that identifies the namespace.

    For example:

    <html xmlns:xhtml="http://www.w3.org/xhtml/">

  4. Select the Parser page, and do one of the following:
  5. Select the Writer page, and then:
    1. Under Unicode UTF-8 byte order mark (BOM), choose when the SDL file support software should insert a UTF-8 BOM in the target file:
      • Preserve: don't add if not originally present
      • Preserve: add if not originally present
      • Remove if present
    2. Under xml:lang attribute values:
      • Select Change matching source language to target language, if you want to change xml:lang="en-US" in the source file to xml:lang="fr-FR" in the target file.
      • Select Always change to target language, if you want to change xml:lang="..." in the source file to xml:lang="fr-FR" in the target file.
      • Select Do not change, if you want to keep the xml:lang attribute values unchanged.
    3. Under <META charset> tags, specify what <META charset> tag to insert in the target if any:
    • Change charset value: add <META> tag if not present
    • Change charset value only if <META> tag is present
    • Do not change charset value
  6. Select the Entities page, and then select Enable entity conversion to specify whether SDL Trados Studio displays an XML Entity as an entity reference (&gt;) or as a character (>).
  7. Under Entity conversion, select the checkboxes corresponding to the XML entities for which you want conversion to apply.
    1. Select the checkboxes corresponding to the XML entity sets for which you want conversion to apply. Entities can be of the Default (the entities are the standard entity mappings from W3C) or of the Custom type (the entity set was changed).
    2. Select Advanced, and in the Advanced XML Entity Settings dialog, specify when characters are converted between entity representation and character representation.
  8. Under Entity mappings, consult the entities in the entity set selected under Entity conversion, and, if necessary, you can add, edit or remove entity mappings.
  9. Select the Whitespace page, to specify how SDL Trados Studio deals with whitespace characters (spaces, non-breaking spaces, tabs, line breaks) in the elements of an XML file.
    1. Under Whitespace in content, choose one of the options:
      • Select Always preserve, so that SDL Trados Studio does not replace any whitespace found in the XML element with a single space.
      • Select Normalize unless xml:space='preserve', so that SDL Trados Studio replaces only the whitespace which is not tagged with the attribute xml:space='preserve'.
      • Select Always normalize, so that SDL Trados Studio replaces any whitespace found in the XML element with a single space, ignoring any xml:space='preserve' attribute.
    2. Under Whitespace in tags, select Always normalizeso that SDL Trados Studio replaces any whitespace found in the XML element with a single space.
  10. Select the Preview page, to add the resource files which enable SDL Trados Studio to preview your HTML files correctly. Select Add to include reference files (CSS, JavaScript or image files).
  11. Select the Embedded content page. If you do not enable embedded content processing, SDL Trados Studio ignores the content embedded in an HTML file.
  12. Select the Enable <script> element processing checkbox, to process embedded client-side scripts inside HTML files.
  13. Choose an embedded content processor from the list. You can add custom embedded content processors to expand the list of available options.
  14. Go to the Parser page of the HTML file type and make sure the <script> tag is set as Translatable and it has the Structure tag type set.
  15. Select the Enable embedded server side scripts processing checkbox, to process embedded server-side scripts inside HTML files.
  16. Choose an embedded content processor from the list. You can add custom embedded content processors to expand the list of available options.
  17. Select the QuickInsert page.
  18. Specify QuickInsert settings to insert tags and formatting, or to insert text and special characters.
  19. 选择确定