Configuration des types de fichiers HTML 5
Vous pouvez configurer les paramètres HTML 5 de façon à personnaliser le mode de traitement de ce type de fichier pendant la traduction ou la relecture.
Procédure
- 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.
- Développez la liste Types de fichiers et sélectionnez le filtre HTML 5.
- 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
*.htmfile 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:
Under Do 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/">
- 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
- Select the Parser page, and do one of the following:
- Enable or disable existing parser rules.
- Add parser rules.
- Import parser rules.
- Edit parser rules.
- Remove parser rules.
- Define structure information properties.
- Select the Writer page, and then:
- 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
- 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 toxml:lang="fr-FR"in the target file. - Select Always change to target language, if you want to change
xml:lang="..."in the source file toxml:lang="fr-FR"in the target file. - Select Do not change, if you want to keep the
xml:langattribute values unchanged.
Remarque : SDL Trados Studio does not support generic language tags for the xml:lang attribute. You need to specify the language and the country subtag (for example, fr-FR). - Select Change matching source language to target language, if you want to change
- 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
- 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:
- Select the Entities page, and then select Enable entity conversion to specify whether SDL Trados Studio displays an XML Entity as an entity reference (
>) or as a character (>). - Under Entity conversion, select the checkboxes corresponding to the XML entities for which you want conversion to apply.
- 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).
- Select Advanced, and in the Advanced XML Entity Settings dialog, specify when characters are converted between entity representation and character representation.
- 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.
- 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.
- 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.
- Under Whitespace in tags, select Always normalizeso that SDL Trados Studio replaces any whitespace found in the XML element with a single space.
- Under Whitespace in content, choose one of the options:
- 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).
- Select the Embedded content page. If you do not enable embedded content processing, SDL Trados Studio ignores the content embedded in an HTML file.
- Select the Enable <script> element processing checkbox, to process embedded client-side scripts inside HTML files.
Conseil : Client-side scripts are embedded into the HTML file served to the client (e.g. a web browser) by the server, usually enclosed inside a
<script>tag. Client-side scripts remain in the HTML source and may be executed by the client itself. - Choose an embedded content processor from the list. You can add custom embedded content processors to expand the list of available options.
- 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. - Select the Enable embedded server side scripts processing checkbox, to process embedded server-side scripts inside HTML files.
Conseil : Server-side scripts are pre-processed by the server before sending the final HTML page to the client (e.g. a web browser). Once served through the Web to the client, server-side scripts will no longer exist in the HTML source, but instead replaced by their computed result.
- Choose an embedded content processor from the list. You can add custom embedded content processors to expand the list of available options.
- Select the QuickInsert page.
- Specify QuickInsert settings to insert tags and formatting, or to insert text and special characters.
- Cliquez sur OK.