Overview
Excalidraw supports over 30 languages out of the box. You can easily set the language for the editor interface, and Excalidraw handles all UI translations automatically.Quick Start
Setting the Language
Use thelangCode prop to set the interface language:
Supported Languages
Excalidraw includes 30+ languages with at least 85% translation completion:From
packages/excalidraw/i18n.ts:21-75, only languages with at least 85% completion (defined by COMPLETION_THRESHOLD) are included by default.Available Languages List
Importing Language Data
Access the full list of supported languages:Language Object Structure
Each language object contains:packages/excalidraw/i18n.ts:11-15):
Right-to-Left (RTL) Languages
RTL Support
Excalidraw automatically handles RTL languages:Supported RTL Languages
- Arabic:
ar-SA - Hebrew:
he-IL - Persian:
fa-IR
Dynamic Language Switching
User Language Selector
Let users choose their preferred language:Browser Language Detection
Automatic language detection based on browser settings:Persisting Language Preference
Save and restore the user’s language choice:Using the i18n Hook
useI18n Hook
For custom components that need translations:From
packages/excalidraw/i18n.ts:165-172, the useI18n hook should be used in components rendered as Excalidraw children or memoized internal components.Translation Function
Using the t() Function
The translation function from the source code (packages/excalidraw/i18n.ts:127-160):
Advanced Configuration
Language Setting Function
Programmatically set the language:Default Language
Get the default language:Initial Language in AppState
Setting Initial Language
You can also set the language throughinitialData:
Best Practices
1
Detect browser language
Use
navigator.language to detect and set the initial language.2
Provide language selector
Give users an easy way to change the language.
3
Persist preference
Save the user’s language choice to localStorage.
4
Test RTL languages
Ensure your custom UI components work correctly with RTL languages.
5
Fallback to English
Always have English as a fallback option.
Complete Example
Full i18n Implementation
Next Steps
Theming
Combine i18n with theme customization
Storage
Persist language preferences
Customization
Customize the editor interface
Embedding
Embed with language support