Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
docs: update on default language and how to add a language 🌐 (#1042)
Marco Berettabc7a07920819
diff --git a/client/src/store/language.ts b/client/src/store/language.tsindex 4c0d39911a..ce30f84ecb 100644--- a/client/src/store/language.ts+++ b/client/src/store/language.ts@@ -2,7 +2,7 @@ import { atom } from 'recoil';const lang = atom({key: 'lang',- default: localStorage.getItem('lang') || 'en',+ default: localStorage.getItem('lang') || 'en-US',});export default { lang };diff --git a/docs/contributions/translation_contribution.md b/docs/contributions/translation_contribution.mdindex 315a43e963..97bc4c4969 100644--- a/docs/contributions/translation_contribution.md+++ b/docs/contributions/translation_contribution.md@@ -16,16 +16,18 @@ Fork the [LibreChat repository](https://github.com/danny-avila/LibreChat) and do- At the beginning of the code, add your language below all the others in this format:`import Language-name from './languages/** ';`+Example (English):`import English from './languages/Eng';`-- Further down in the code, add the following:+- Further down in the code, add in the language mapping, the following:++ `'**-**': LanguageName,`- `if (langCode === '**') return Language-name;`+> Replace `**-**` with the local identifier of your language (ask ChatGPT or search it on Google).->Replace "**" with the ISO 3166 Alpha-2 code of your language (in lowercase).-Example (English): `if (langCode === 'en') return English;`+> Replace `LanguageName` with the name of your language.->If you don't know the ISO 3166 code for your language, check it [here](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) and also use it with an initial capital)+Example (English): `'en-US': English,`### Create your new language file- Go into the `client\src\localization\languages` folder and create a file named as follows: `**.tsx`@@ -56,7 +58,7 @@ Example (English): `if (langCode === 'en') return English;`⚠️ Do not modify the `com_...` part ⚠️-> Delete the Language list after `com_nav_setting_general: 'General',` near the bottom of the file (You do not need to translate the individual language names)+### Delete the Language list after `com_nav_setting_general: 'General',` near the bottom of the file (You do not need to translate the individual language names), except for `com_nav_setting_data: 'Data controls'` (you need to translate it)### Add your language to `Eng.tsx`@@ -69,7 +71,7 @@ Add your language to the `LangSelector` variable in the following way:```jsexport const LangSelector = ({//other code- <option value="en">{localize(lang, 'com_nav_lang_english')}</option>+ <option value="en-US">{localize(lang, 'com_nav_lang_english')}</option>//other languages...<option value="**">{localize(lang, 'com_nav_lang_your-language-name')}</option></select>@@ -78,12 +80,12 @@ export const LangSelector = ({};```-Where `**` is the ISO 3166 Alpha-2 code and `com_nav_lang_your-language-name` stands for the name of your language.+Where `**-**` is the local identifier of your language and `com_nav_lang_your-language-name` stands for the name of your language.Example: `com_nav_lang_english` or `com_nav_lang_italian`**You should only need to add one line of code:**```js-<option value="**">{localize(lang, 'com_nav_lang_your-language-name')}</option>+<option value="**-**">{localize(lang, 'com_nav_lang_your-language-name')}</option>```### Summary@@ -110,4 +112,4 @@ You can confirm this by using the following command: `git status`- Answer all the questions, and in the "Type of Change" section, add `- [x] Translation support`- Delete irrelevant comments from the template-- Create a pull request 🎉\ No newline at end of file+- Create a pull request 🎉diff --git a/docs/install/default_language.md b/docs/install/default_language.mdindex 27cc7329c1..483821a1cd 100644--- a/docs/install/default_language.md+++ b/docs/install/default_language.md@@ -2,8 +2,8 @@## How to change the default language-- Open this file `client\src\store\language.js`-- Modify the "default" in the lang variable with your ISO 3166 Alpha-2 code :+- Open this file `client\src\store\language.ts`+- Modify the "default" in the lang variable with your locale identifier :Example:from **English** as default@@ -13,7 +13,7 @@ import { atom } from 'recoil';const lang = atom({key: 'lang',- default: 'en',+ default: localStorage.getItem('lang') || 'en-US',});export default { lang };@@ -26,7 +26,7 @@ import { atom } from 'recoil';const lang = atom({key: 'lang',- default: 'it',+ default: localStorage.getItem('lang') || 'it-IT',});export default { lang };