Language Configuration in Mimeeq
This guide explains how to configure language settings for Mimeeq Configurator embeds, allowing you to provide a localized experience for your users.
Built-in Translations
Mimeeq provides complete UI translations for three languages out of the box:
| Language | Locale Code |
|---|---|
| English | en |
| German | de |
| Polish | pl |
For all other languages, you need to provide custom translations.
Product content (names, descriptions, option labels) is managed separately in the Mimeeq Admin Panel and must be translated for each language you want to support.
Language Priority
When determining which language to display, Mimeeq follows this priority order:
localeattribute on the embed element (highest priority)- Template language setting from the embed template
- Customer default language configured in your Mimeeq account
This means you can set a default language in your template but override it per-embed when needed.
Configuration Methods
Mimeeq offers multiple methods to set the language for your configurator, listed here in order of recommendation:
1. Using Embed Templates (Recommended)
The preferred approach is configuring language through Embed Templates:
- Go to Settings → Embed Templates in the Admin Panel
- Create or edit a template
- Set the Language in the template settings
- Apply the template to your embed
<!-- Using a template that already has language settings -->
<mmq-embed short-code="ABC123" template="your_template_id"></mmq-embed>
Benefits:
- Centralized configuration management
- Consistent settings across multiple embeds
- Easier maintenance and updates
- Changes apply without modifying website code
2. Using the Locale Attribute
Override the template language by setting the locale attribute:
<mmq-embed short-code="ABC123" template="your_template_id" locale="de"></mmq-embed>
Use this when you need to:
- Override template language for specific pages
- Dynamically change language based on user preferences
- Test different language configurations
3. Dynamically Changing Language
Change the language programmatically:
// Get a reference to your embed
const configurator = document.querySelector('mmq-embed');
// Change the language to German
configurator.setAttribute('locale', 'de');
This allows you to create language switchers or respect user language preferences stored in cookies or browser settings.
// Example of setting language based on user preference
document.addEventListener('DOMContentLoaded', () => {
const userLanguage = getUserPreferredLanguage(); // Your function to get preference
const configurator = document.querySelector('mmq-embed');
if (configurator && userLanguage) {
configurator.setAttribute('locale', userLanguage);
}
});
Language Fallback Behavior
When a requested language is not available or translations are missing:
- The configurator attempts to use the customer's default language
- If that's unavailable, it falls back to English (
en) - Custom translations (if defined) are applied after language selection
Implementation Examples
Basic Implementation
<mmq-embed short-code="ABC123" template="template_id" locale="en"></mmq-embed>
<script src="https://cdn.mimeeq.com/read_models/embed/app-embed.js" async></script>
Template-Based (Recommended)
<!-- Language is defined in the template -->
<mmq-embed short-code="ABC123" template="german_retail_template"></mmq-embed>
<script src="https://cdn.mimeeq.com/read_models/embed/app-embed.js" async></script>
Language Switcher
<div class="language-selector">
<button onclick="changeLanguage('en')">English</button>
<button onclick="changeLanguage('de')">Deutsch</button>
<button onclick="changeLanguage('pl')">Polski</button>
</div>
<mmq-embed id="configurator" short-code="ABC123" template="template_id"></mmq-embed>
<script>
function changeLanguage(lang) {
document.getElementById('configurator').setAttribute('locale', lang);
}
</script>
<script src="https://cdn.mimeeq.com/read_models/embed/app-embed.js" async></script>
Browser-Based Language Detection
document.addEventListener('DOMContentLoaded', () => {
const configurator = document.querySelector('mmq-embed');
// Get browser language (e.g., "en-US" -> "en")
const browserLang = navigator.language?.substring(0, 2);
// Only set if it's a supported language
const supportedLanguages = ['en', 'de', 'pl'];
if (browserLang && supportedLanguages.includes(browserLang)) {
configurator.setAttribute('locale', browserLang);
}
});
Adding More Languages
To support languages beyond English, German, and Polish:
- Enable the language in Admin Panel → Settings → Languages
- Provide custom translations using
window.mimeeqCustomMessages - Translate product content in the Admin Panel
See Custom Translations for detailed instructions on providing UI translations.
Quick Example
<script>
window.mimeeqCustomMessages = {
'header3d.finish': 'Terminer',
'historymodule.panelmenufooter.finish': 'Terminer',
'summarypanel.addToCart': 'Ajouter au panier',
// ... more translations
};
</script>
Multi-Language Support
For sites supporting multiple languages:
<script>
window.mimeeqCustomMessages = {
fr: {
'header3d.finish': 'Terminer',
'summarypanel.addToCart': 'Ajouter au panier',
},
es: {
'header3d.finish': 'Finalizar',
'summarypanel.addToCart': 'Añadir al carrito',
},
};
</script>
Managing Languages in Admin Panel
Languages available to your users are managed in Admin Panel → Settings → Languages. This interface allows you to:
- Enable or disable languages
- See the locale codes for each language
- Set the default language for your account
Authentication Embed
The <mmq-auth> component also supports the locale attribute:
<mmq-auth short-code="AUTH001" locale="de"></mmq-auth>
Note that authentication embeds don't use embed templates, so language must be set via the attribute.
Legacy Support
The following method uses the deprecated data-mimeeq attribute system. New implementations should use the web component approach described above.
<div data-mimeeq data-mimeeq-short-code="ABC123" data-locale="de"></div>
Related Resources
- Custom Translations – Provide translations for additional languages
- Embed Templates – Configure language and other settings centrally
- Embed Types – Overview of all embed types and their configuration