Skip to main content

Configuration Reference

This page covers all configuration options for the Participaite Unified Plugin.

Configuration Structure

window.PTP_TRANSLATE_CONFIG = {
translator: TranslatorConfig,
EAS: EASConfig,
LS: LSConfig,
};

Translator Configuration

Configure multi-language translation features.

translator: {
enabled?: boolean, // Enable translator (default: true)
showButton?: boolean, // Show language dropdown (default: true)
sourceLang?: string, // Source language code
targetLangs?: TargetLang[], // Available target languages
buttonPlacement?: ButtonPlacement,
dropdownStyle?: DropdownStyle,
defaultTranslations?: DefaultTranslations
}

Properties

PropertyTypeDefaultDescription
enabledbooleantrueEnable/disable translator functionality
showButtonbooleantrueShow/hide the language dropdown button
sourceLangstringRequiredSource language code (e.g., "de", "en")
targetLangsTargetLang[]RequiredArray of target languages
buttonPlacementButtonPlacementSee belowButton positioning options
dropdownStyleDropdownStyleSee belowStyling options
defaultTranslationsDefaultTranslationsSee belowPre-defined translations

Target Languages

targetLangs: [
{ code: "en", label: "English" },
{ code: "fr", label: "Français" },
{ code: "es" }, // Label auto-generated if not provided
];

Supported Languages

CodeLanguageCodeLanguage
arArabickoKorean
bgBulgarianltLithuanian
csCzechlvLatvian
daDanishnbNorwegian
deGermannlDutch
elGreekplPolish
enEnglishptPortuguese
esSpanishroRomanian
etEstonianruRussian
fiFinnishskSlovak
frFrenchslSlovenian
huHungariansvSwedish
idIndonesiantrTurkish
itItalianukUkrainian
jaJapanesezhChinese

EAS Configuration

Configure Einfache Sprache (simplified language) features. Available for multiple languages.

EAS: {
enabled: boolean, // Enable EAS functionality
buttonPlacement?: ButtonPlacement,
buttonStyle?: ButtonStyle
}

Properties

PropertyTypeDefaultDescription
enabledbooleanRequiredEnable/disable EAS functionality
buttonPlacementButtonPlacementSee belowButton positioning
buttonStyleButtonStyleSee belowButton styling

LS Configuration

Configure Leichte Sprache (easy-to-read language) features. Available for multiple languages.

LS: {
enabled: boolean, // Enable LS functionality
targetElementSelector: string, // CSS selector for content
buttonPlacement?: ButtonPlacement,
accentColor?: string,
noTranslateHandles?: string[],
noTranslateUrls?: string[],
skipSelectors?: string[],
skipTextSelectors?: string[],
metaInfos?: string
}

Properties

PropertyTypeDefaultDescription
enabledbooleanRequiredEnable/disable LS functionality
targetElementSelectorstringRequiredCSS selector for main content
buttonPlacementButtonPlacementSee belowButton positioning
accentColorstring#007bffAccent color for UI elements
noTranslateHandlesstring[][]URL handles to disable translation
noTranslateUrlsstring[][]Complete URLs to disable translation
skipSelectorsstring[][]CSS selectors to skip
skipTextSelectorsstring[][]Text-based selectors to skip
metaInfosstring""Website description for AI context

Default Translations

Pre-defined translations for specific source texts.

defaultTranslations: {
[langCode: string]: {
[sourceText: string]: string;
};
}

Example

defaultTranslations: {
"en": {
"Willkommen": "Welcome",
"Kontakt": "Contact"
},
"fr": {
"Willkommen": "Bienvenue",
"Kontakt": "Contact"
}
}

Button Placement

Universal button placement configuration used by all features.

buttonPlacement: {
type: 'floating' | 'inside' | 'above',
position?: 'bottom-right' | 'bottom-left' | 'middle-right' | 'middle-left' | 'top-right' | 'top-left',
offset?: { x?: number, y?: number },
buttonContainer?: string,
buttonInsidePosition?: 'start' | 'end',
zIndex?: number
}

Placement Types

Floating

buttonPlacement: {
type: 'floating',
position: 'bottom-right',
offset: { x: 20, y: 20 },
zIndex: 9999
}

Inside Container

buttonPlacement: {
type: 'inside',
buttonContainer: '#my-button-container',
buttonInsidePosition: 'end'
}

Above Content

buttonPlacement: {
type: "above";
// Button appears above the target content
}

Styling Options

dropdownStyle: {
accentColor?: string, // Primary color
fontSizeButton?: string, // Button font size
fontSizeOptions?: string, // Dropdown options font size
fontFamily?: string, // Font family
width?: string, // Dropdown width
borderRadius?: string // Border radius
}

Button Style (EAS)

buttonStyle: {
accentColor?: string // Button accent color
}

Advanced Configuration Examples

Multi-site Configuration

<script>
window.PTP_TRANSLATE_CONFIG = {
translator: {
enabled: true,
sourceLang: "de",
targetLangs: [
{ code: "en", label: "English" },
{ code: "fr", label: "Français" },
{ code: "tr", label: "Türkçe" },
],
buttonPlacement: {
type: "inside",
buttonContainer: "#language-selector",
buttonInsidePosition: "start",
},
dropdownStyle: {
accentColor: "#2563eb",
fontFamily: "Inter, sans-serif",
borderRadius: "8px",
},
},

EAS: {
enabled: true,
buttonPlacement: {
type: "floating",
position: "middle-left",
offset: { x: 10, y: 0 },
},
buttonStyle: {
accentColor: "#059669",
},
},

LS: {
enabled: true,
targetElementSelector: "article.content",
buttonPlacement: {
type: "above",
},
accentColor: "#dc2626",
skipSelectors: [".advertisement", ".cookie-banner"],
skipTextSelectors: ["div|© 2024", "span|Cookie"],
metaInfos:
"Das ist die Internetseite der Musterstadt in Schleswig-Holstein",
},
};
</script>

Minimal Configuration

<script>
window.PTP_TRANSLATE_CONFIG = {
translator: {
sourceLang: "de",
targetLangs: [{ code: "en" }],
},
};
</script>

Next Steps