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
| Property | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable/disable translator functionality |
showButton | boolean | true | Show/hide the language dropdown button |
sourceLang | string | Required | Source language code (e.g., "de", "en") |
targetLangs | TargetLang[] | Required | Array of target languages |
buttonPlacement | ButtonPlacement | See below | Button positioning options |
dropdownStyle | DropdownStyle | See below | Styling options |
defaultTranslations | DefaultTranslations | See below | Pre-defined translations |
Target Languages
targetLangs: [
{ code: "en", label: "English" },
{ code: "fr", label: "Français" },
{ code: "es" }, // Label auto-generated if not provided
];
Supported Languages
| Code | Language | Code | Language |
|---|---|---|---|
ar | Arabic | ko | Korean |
bg | Bulgarian | lt | Lithuanian |
cs | Czech | lv | Latvian |
da | Danish | nb | Norwegian |
de | German | nl | Dutch |
el | Greek | pl | Polish |
en | English | pt | Portuguese |
es | Spanish | ro | Romanian |
et | Estonian | ru | Russian |
fi | Finnish | sk | Slovak |
fr | French | sl | Slovenian |
hu | Hungarian | sv | Swedish |
id | Indonesian | tr | Turkish |
it | Italian | uk | Ukrainian |
ja | Japanese | zh | Chinese |
EAS Configuration
Configure Einfache Sprache (simplified language) features. Available for multiple languages.
EAS: {
enabled: boolean, // Enable EAS functionality
buttonPlacement?: ButtonPlacement,
buttonStyle?: ButtonStyle
}
Properties
| Property | Type | Default | Description |
|---|---|---|---|
enabled | boolean | Required | Enable/disable EAS functionality |
buttonPlacement | ButtonPlacement | See below | Button positioning |
buttonStyle | ButtonStyle | See below | Button 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
| Property | Type | Default | Description |
|---|---|---|---|
enabled | boolean | Required | Enable/disable LS functionality |
targetElementSelector | string | Required | CSS selector for main content |
buttonPlacement | ButtonPlacement | See below | Button positioning |
accentColor | string | #007bff | Accent color for UI elements |
noTranslateHandles | string[] | [] | URL handles to disable translation |
noTranslateUrls | string[] | [] | Complete URLs to disable translation |
skipSelectors | string[] | [] | CSS selectors to skip |
skipTextSelectors | string[] | [] | Text-based selectors to skip |
metaInfos | string | "" | 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
Dropdown Style (Translator)
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
- Migration Guide - Upgrade from v1 configurations
- Troubleshooting - Common configuration issues