mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 02:40:14 +01:00
🔄 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:
parent
2a506df443
commit
7f48030452
33 changed files with 200 additions and 219 deletions
|
|
@ -27,6 +27,7 @@ import {
|
|||
import { TrashIcon, Spinner } from '~/components/svg';
|
||||
import { useLocalize, useMediaQuery } from '~/hooks';
|
||||
import { cn } from '~/utils';
|
||||
import { LocalizeFunction } from '~/common';
|
||||
|
||||
type TableColumn<TData, TValue> = ColumnDef<TData, TValue> & {
|
||||
meta?: {
|
||||
|
|
@ -177,7 +178,7 @@ const DeleteButton = memo(
|
|||
isDeleting: boolean;
|
||||
disabled: boolean;
|
||||
isSmallScreen: boolean;
|
||||
localize: (key: string) => string;
|
||||
localize:LocalizeFunction;
|
||||
}) => {
|
||||
if (!onDelete) {
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useState, useCallback, useRef, useEffect } from 'react';
|
||||
import { useLocalize } from '~/hooks';
|
||||
import { TranslationKeys, useLocalize } from '~/hooks';
|
||||
import { Minus, Plus } from 'lucide-react';
|
||||
|
||||
interface ModelParametersProps {
|
||||
|
|
@ -33,7 +33,7 @@ const ModelParameters: React.FC<ModelParametersProps> = ({
|
|||
const rangeRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
const id = `model-parameter-${ariaLabel.toLowerCase().replace(/\s+/g, '-')}`;
|
||||
const displayLabel = label.startsWith('com_') ? localize(label) : label;
|
||||
const displayLabel = label.startsWith('com_') ? localize(label as TranslationKeys) : label;
|
||||
|
||||
const getDecimalPlaces = (num: number) => {
|
||||
const match = ('' + num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue