🔄 chore: Enforce 18next Language Keys (#5803)

* chore: enforcing language keys to adhere to the new standard.

* chore: enforcing i18n forbids to write plain text in JSX markup

* chore: enforcing i18n forbids to write plain text in JSX markup

* fix: ci with checkbox for unused keys :)

* refactor: removed all the unused `i18n` keys
This commit is contained in:
Ruben Talstra 2025-02-12 21:48:13 +01:00 committed by GitHub
parent 2a506df443
commit 7f48030452
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 200 additions and 219 deletions

View file

@ -1,6 +1,6 @@
import { OptionTypes } from 'librechat-data-provider';
import type { DynamicSettingProps } from 'librechat-data-provider';
import { useLocalize, useDebouncedInput, useParameterEffects } from '~/hooks';
import { useLocalize, useDebouncedInput, useParameterEffects, TranslationKeys } from '~/hooks';
import { Label, Input, HoverCard, HoverCardTrigger } from '~/components/ui';
import { useChatContext } from '~/Providers';
import OptionHover from './OptionHover';
@ -73,7 +73,7 @@ function DynamicInput({
htmlFor={`${settingKey}-dynamic-input`}
className="text-left text-sm font-medium"
>
{labelCode ? localize(label) || label : label || settingKey}{' '}
{labelCode ? localize(label as TranslationKeys) || label : label || settingKey}{' '}
{showDefault && (
<small className="opacity-40">
(
@ -90,7 +90,7 @@ function DynamicInput({
disabled={readonly}
value={inputValue ?? ''}
onChange={handleInputChange}
placeholder={placeholderCode ? localize(placeholder) || placeholder : placeholder}
placeholder={placeholderCode ? localize(placeholder as TranslationKeys) || placeholder : placeholder}
className={cn(
'flex h-10 max-h-10 w-full resize-none border-none bg-surface-secondary px-3 py-2',
)}
@ -98,7 +98,7 @@ function DynamicInput({
</HoverCardTrigger>
{description && (
<OptionHover
description={descriptionCode ? localize(description) || description : description}
description={descriptionCode ? localize(description as TranslationKeys) || description : description}
side={ESide.Left}
/>
)}