Configuration options

Parameter Name

Script Tag Data Attribute Name

URL Query Parameter Name

Default Value

Required

Available Options

Description

Token

data-token

mwActiveToken

null

yes

This is the token given to you by MotaWord.

Project ID

data-project-id

mwActiveProjectId

null

yes

This is the project ID given to you by MotaWord.

Current Language

data-current-language

mwActiveCurrentLanguage

null

no

any language code that your website project supports

You can tell us the current locale language that the user should view. Usually given from backend systems.

Render Widget

data-render-widget

mwActiveRenderWidget

true

no

"false", "no", "0", true", "yes", "1"

Tell Active JS to render a widget. You can also use Active programmatically without rendering a language selection widget.

Widget Element

data-widget-element

mwActiveWidgetElement

#mw-active

no

DOM selector to render the widget inside or "", "NULL"

Given a widget element, we'll render the widget inside this element. If not, we will create and use our default floating widget element.

Theme

data-theme

mwActiveTheme

light

no

light, dark

Specify which theme you would like to use with our widget.

Position

data-position

mwActivePosition

bottom-left

no

bottom-left, bottom-right, in-place, "", "NULL"

Specify where to render the widget. Giving "" empty string or "NULL" string will render the widget inline without the dropdown.

Follow User

data-follow-user

mwActiveFollowUser

true

no

"false", "no", "0", true", "yes", "1"

Specify whether we should follow the user around in your website and automatically translate pages.

Use Dummy Translations

data-use-dummy-translations

mwActiveUseDummyTranslations

false

no

"false", "no", "0", true", "yes", "1"

When enabled, we will simply prefix all translatable content with Translated ({languageCode}) -

Use Dynamic Translations

data-use-dynamic-translations

mwActiveUseDynamicTranslations

true

no

"false", "no", "0", true", "yes", "1"

When enabled, we will use Intersection and Mutation observers to translate the page. Otherwise, we will simply parse the whole DOM and translate only once.

Locale Change Mode

data-change-mode

mwActiveChangeMode

history

no

history, redirect, NULL

When a user changes locale (or when we automatically detect and change it for them), we will change the URL of the page they are in. We can do this by actually redirecting the user to the new page, or by simply changing the URL in the address bar via browser's History API. When NULL, we won't apply any URL changes.

Locale URL Mode

data-url-mode

mwActiveUrlMode

path

no

path, query, NULL

When a user changes locale (or when we automatically detect and change it for them), we will change the URL of the page they are in. We can either change the path of the URL to prefix it with the locale code, or we can add a query parameter to the URL. We also use this mode to detect the locale for the current page when a user directly loads a page. When NULL, locale detection from URL will be disabled (even then, if the user has selected a locale manually, and followUser is enabled, we will still automatically translate the page in user's locale.

Modify Links

data-modify-links

mwActiveModifyLinks

true

no

"false", "no", "0", true", "yes", "1"

We can automatically localize the same-domain URLs in your page. The way we localize the URL depends on urlMode configuration. We can either add/update the locale query parameter, or add/update the path of the URL.

Query Parameter Name

data-query-name

mwActiveQueryName

locale

no

any string value

When urlMode is query, we will use this query parameter name in the URL, to detect the requested locale to update the URL when user changes locale to modify the links on page when modifyLinks is enabled.

Wait For DOM

data-wait-for-dom

mwActiveWaitForDom

mixed

no

"false", "no", "0", true", "yes", "1"

Should we wait until the DOM is ready to translate the content? When you put ActiveJS script inside <head> tag, we will automatically make this true unless you explicitly specify otherwise. When ActiveJS script is used within <body>, this is false by default.