Localization
Dragble Editor ships with 29 built-in languages out of the box. You can also provide custom translation overrides for any string, or add entirely new languages. The default locale is English US (en-US).
Setting the locale
Pass a BCP 47 locale code (e.g. en-US, fr-FR, ja-JP) when initializing the editor. You can also pass bare language codes like en, fr, de — the editor automatically maps them to the default region.
function LocalizedEditor() {
const editorRef = useRef<DragbleEditorRef>(null);
return (
<DragbleEditor
ref={editorRef}
editorKey="db_your_key"
editorMode="email"
options={{
locale: "fr-FR",
textDirection: "ltr",
}}
/>
);
}
<template>
<DragbleEditor
ref="editorRef"
editor-key="db_your_key"
editor-mode="email"
locale="fr-FR"
text-direction="ltr"
/>
</template>
<script setup lang="ts">
const editorRef = ref<InstanceType<typeof DragbleEditor>>();
</script>
@Component({
selector: "app-localized-editor",
standalone: true,
imports: [DragbleEditorComponent],
template: `
<dragble-editor
#editor
editorKey="db_your_key"
editorMode="email"
locale="ar-AE"
textDirection="rtl"
></dragble-editor>
`,
})
export class LocalizedEditorComponent {
@ViewChild("editor") editorComp!: DragbleEditorComponent;
}
dragble.init({
containerId: "editor-container",
editorKey: "db_your_key",
editorMode: "email",
options: {
locale: "ar-AE",
textDirection: "rtl",
},
});
Supported languages
The editor includes full translations for 29 languages across 22 language families. Each locale contains over 1,100 translated strings covering all UI elements.
| Language | Region | Locale Code | RTL |
|---|---|---|---|
| Arabic | UAE | ar-AE | Yes |
| Chinese (Simplified) | China | zh-CN | No |
| Chinese (Traditional) | Taiwan | zh-TW | No |
| Czech | Czech Republic | cs-CZ | No |
| Danish | Denmark | da-DK | No |
| Dutch | Netherlands | nl-NL | No |
| English | USA (Default) | en-US | No |
| English | Canada | en-CA | No |
| Estonian | Estonia | et-EE | No |
| Farsi (Persian) | Iran | fa-IR | Yes |
| Finnish | Finland | fi-FI | No |
| French | France | fr-FR | No |
| French | Canada | fr-CA | No |
| German | Germany | de-DE | No |
| Hungarian | Hungary | hu-HU | No |
| Indonesian | Indonesia | id-ID | No |
| Italian | Italy | it-IT | No |
| Japanese | Japan | ja-JP | No |
| Korean | Korea | ko-KR | No |
| Norwegian | Norway | no-NO | No |
| Polish | Poland | pl-PL | No |
| Portuguese | Brazil | pt-BR | No |
| Portuguese | Portugal | pt-PT | No |
| Russian | Russia | ru-RU | No |
| Spanish | Spain | es-ES | No |
| Swedish | Sweden | sv-SE | No |
| Turkish | Turkey | tr-TR | No |
| Ukrainian | Ukraine | uk-UA | No |
| Vietnamese | Vietnam | vi-VN | No |
You can pass just the language code (e.g. fr instead of fr-FR). The editor automatically maps it to the default region for that language. For languages with multiple regions (English, French, Portuguese, Chinese), the mapping defaults to: en → en-US, fr → fr-FR, pt → pt-BR, zh → zh-CN.
RTL support
Set textDirection: 'rtl' to mirror the entire editor layout for right-to-left languages like Arabic and Farsi. This affects the panel positions, text alignment defaults, and toolbar layout.
The editor automatically detects RTL for ar-AE and fa-IR locales, but you can explicitly set it for any locale:
options: {
locale: 'ar-AE',
textDirection: 'rtl',
}
Custom translation overrides
You don't need to translate every string. The translations object merges with the built-in locale — you only override the keys you want to customize:
<DragbleEditor
ref={editorRef}
editorKey="db_your_key"
options={{
locale: "fr-FR",
translations: {
"fr-FR": {
"buttons.save": "Sauvegarder",
"buttons.cancel": "Annuler",
"editor.background_color": "Couleur de fond",
},
},
}}
/>
dragble.init({
containerId: "editor-container",
editorKey: "db_your_key",
options: {
locale: "fr-FR",
translations: {
"fr-FR": {
"buttons.save": "Sauvegarder",
"buttons.cancel": "Annuler",
"editor.background_color": "Couleur de fond",
},
},
},
});
Adding a new language
To add a language not in the built-in list, set the locale to your custom code and provide a full set of translations:
options: {
locale: 'th',
translations: {
th: {
'buttons.save': 'บันทึก',
'buttons.cancel': 'ยกเลิก',
'buttons.delete': 'ลบ',
// ... provide all translation keys from /samples/en-US.json
},
},
}
Translations are resolved in this order (highest priority wins):
- Your custom translations (
translations[locale]) - Built-in locale (e.g.
fr-FR.json) - English US defaults (
en-US.json— always complete, every key exists)
Any key you don't override falls back through this chain automatically.
Translation key reference
The editor uses 1,106 translation keys organized by feature area using dot-notation (e.g. editor.background_color, buttons.save, audit.BUTTON_MISSING_LINK.title).
Download the full English translation file (en-US.json) to use as a reference when creating custom translations. This file contains every key with its English value.
Key namespaces include:
| Namespace | Description | Examples |
|---|---|---|
ai.* | AI features (image generation, smart text, alt text) | ai.image_generator.title, ai.smart_text.rephrase |
audit.* | Design audit rules and messages | audit.IMAGE_MISSING_ALT.title, audit.all_checks_passed |
buttons.* | Common button labels | buttons.save, buttons.cancel, buttons.delete |
comments.* | Collaboration comments | comments.resolve, comments.reply |
content_tools.* | Content tool names | content_tools.image, content_tools.button |
editor.* | Editor properties and controls | editor.background_color, editor.font_family |
file_manager.* | File manager and image uploads | file_manager.upload_images, file_manager.search_placeholder |
labels.* | General labels | labels.desktop, labels.mobile, labels.preview |
modals.* | Modal dialogs | modals.delete_item.title, modals.display_conditions.add |
modules.* | Modules Library | modules.modules_library, modules.all_categories, modules.no_matching_modules, modules.rows |
option_groups.* | Property panel group headers | option_groups.general, option_groups.spacing |
tabs.* | Side panel tab names | tabs.content, tabs.styles, tabs.modules |
tooltips.* | Tooltip text | tooltips.undo, tooltips.duplicate, tooltips.delete |
Update at runtime
Switch language or direction without reinitializing the editor:
// Switch to German
editor.setLocale("de-DE");
// Switch to Arabic with RTL
editor.setLocale("ar-AE");
editor.setTextDirection("rtl");
// Switch to a custom locale with overrides
editor.setLocale("th", {
"buttons.save": "บันทึก",
"buttons.cancel": "ยกเลิก",
});
Method reference
| Method | Returns | Description |
|---|---|---|
setLocale(locale, translations?) | void | Switch to a built-in or custom locale. Optional translations object overrides specific keys. |
setTextDirection(dir) | void | Set 'ltr' or 'rtl' layout direction. |
Next steps
- Customize Appearance — theme the editor UI
- Custom Fonts — add fonts for non-Latin scripts
- Collaboration — localized commenting and review UI
- Configuration Reference — all SDK configuration options