Skip to main content
MindTouch Success Center

How to Mark Content as Do Not Translate

Not all content should be translated. Use this technique to mark the content you do not want translated when using translation services or instant translation functionality.

Prerequisites

Create a Custom Editor Style

Follow these instructions to create a new custom editor style you can use to identify content that should not be translated.

  1. Navigate to Site tools > Control panel > System Settings > Editor
  2. In the Set editor configuration field add the following sample code
    1. config.stylesSet.push ({ name: 'Do Not Translate', element: 'span', attributes: { 'class': 'mt-dnt', 'title': 'Do Not Translate', 'translate': 'no'}});
      
    2. Note: If you don't have existing editor styles, use the following sample code instead
      1. CKEDITOR.editorConfig = function( config ) {
            config.stylesSet.push ({ name: 'Do Not Translate', element: 'span', attributes: { 'class': 'mt-dnt', 'title': 'Do Not Translate', 'translate': 'no'}});
        };
        
    3. Click Save to add the custom styles to the editor configuration

Create Custom CSS for Editor Style

Once you have created a custom Editor style, you will need to add CSS so it is visible to users who will work with translated content.

  1. Navigate to Site tools > Control Panel > Branding > Custom Site CSS
  2. Since you only want your Pro Members and Admins to see this style, you will need to paste the following CSS in the Pro Member CSS and Admin CSS fields
    1. .mt-dnt {
          background: #f2cdcd;
          border: 2px dotted #eea4a4;
          padding: 0 0 0 .2em;
      }
      

View Custom Editor Style

When you have finished setting up the custom Editor style and CSS, you can access the custom style in your Editor toolbar.

clipboard_e57159a1ac7c5cb4420584c54e9e76ce2.png

Here is an example of what the Do Not Translate style will look like in the Editor. 

clipboard_e4f4f1c924aeafeefbacafa0e02d1658e.png

Here is an example of what the generated HTML will look like. The class and title attributes are unique identifiers for your translation service to use. The translate attribute is used for MindTouch Instant Translation functionality.

<span class="mt-dnt" title="Do Not Translate" translate="no">Product Name that shouldn't be translated</span>
  • Was this article helpful?