This document describes the internationalization (i18n) system in AnythingLLM's frontend, which enables the user interface to be displayed in 14+ languages. It covers the translation file structure, how translations are organized and accessed, the language selection mechanism, and how to contribute new translations or extend support to additional languages.
For information about frontend state management and user preferences, see State Management Patterns. For UI theming and styling, see UI Theming and Styling.
AnythingLLM currently supports the following languages through translation files located in frontend/src/locales/:
| Language | Locale Code | File Path |
|---|---|---|
| English (Default) | en | frontend/src/locales/en/common.js |
| Chinese (Simplified) | zh | frontend/src/locales/zh/common.js |
| Chinese (Traditional) | zh_TW | frontend/src/locales/zh_TW/common.js |
| Vietnamese | vn | frontend/src/locales/vn/common.js |
| Portuguese (Brazilian) | pt_BR | frontend/src/locales/pt_BR/common.js |
| French | fr | frontend/src/locales/fr/common.js |
| Russian | ru | frontend/src/locales/ru/common.js |
| German | de | frontend/src/locales/de/common.js |
| Spanish | es | frontend/src/locales/es/common.js |
| Hebrew | he | frontend/src/locales/he/common.js |
| Italian | it | frontend/src/locales/it/common.js |
| Korean | ko | frontend/src/locales/ko/common.js |
| Turkish | tr | frontend/src/locales/tr/common.js |
Sources: frontend/src/locales/en/common.js1-1000 frontend/src/locales/zh/common.js1 frontend/src/locales/vn/common.js1
Each locale directory contains a common.js file that exports a single TRANSLATIONS object. This object contains all translation strings organized into hierarchical sections.
Sources: frontend/src/locales/en/common.js1-10 frontend/src/locales/zh/common.js1-10
The TRANSLATIONS object is organized into the following major categories:
Sources: frontend/src/locales/en/common.js1-100
Each translation file follows a consistent nested object structure. Here's an example from the onboarding section:
Sources: frontend/src/locales/en/common.js1-80
The common section contains frequently reused strings across the application:
| Key | Purpose | Example (EN) |
|---|---|---|
workspaces-name | Workspace name label | "Workspace Name" |
error | Generic error text | "error" |
success | Generic success text | "success" |
save | Save button text | "Save changes" |
saving | Saving indicator | "Saving..." |
optional | Optional field indicator | "Optional" |
search | Search placeholder | "Search" |
username_requirements | Username validation rules | "Username must be 2-32 characters..." |
Sources: frontend/src/locales/en/common.js58-74
The settings section provides labels for the settings sidebar navigation:
Sources: frontend/src/locales/en/common.js84-116
The workspace-related sections (general, chat, vector-workspace, agent) provide translations for workspace settings pages:
Sources: frontend/src/locales/en/common.js240-436
The connectors section provides translations for all data source integrations:
Sources: frontend/src/locales/en/common.js723-798
Translation files include a standard comment header indicating incomplete translations:
When a translation key's value is null, it indicates that translation is missing and falls back to English.
Sources: frontend/src/locales/zh/common.js1 frontend/src/locales/vn/common.js1
Users can select their preferred display language through the customization settings. The setting is located at:
Settings > Customization > UI Preferences > Display Language
The translation key for this setting is:
Sources: frontend/src/locales/en/common.js505-509
The language preference is persisted in localStorage to maintain the user's selection across sessions.
Sources: frontend/src/locales/zh/common.js1-1011 frontend/src/locales/en/common.js1-1000
Some translation strings include variable placeholders using {{variableName}} syntax:
This allows dynamic insertion of values like the application name or workspace name into translated strings.
Sources: frontend/src/locales/en/common.js129-131 frontend/src/locales/en/common.js80
Complex UI elements with multiple text segments use numbered suffixes for organization:
This pattern allows translators to rearrange word order for languages with different grammatical structures.
Sources: frontend/src/locales/en/common.js290-303
Each data connector has a comprehensive set of translation keys covering all UI elements, tooltips, and help text.
Sources: frontend/src/locales/en/common.js740-767
File Location: Create or edit the appropriate file in frontend/src/locales/{locale_code}/common.js
Object Structure: Maintain the same nested object structure as en/common.js
Complete vs Partial: If a translation is incomplete, set untranslated keys to null and include the standard comment header
Variable Placeholders: Preserve {{variableName}} placeholders exactly as they appear in English
Multi-Part Strings: Maintain the same key naming pattern (desc-start, desc-end, etc.) to ensure proper reassembly
Testing: Test the translations in the running application by selecting the language in settings
Sources: frontend/src/locales/en/common.js1-1000 frontend/src/locales/zh/common.js1-2
| Category | Key Path | Usage |
|---|---|---|
| Common Actions | common.save | Save buttons throughout the app |
| Common Actions | common.saving | Loading state for save operations |
| Common Actions | common.search | Search input placeholders |
| Common Labels | common.user | User-related labels |
| Common Labels | common.error | Error messages |
| Common Labels | common.success | Success messages |
| Navigation | settings.title | Settings page title |
| Navigation | settings.system | System settings navigation |
| Navigation | settings.workspaces | Workspace settings navigation |
| Workspace | new-workspace.title | New workspace modal title |
| Workspace | general.delete.title | Delete workspace confirmation |
Sources: frontend/src/locales/en/common.js58-116
The Hebrew translation file (he/common.js) demonstrates RTL language support. While the translation structure remains identical, the UI rendering system must handle:
The translation system itself is direction-agnostic; RTL handling is implemented in the CSS and component rendering layer.
Sources: frontend/src/locales/he/common.js1-50
All translation files follow this standard export pattern:
This allows the i18n system to import translations dynamically based on the selected locale.
Sources: frontend/src/locales/en/common.js1-1000 frontend/src/locales/zh/common.js1-1011
The internationalization system in AnythingLLM provides comprehensive multi-language support through:
frontend/src/locales/{locale}/common.js files{{variableName}} syntax for dynamic contentnull values to indicate missing translationslocalStorageThe system enables contributors to add new languages or complete partial translations by following the established file structure and key naming conventions outlined in the English reference file.
Refresh this wiki