Configure Translation Behavior for Webpages
This article is for Account Owners and Project Managers.
By default, Smartling automatically translates all content and rewrites URL's (i.e. www.mysite.com becomes es.mysite.com). However, it is likely you do not want this to occur for certain elements of your site. The following allows you to control these settings for your site. Smartling captures all pages from a site proxied by the Global Delivery Network. In some cases, there may be specific elements or sections of your site you don't want to translate.
You can control the translation behaviour of your site at two levels from within the Smartling Dashboard using Translation Rules:
- Website page level
- HTML element level
- Class Names
To Create a Translation Rule
- From within your Global Delivery Network project, click on Global Delivery Network > Configuration > Rules
- Click Add a New Rule
- Enter your rule parameter
- URL rules: Enter full URL path of the page to apply the rule. NOTE: Rules will execute on partial matches. For example, if you enter rule text "/products", your rule will apply to any page that contains /products in its' URL.
- HTML Class or ID rules: Enter an HTML class or ID to apply the rule against. NOTE: If the HTML class or ID is not unique, your rule will be applied to every instance of the HTML element on your site.
- Select your rule type from the dropdown
- Click Save to create your rule or Cancel to start over
- Requests that Match URLs - Any URL matching the URL regular expression entered will have the selected features applied.
- HTML Elements with Class Names - Any CSS class matching the class name you enter will have the selected features applied.
- HTML Elements with IDs - Any HTML element matching the id value you enter will have the selected features applied.
- Do Not Translate: Content will not be captured, translations will not be served, links will be rewritten.
- Do Not Localize URLs: links will not be rewritten, content will be captured and translations will be served.
- Do Not Translate or Localize URLs: Content will not be captured, translations will not be served, links will not be rewritten.
- Do Not Capture Content: Content will not continue to be captured after enabling this rule. Any existing translations for a page will continue to be served.
- Remove Content from Page: Only applicable to HTML Class or ID rules. The element will be hidden from the localized page.
Translation Rules apply across all domains in a given Global Delivery Network project. If you need to configure translation behaviour for individual domains, or need more advanced control over translation behaviour, consult our Global Delivery Network developer guide.