Website Translation
Ihre Website in über 100 Sprachen. Ohne Umbau.
So binden Sie Website Translation ein und steuern es per JavaScript. Die Dokumentation ist auf Englisch.
Version v3 / Last updated: 08.10.2026
Welcome to the manual for Website Translation v3.
On this page you will find answers to common questions and everything you need in order to get Website Translation up and running on your or your client's website.
The list of currently available languages and its languagecodes ('en', 'fr', 'de', ...) can be found here: https://conword.io/sprachen/
The frontend of Website Translation is written in plain javascript, so it does not rely on any frameworks. While it is not dependent on third party code, it works well with jquery and other commonly used tools.
Website Translation offers real-time translations without storing any data on the client's server. This makes Website Translation independent of the underlying CMS.
Summarised: Website Translation works with every CMS on every server.
To run Website Translation, you need to include the basic javascript setup, as given in the next section. When the basic javascript is loaded, several functions and objects will be available.
Website Translation works on your website with this single line of code:
<script id="conword-root" charset="utf-8" src="https://static.conword.io/js/v2/[license-id]/conword.js"></script>Note: You must have a valid licence for your domain in order to use Website Translation. If your domain is not whitelisted, Website Translation will not work on your website.
If you want to configure the Conword setup, there is a javascript object "conword_config" you can use, to pass your settings to the conword instance.
<script>
var conword_config={
disable_rtl_attribute:false,
disable_language_switcher:false,
ai_notification:false,
skip_classes:[]
};
</script>
<script id="conword-root" charset="utf-8" src="https://static.conword.io/js/v2/[license-id]/conword.js"></script>Description: Disables the rtl attribute in the <html> tag, if a language with rtl feature is used (e.g. Arabic). Conword automatically sets <html dir="rtl"> unless this option is set to true.
Default value: false
Possible values: true, false
Description: If you install conword, a dropdown to switch the language will appear in the bottom left corner. Setting disable_language_switcher to true, will get rid of the dropdown.
Default value: false
Possible values: true, false
Description: Informs your visitors that the translated content has been generated by AI (available since Conword 3.3). The notification is shown upon the first translation and only once per browser (Conword remembers this in the local storage).
The notification text is inserted in the source language of your site (German or English, other source languages get the English text) right before the translation starts, so it is translated by Conword into the chosen language together with the rest of the page. It mentions the original language of your site. See AI Notification.
Default value: false
Possible values: false, "top", "modal"
Description: Additional html classes that exclude an element and all its children from the translation, exactly like the built-in class "cnw_skip_translation" (see Excluding Content). Useful if your CMS already marks such content with its own class, e.g. "no-translate" or "legal-text". Pass a single class as a string, several classes as an array, or a space separated string.
Default value: []
Possible values: "my-class", ["class-a", "class-b"], "class-a class-b"
Note: You can use Conword without the config object.
<script>
var conword_config={
disable_language_switcher:true
};
</script>
<script id="conword-root" charset="utf-8" src="https://static.conword.io/js/v2/[license-id]/conword.js"></script>Some websites are required to inform their visitors, that the content they are reading has been generated by AI. With the ai_notification option, Conword shows such a notification automatically, when the page gets translated for the first time.
The notification is shown once per browser (Conword remembers this in the local storage). The text is inserted in the source language of your site (German or English, other source languages get the English text) right before the translation starts, so it is translated together with the rest of the page. It mentions the original language of your site.
The visitor can close the bar with the "✕":
<script>
var conword_config={
ai_notification:"top"
};
</script>
<script id="conword-root" charset="utf-8" src="https://static.conword.io/js/v2/[license-id]/conword.js"></script>The dialog has to be confirmed by the visitor:
<script>
var conword_config={
ai_notification:"modal"
};
</script>
<script id="conword-root" charset="utf-8" src="https://static.conword.io/js/v2/[license-id]/conword.js"></script>If you want to show the notification again (e.g. on a "more information" link), use Conword.show_ai_notification(). The event "Conword:ai_notification_shown" is fired whenever the notification is shown.
The notification bar has the id "cnw_ai_notification", the modal dialog the id "cnw-ai-dialog". Both carry the class "cnw_ai_notification", so you can adjust the look with your own css.
If you want to rework the conword functionality into your design, you can use the Conword Javascript API. To use the API, you must simply integrate the conword.js into your page. See Basic Setup
You can use the "Conword" Javascript Object to invoke API Methods. See the chapter below for more information.
Starts the translation process. This is probably the most important function you need.
Note: When calling Conword.translate, Conword.set_user_language() is called as well, saving the language automatically in the local storage.
The following example translates the current page to spanish:
Conword.translate('es');There are some websites where content is dynamically added to the page. While Conword is well aware of that and observes the changes, sometimes there are issues and the translations need to be triggered again.
The retranslate method tries to translate the page once again into the chosen language. If the page has not been translated before, this method will do nothing.
Example:
Conword.retranslate();This method saves the user language into the localstorage. It is automatically called when Conword.translate() is triggered.
Use this function only, when you want to save the user's language, without translating the page. When the user language is set, Conword will translate the page automatically, the next time it is loaded.
The following example sets the user storage to spanish:
Conword.set_user_language('es');Unsets (forgets) the user language config.
Example:
Conword.unset_user_language();This method returns the current language key (e.g. 'en', 'es' or 'fr').
Example:
var current_language = Conword.get_current_language();This method return the javascript language object (see Language Object).
var language_data = Conword.get_available_languages();Shows the AI notification (see the ai_notification option in Setup Options) right away, no matter if it has already been shown before or if the option is set at all.
The optional parameter mode can be "top" or "modal". If it is omitted, the mode from your conword_config is used ("top" if the option is not set).
The notification text (German or English, depending on the source language of your site) is inserted into the page. If the page is already translated, Conword translates the notification into the current language as well.
Example:
Conword.show_ai_notification('modal');Closes the AI notification bar or the AI notification modal, if one is currently shown.
Example:
Conword.close_ai_notification();Conword fires Custom Events, which can be listened to, by using a custom EventListener.
document.addEventListener("Conword:ready", function(){
/* your code here */
});List of custom events
The Conword API provides an object which contains all the available languages and their metadata. The object can be retrieved like this:
let languages=Conword.get_available_languages();(Depending on the languages available with your licence.)
{
"de": {
"name_en": "German",
"name_de": "Deutsch",
"name": "Deutsch",
"rtl": false,
"text_title": "Sprache wählen:",
"text_1": "Die Seite wird gerade übersetzt …",
"text_2": "Einen Moment bitte.",
"text_error": "Beim Übersetzen der Seite ist ein Fehler ist aufgetreten."
},
"en": {
"name_en": "English",
"name_de": "Englisch",
"name": "English",
"rtl": false,
"text_title": "Select language:",
"text_1": "The page is being translated ...",
"text_2": "One moment please.",
"text_error": "An error occurred while translating the page."
},
"tr": {
"name_en": "Turkish",
"name_de": "Türkisch",
"name": "Türkçe",
"rtl": false,
"text_title": "Dil seçin:",
"text_1": "Sayfa çevriliyor ...",
"text_2": "Bir dakika lütfen.",
"text_error": "Sayfa çevrilirken bir hata oluştu."
},
"it": {
"name_en": "Italian",
"name_de": "Italienisch",
"name": "Italiano",
"rtl": false,
"text_title": "Selezionare la lingua:",
"text_1": "La pagina è in corso di traduzione ...",
"text_2": "Un momento, per favore.",
"text_error": "Si è verificato un errore durante la traduzione della pagina."
}
}User Inputs in form-fields like <input> and <textarea> will be ignored by Conword. Labels and placeholder attributes will be translated, tho.
Since Conword can not know, when user data is shown, you may want to exclude this html from translations by Conword. So if you have a summary of the form input at the end of your form, you need to make use of the following method:
If you want elements not to be translated, you can make use of the translate attribute. By setting its value to "no", Conword will ignore this element, and all its children.
Example:
<div>
<p>I will be translated</p>
<p translate="no">
I will NOT be translated.
<small>Me neither, since my parent element uses the translate attribute.</small>
</p>
I will be translated as well
</div>Conword will skip all html tags, containing the "cnw_skip_translation" class.
Example:
<div>
<p>I will be translated</p>
<p class="cnw_skip_translation">
I will NOT be translated.
<small>Me neither, since my parent element uses the cnw_skip_translation class.</small>
</p>
I will be translated as well
</div>A data attribute without a value. Conword will skip the element and all its children, just like with the class above. Handy if you don't want to touch the classes of an element.
Example:
<div>
<p>I will be translated</p>
<p data-conword-skip-translation>
I will NOT be translated.
<small>Me neither, since my parent element uses the data-conword-skip-translation attribute.</small>
</p>
</div>If your CMS or template already marks content that must not be translated with its own class, you don't have to add "cnw_skip_translation" everywhere. List your classes in the skip_classes option instead (see Setup Options). Elements with one of these classes, and all their children, are treated exactly like elements with "cnw_skip_translation".
Example:
<script>
var conword_config={
skip_classes:["no-translate", "legal-text"]
};
</script>
<script id="conword-root" charset="utf-8" src="https://static.conword.io/js/v2/[license-id]/conword.js"></script><div>
<p>I will be translated</p>
<p class="legal-text">
I will NOT be translated.
<small>Me neither, since my parent element uses one of the configured classes.</small>
</p>
</div>The class "notranslate" is recognized as well. Scripts, stylesheets, svg content, images, noscript and textarea elements are always skipped. User input in form fields is never translated, labels and placeholders are.
Note: Empty Tags will be skipped automatically.
Excluding whole pages can be done, by not loading conword or using the Conword.lock() function, which is available in newer conword versions.
Chrome, Edge and Safari offer their own translation of a page. Once Conword has translated it, that offer puts a second machine translation on top of the first. Two ways tell the browser to leave the page alone; either one is enough.
In the <head> of your page:
<meta name="google" content="notranslate">Or as a response header, which covers whole directories without touching the markup:
X-Robots-Tag: notranslateBoth apply to the whole document and have no effect on Conword, which keeps translating the page as configured. How strictly a browser honours them is up to the browser. Do not use the class "notranslate" on <html> or <body> for this: Conword skips that class as well (see "Other ways" above), so it would stop your own translation.
Use the "Conword:ready" event for this kind of marking: it is fired right before a saved user language triggers the automatic translation, so the class is in place in time. "DOMContentLoaded" can be too late, because Conword itself starts on that event.
document.addEventListener("Conword:ready", function() {
var formular_zusammenfassungen = document.querySelectorAll('.formular_zusammenfassung');
for(var i = 0; i < formular_zusammenfassungen.length; i++){
formular_zusammenfassungen[i].classList.add('cnw_skip_translation');
}
});<a href="javascript:Conword.translate('en');">Translate to english</a>document.addEventListener("Conword:ready", function(){
my_languages=Conword.get_available_languages();
for (var langkey in my_languages) {
language_meta=my_languages[langkey];
// now you can make use of the language object - see the chapter above.
// eg: language_meta.name or language_meta.name_en ...
console.debug(language_meta.name,language_meta.name_en);
// to check if the langkey is the currently active language:
active=false;
if(Conword.get_current_language()==langkey) active=true;
// jquery example of adding menu items
$language_dropdown.append('<li><a class="'+active+'" href="javascript:start_conwordio_translation(\''+langkey+'\');" data-lang="'+langkey+'" data-langname="'+language_meta.name+'" title="Diese Seite auf \''+language_meta.name+'\' übersetzen">'+language_meta.name+'</a></li>');
}
});
// example of a wrapper to call multiple actions (translation, menu controls, tracking, ...) at the same time
function start_conwordio_translation(lang){
Conword.translate(lang);
hide_menu();
matomo_track('Translation',lang);
}<style>
body .cnw_translationbox {
right: 30px;
left: auto;
}
</style>document.addEventListener("Conword:ready", function() {
var mailto_links = document.querySelectorAll('a[href^="mailto:"]');
for(var i = 0; i < mailto_links.length; i++){
if(mailto_links[i].innerHTML.indexOf('@')>-1) mailto_links[i].classList.add('cnw_skip_translation');
}
});For localization reasons, you might want to switch content on your website, when changing the language. There are several ways to control this: e.g. via html attributes. Here is an example of how to switch images.
First, create an image with data attributes like this:
<img src="bild_de.jpg" data-conword-src-de="bild_de.jpg" data-conword-src-en="image_en.jpg" data-conword-src-fr="fr.jpg" class="image_with_different_sources">The javascript listens to languages changes and replaces the image src to the attribute value.
document.addEventListener("Conword:translation_done", function(){
current_language=Conword.get_current_language();
images_with_different_sources = document.querySelectorAll('.image_with_different_sources'); // or select [data-conword-src-de]
images_with_different_sources= [...images_with_different_sources]; // convert list to array
images_with_different_sources.forEach(img => {
img.src=img.getAttribute('data-conword-src-'+current_language); // change src
});
});In order to track Conword requests, we recommend wrapping the javascript translation call.
Example script to track translations with Matomo (Piwik):
<a href="javascript:custom_start_translation('en');">English</a>
<script>
function custom_start_translation(languagekey){
Conword.translate(languagekey);
matomo_track( 'Translation '+languagekey, location.href);
}
function matomo_track(category,action){
if(typeof _paq !== 'undefined') {
_paq.push(['trackEvent', category, action, 1]);
return true;
}
return false
}
</script>Alternatively, tracking can be done using Conword's custom events. Here is an example of how to track conword translations with Piwik (Matomo):
<script>
function matomo_track(category,action){
if(typeof _paq !== 'undefined') {
_paq.push(['trackEvent', category, action, 1]);
return true;
}
return false
}
document.addEventListener("Conword:translation_started", function(){
matomo_track( 'Translation '+Conword.get_current_language(), location.href);
});
</script>The following example shows, how to track conword translations with Google Analytics:
<script>
document.addEventListener("Conword:translation_started", function(){
gtag('event', 'translation', {
'url': location.href,
'language': Conword.get_current_language()
});
});
</script>Drop us a line. We are happy to help. info@conword.io
Sagen Sie uns, was Sie vorhaben. Wir beraten Sie persönlich und finden gemeinsam die passende Lösung für Ihre Website.
Oder schreiben Sie uns
Danke, Ihre Anfrage ist angekommen.
Wir melden uns in der Regel innerhalb eines Werktags. Eine Bestätigung ist unterwegs an Ihre E-Mail-Adresse.
Kennen Sie schon die ganze Produktpalette? Lernen Sie jetzt unsere Produkte kennen
Ihre Daten bleiben in Europa: Server, CDN, API und Kundenportal laufen ausschließlich in EU-Rechenzentren europäischer Anbieter.
Übersetzen, vorlesen, barrierefrei machen, Videos zeigen. Vieles von einem Anbieter, mit einem Kundenportal und einem Ansprechpartner.
Übersetzen, vorlesen, verständlich machen: Sie haben dafür einen Ansprechpartner.