mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-07 02:58:50 +01:00
chore: linting
This commit is contained in:
parent
5476029bca
commit
83477bba34
3 changed files with 10 additions and 4 deletions
|
|
@ -62,7 +62,7 @@ function DynamicCheckbox({
|
|||
htmlFor={`${settingKey}-dynamic-checkbox`}
|
||||
className="text-left text-sm font-medium"
|
||||
>
|
||||
{labelCode ? localize(label as TranslationKeys) ?? label : label || settingKey}{' '}
|
||||
{labelCode ? (localize(label as TranslationKeys) ?? label) : label || settingKey}{' '}
|
||||
{showDefault && (
|
||||
<small className="opacity-40">
|
||||
({localize('com_endpoint_default')}:{' '}
|
||||
|
|
@ -81,7 +81,11 @@ function DynamicCheckbox({
|
|||
</HoverCardTrigger>
|
||||
{description && (
|
||||
<OptionHover
|
||||
description={descriptionCode ? localize(description as TranslationKeys) ?? description : description}
|
||||
description={
|
||||
descriptionCode
|
||||
? (localize(description as TranslationKeys) ?? description)
|
||||
: description
|
||||
}
|
||||
side={ESide.Left}
|
||||
/>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import i18n from './i18n';
|
|||
import English from './en/translation.json';
|
||||
import French from './fr/translation.json';
|
||||
import Spanish from './es/translation.json';
|
||||
import { TranslationKeys } from '~/hooks';
|
||||
|
||||
describe('i18next translation tests', () => {
|
||||
// Ensure i18next is initialized before any tests run
|
||||
|
|
@ -34,7 +35,7 @@ describe('i18next translation tests', () => {
|
|||
|
||||
it('should return the key itself for an invalid key', () => {
|
||||
i18n.changeLanguage('en');
|
||||
expect(i18n.t('invalid-key')).toBe('invalid-key'); // Returns the key itself
|
||||
expect(i18n.t('invalid-key' as TranslationKeys)).toBe('invalid-key'); // Returns the key itself
|
||||
});
|
||||
|
||||
it('should correctly format placeholders in the translation', () => {
|
||||
|
|
@ -44,4 +45,4 @@ describe('i18next translation tests', () => {
|
|||
i18n.changeLanguage('fr');
|
||||
expect(i18n.t('com_endpoint_default_with_num', { 0: 'Marie' })).toBe('par défaut : Marie');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable i18next/no-literal-string */
|
||||
import { Button } from '@librechat/client';
|
||||
import { useRouteError } from 'react-router-dom';
|
||||
import logger from '~/utils/logger';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue