Options
Full list of configuration options
Website Translator determines target language automatically if the webpage uses lang parameter in URL query.
Website Translator supports ISO 639-1 language codes with optional ISO 3166-1 alpha-2 country codes. If language is not found with specified country code, then Website Translator checks if language without country code is available.
WebsiteTranslator.Options.currentLanguage
Type:
StringDefault:
nullCurrent web page language (if the web page is already pre-translated). The language in which the website has been translated. When currentLanguage is not equal to source language, selecting language to translate, Website Translator will try to get page in language by calling translation.onLanguageSelected(
language)
WebsiteTranslator.Options.debug
Type:
BooleanDefault:
falseEnable verbose logging in console
Translation API options
WebsiteTranslator.Options.api.clientId
Type:
StringDefault:
nullAuthorization key which allows Website Translator to access translation API Required
WebsiteTranslator.Options.api.services.Translation
Type:
StringDefault: NLTP platform
Translation service Uri
WebsiteTranslator.Options.api.services.Authentication
Type:
StringDefault:
xxxxxxxxxAuthentication service Uri
Translation options
WebsiteTranslator.Options.translation.autoTranslate
Type:
BooleanDefault:
trueSave last translation
target languageand on next page load, automatically translate to it.if browser url contains
langparameter in url, Website Translator will use it for translation. Otherwise iflangparameter is not available, saved language will be used.
WebsiteTranslator.Options.translation.translateOnlyAllowedTags
Type:
BooleanDefault:
falseTranslate only tags and their children which have
translate="yes"attribute
WebsiteTranslator.Options.translation.translateAttributes
Type:
BooleanDefault:
trueTranslate HTML attributes
WebsiteTranslator.Options.translation.onLanguageSelected
Type:
FunctionDefault:
() => Promise.resolve(false)Custom actions on selecting languages. This function if implemented should return
Boolean->truewhen Language must be Translated with Website Translator,falseotherwise
WebsiteTranslator.Options.translation.thirdPartyTranslationLanguages
Type:
Array<string>Default:
[]Define languages which are supposed to be translated with third party
UI options
WebsiteTranslator.Options.ui.headless
Type:
BooleanDefault:
falseHide MT toolbar with translation progress.
WebsiteTranslator.Options.ui.tooltipShowDelay
Type:
NumberDefault:
500How much time to wait after user is started to hover translation to show suggestion popup (in ms)
WebsiteTranslator.Options.ui.toolbarPosition
Type:
StringDefault:
bottomWhere toolbar is positioned. Values can be:
- "top" - Show translation toolbar at the top of the page
- "bottom" - Show translation toolbar at the bottom of the page
WebsiteTranslator.Options.ui.mainContentElement
Type:
HTMLElementDefault:
nullMain container
HTMLElementfor web page that contains all scrollable content
WebsiteTranslator.Options.ui.showPopup
Type:
BooleanDefault:
trueShow or hide translation popup Also when disabled, highlight for translated sentences won't be visible.
WebsiteTranslator.Options.ui.showLanguagesInNativeLanguage
Type:
BooleanDefault:
falseShow languages in native language for example in Language Menu
WebsiteTranslator.Options.ui.translate
Type:
StringDefault:
sourceTranslate UI, values can be:
- source - Show UI in source language
- target - Show UI in target language
WebsiteTranslator.Options.ui.showTranslationControls
Type:
BooleanDefault:
trueShow or hide "restore" and "cancel" translation buttons on UI
WebsiteTranslator.Options.ui.layout
Type:
StringDefault:
menuChange display mode of the language selection in UI, values can be:
- "menu" - Show available languages in select
- "list" - Show available languages as list items
- null - Hide language menu