We've launched a new support center at help.smartling.com. This site will continue to be maintained into January 2017. Please update your bookmarks.
Follow

How to Exclude Content from Translation

The following article applies to Global Delivery Network project types. 

To exclude content from a locale:

  • Add the HTML class name "notranslate" around the content that you want excluded.

Content inside a “notranslate” element, including nested elements, appears unchanged from the source (original language).

For example, suppose your site sells music, and you have a standard album page template that shows an album overview. Your original HTML might look like this:

<div id=”artist_name”>

          The Rolling Stones

     </div>

You probably don’t want to translate the name “The Rolling Stones.” Simply insert a specific class of “notranslate,” and Smartling will ignore the content within the div class:

     <div id=”artist_name” class=”notranslate”>

          The Rolling Stones

     </div>

Any elements nested inside an element with the exclusion class will also be ignored. Thus, in the following example:

 <div class=”notranslate”>

                                         <div id=”artist_name”>

                                              The Rolling Stones

                                         </div>

                                         <div id=”album_name”>

                                              Beggars Banquet

                                         </div>

                                    </div>

Smartling will ignore both the artist name and the album name, because they fall within an excluded div tag.

If your HTML already has a class name associated with an element you wish to exclude; for example:

    <div class=”someclass”>

          Some content to exclude

     </div>

Add the exclusion tag to the same element, next to the original class(es), separated by a space; for example:

     <div class=”someclass notranslate”>

          Some content to exclude

      </div>

There is no concept of nesting translation or exclusion elements inside of an exclusion element. You also cannot use the “class” attribute with the following tags: base, head, html, meta, param, script, and style as adding these classes will produce invalid HTML that Smartling ignores.

Smartling supports the HTML5 "translate" attribute, so you can also exclude content tagged with the attribute translate="no".

To exclude title or alt tags from a locale:

  • Add the HTML class name "notranslate_alt" or "notranslate_title" around the content that you want excluded. For the following example,

    <a href="http://www.google.com" class="notranslate_title" title="Google Search">This link will go to Google</a>

    Smartling will not ingest the terms "Google Search" for translation.
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request
Powered by Zendesk