(feat:sources) i18n

This commit is contained in:
ManishMadan2882
2025-08-07 12:53:12 +05:30
parent 0a8cdbd7f1
commit fdae235742
8 changed files with 67 additions and 20 deletions

View File

@@ -495,11 +495,11 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
<span className="text-xs text-gray-600 dark:text-gray-400">
{processingRef.current
? currentOpRef.current === 'add'
? 'Uploading'
: 'Deleting'
? t('settings.sources.uploading')
: t('settings.sources.deleting')
: null}
{queueLength > 0
? `${processingRef.current ? ' • ' : ''}Queued: ${queueLength}`
? `${processingRef.current ? ' • ' : ''}${t('settings.sources.queued', { count: queueLength })}`
: ''}
</span>
)}
@@ -509,12 +509,12 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
title={
processingRef.current
? currentOpRef.current === 'add'
? 'Uploading files...'
: 'Deleting...'
: 'Add file'
? t('settings.sources.uploadingFilesTitle')
: t('settings.sources.deletingTitle')
: t('settings.sources.addFile')
}
>
Add file
{t('settings.sources.addFile')}
</button>
</div>
)}
@@ -621,7 +621,7 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
<button
onClick={(e) => handleMenuClick(e, itemId)}
className="inline-flex h-[35px] w-[24px] shrink-0 items-center justify-center rounded-md transition-colors hover:bg-[#EBEBEB] dark:hover:bg-[#26272E]"
aria-label="Open menu"
aria-label={t('settings.sources.menuAlt')}
>
<img
src={ThreeDots}
@@ -677,7 +677,7 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
<button
onClick={(e) => handleMenuClick(e, itemId)}
className="inline-flex h-[35px] w-[24px] shrink-0 items-center justify-center rounded-md transition-colors hover:bg-[#EBEBEB] dark:hover:bg-[#26272E]"
aria-label="Open menu"
aria-label={t('settings.sources.menuAlt')}
>
<img
src={ThreeDots}
@@ -779,7 +779,7 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
<img
src={SearchIcon}
alt="Search"
alt={t('settings.sources.searchAlt')}
className="absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 transform opacity-60"
/>
@@ -882,7 +882,7 @@ const FileTreeComponent: React.FC<FileTreeComponentProps> = ({
message={
itemToDelete?.isFile
? t('settings.sources.confirmDelete')
: `Are you sure you want to delete the directory "${itemToDelete?.name}" and all its contents? This action cannot be undone.`
: t('settings.sources.deleteDirectoryWarning', { name: itemToDelete?.name })
}
modalState={deleteModalState}
setModalState={setDeleteModalState}

View File

@@ -90,9 +90,16 @@
"folderAlt": "Folder",
"parentFolderAlt": "Parent folder",
"menuAlt": "Menu",
"menuAlt": "Menu",
"tokensUnit": "tokens",
"editAlt": "Edit"
"editAlt": "Edit",
"uploading": "Uploading…",
"deleting": "Deleting…",
"queued": "Queued: {{count}}",
"addFile": "Add file",
"uploadingFilesTitle": "Uploading files...",
"deletingTitle": "Deleting...",
"deleteDirectoryWarning": "Are you sure you want to delete the directory \"{{name}}\" and all its contents? This action cannot be undone.",
"searchAlt": "Search"
},
"apiKeys": {
"label": "Chatbots",

View File

@@ -91,7 +91,15 @@
"parentFolderAlt": "Carpeta padre",
"menuAlt": "Menú",
"tokensUnit": "tokens",
"editAlt": "Editar"
"editAlt": "Editar",
"uploading": "Subiendo…",
"deleting": "Eliminando…",
"queued": "En cola: {{count}}",
"addFile": "Añadir archivo",
"uploadingFilesTitle": "Subiendo archivos...",
"deletingTitle": "Eliminando...",
"deleteDirectoryWarning": "¿Está seguro de que desea eliminar el directorio \"{{name}}\" y todo su contenido? Esta acción no se puede deshacer.",
"searchAlt": "Buscar"
},
"apiKeys": {
"label": "Chatbots",

View File

@@ -91,7 +91,15 @@
"parentFolderAlt": "親フォルダ",
"menuAlt": "メニュー",
"tokensUnit": "トークン",
"editAlt": "編集"
"editAlt": "編集",
"uploading": "アップロード中…",
"deleting": "削除中…",
"queued": "キュー: {{count}}",
"addFile": "ファイルを追加",
"uploadingFilesTitle": "ファイルをアップロード中...",
"deletingTitle": "削除中...",
"deleteDirectoryWarning": "ディレクトリ \"{{name}}\" とその内容をすべて削除してもよろしいですか?この操作は元に戻せません。",
"searchAlt": "検索"
},
"apiKeys": {
"label": "チャットボット",

View File

@@ -91,7 +91,15 @@
"parentFolderAlt": "Родительская папка",
"menuAlt": "Меню",
"tokensUnit": "токенов",
"editAlt": "Редактировать"
"editAlt": "Редактировать",
"uploading": "Загрузка…",
"deleting": "Удаление…",
"queued": "В очереди: {{count}}",
"addFile": "Добавить файл",
"uploadingFilesTitle": "Загрузка файлов...",
"deletingTitle": "Удаление...",
"deleteDirectoryWarning": "Вы уверены, что хотите удалить каталог \"{{name}}\" и все его содержимое? Это действие нельзя отменить.",
"searchAlt": "Поиск"
},
"apiKeys": {
"label": "API ключи",

View File

@@ -91,7 +91,15 @@
"parentFolderAlt": "上層資料夾",
"menuAlt": "選單",
"tokensUnit": "Token",
"editAlt": "編輯"
"editAlt": "編輯",
"uploading": "正在上傳…",
"deleting": "正在刪除…",
"queued": "已排隊:{{count}}",
"addFile": "新增檔案",
"uploadingFilesTitle": "正在上傳檔案...",
"deletingTitle": "正在刪除...",
"deleteDirectoryWarning": "您確定要刪除目錄 \"{{name}}\" 及其所有內容嗎?此操作無法復原。",
"searchAlt": "搜尋"
},
"apiKeys": {
"label": "聊天機器人",

View File

@@ -91,7 +91,15 @@
"parentFolderAlt": "父文件夹",
"menuAlt": "菜单",
"tokensUnit": "令牌",
"editAlt": "编辑"
"editAlt": "编辑",
"uploading": "正在上传…",
"deleting": "正在删除…",
"queued": "已排队:{{count}}",
"addFile": "添加文件",
"uploadingFilesTitle": "正在上传文件...",
"deletingTitle": "正在删除...",
"deleteDirectoryWarning": "确定要删除目录 \"{{name}}\" 及其所有内容吗?此操作无法撤销。",
"searchAlt": "搜索"
},
"apiKeys": {
"label": "聊天机器人",

View File

@@ -388,12 +388,12 @@ export default function Sources({
handleMenuClick(e, docId);
}}
className="inline-flex h-[35px] w-[24px] shrink-0 items-center justify-center rounded-md transition-colors hover:bg-[#EBEBEB] dark:hover:bg-[#26272E]"
aria-label="Open menu"
aria-label={t('settings.sources.menuAlt')}
data-testid={`menu-button-${docId}`}
>
<img
src={ThreeDots}
alt={t('Open menu')}
alt={t('settings.sources.menuAlt')}
className="opacity-60 hover:opacity-100"
/>
</button>