Repository navigation
Conversation
…e Switcher Adds a complete fa locale, a language choice persisted in localStorage (settings dialog, command menu and login page), and renders <html lang/dir> from the active language so React 19 does not reset them. Physical-direction Tailwind classes and CSS properties are converted to logical ones, drawer and switch animations mirror in RTL, Vazirmatn is bundled locally for Persian, and audit/user dates format in the UI language. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The admin panel already runs on i18next, but it only ships English and its layout assumes left-to-right text, so a right-to-left language cannot be added by dropping in a translation file. This PR adds Persian (
fa) and the RTL groundwork any future RTL locale (Arabic, Hebrew) can reuse.Language choice
fais registered insrc/locales/i18n.tswithsupportedLngs,load: 'languageOnly', and detection fromlocalStorage(admin-panel:language) and then the browser.LanguageSelectortoggle on the login page.Document direction
RootDocumentrenders<html lang dir>from the active language through a newuseLanguage()hook.<html>singleton and resets attributes it did not render, so settingdironly from i18next was wiped on the next render.Mirrored layout
ml/mr→ms/me,left/right→inset-s/inset-e,text-left→text-start,rounded-l→rounded-s, and so on, across about 70 components.styles.cssuses logical properties.--drawer-offset, which flips under[dir='rtl']. The scope switch knob mirrors too.Typography and dates
@fontsource-variable/vazirmatnand applies only under:lang(fa). Code and monospace text keep their fonts.Translation
{{placeholder}}and${ENV}token is preserved.com_config_issue_inherited_entry_immutableandcom_config_issue_yaml_entry_immutable. In these,{{action}}receives a raw English word (renamed/removed) fromsrc/utils/collections.ts, so the Persian text names both actions instead of interpolating it. Localizing that word upstream would let the placeholder come back.Change Type
Testing
bunx vitest run src/locales src/hooks: 194 tests pass. The newsrc/locales/fa.test.tschecks:fahas no keys outsideen.en, except the two keys above.fasetsdir="rtl", and switching back setsltr.useLocalizereturns Persian aftersetLanguage('fa').npx tsc --noEmit: no new errors. On Windows, the only error is the existingTransport.tsx/transport.tscasing clash.eslint: clean.docker build .), run against a LibreChat API: the login page switches to Persian withdir="rtl"and Vazirmatn loaded, the choice persists across reloads, and English stays left-to-right as before.Test Configuration:
Windows 10, Bun 1.3.14, Docker Desktop. LibreChat API from
docker-compose.Checklist
🤖 Generated with Claude Code