mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-10 19:44:23 +01:00
Add localization support for endpoint pages components (#667)
* init localization * Update defaul to en * Fix merge issue and import path. * Set default to en * Change jsx to tsx * Update the password max length string. * Remove languageContext as using the recoil instead. * Add localization to component endpoints pages * Revert default to en after testing. * Update LoginForm.tsx * Fix translation. * Make lint happy
This commit is contained in:
parent
4148c6d219
commit
b64273957a
15 changed files with 212 additions and 67 deletions
|
|
@ -5,11 +5,13 @@ import { cn } from '~/utils/';
|
|||
import cleanupPreset from '~/utils/cleanupPreset';
|
||||
import { useCreatePresetMutation } from '@librechat/data-provider';
|
||||
import store from '~/store';
|
||||
import { localize } from '~/localization/Translation';
|
||||
|
||||
const SaveAsPresetDialog = ({ open, onOpenChange, preset }) => {
|
||||
const [title, setTitle] = useState(preset?.title || 'My Preset');
|
||||
const endpointsConfig = useRecoilValue(store.endpointsConfig);
|
||||
const createPresetMutation = useCreatePresetMutation();
|
||||
const lang = useRecoilValue(store.lang);
|
||||
|
||||
const defaultTextProps =
|
||||
'rounded-md border border-gray-300 bg-transparent text-sm shadow-[0_0_10px_rgba(0,0,0,0.10)] outline-none placeholder:text-gray-400 focus:outline-none focus:ring-gray-400 focus:ring-opacity-20 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-400 dark:bg-gray-700 dark:text-gray-50 dark:shadow-[0_0_15px_rgba(0,0,0,0.10)] dark:focus:border-gray-400 dark:focus:outline-none dark:focus:ring-0 dark:focus:ring-gray-400 dark:focus:ring-offset-0';
|
||||
|
|
@ -37,7 +39,7 @@ const SaveAsPresetDialog = ({ open, onOpenChange, preset }) => {
|
|||
main={
|
||||
<div className="grid w-full items-center gap-2">
|
||||
<Label htmlFor="chatGptLabel" className="text-left text-sm font-medium">
|
||||
Preset Name
|
||||
{localize(lang, 'com_endpoint_preset_name')}
|
||||
</Label>
|
||||
<Input
|
||||
id="chatGptLabel"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue