Help Center Advanced
Skip HTML From Being Translated Or Discovered
Skip HTML From Being Translated Or Discovered
Last updated: 6 months ago
2 minute read
Steven Wise
CEO at SiteTran

ALL ARTICLES

Ignore/Exclude Certain Phrases from Being Translated or Discovered

You may need to stop or skip some phrases or HTML elements containing content from being translated or discovered, for example your user's names, addresses, or any other Personally Identifiable Information.

SiteTran provides you with two methods for accomplishing this.

1. Inline HTML:

SiteTran automatically ignores elements that have the class notranslate, or the attribute translate="no".

Add either the class "notranslate", or the attribute translate="no" to any element stop SiteTran from translating content that's present within in it.

If your ignored element contains phrases nested within it that you do want translated, you can add the translate="yes" attribute to the element(s) you want translated.

The notranslate class and translate="no" attribute also work to block elements from getting translated by Google Translate which is great because often users will use Google Translate if your website isn’t translated to their preferred language with SiteTran, this will also enhance their experience.

2. JavaScript:

You can define selectors that the SiteTran widget will not change languages on.

You do so by adding the sitetran.ignore_selectors array to your SiteTran widget object on each page that contains content that you want ignore.

List all the elements you want to ignore using selectors such as class, ID or attribute…

sitetran.ignore_selectors = [ ".some-selectors", "#another-one-that-you-ignore" ];
Couldn't find what you were looking for?

In this article

Website Translation Made Easy