i18 cleanup

This commit is contained in:
2026-02-25 18:31:50 +03:00
parent 3f66a58b12
commit 1d8eadf796
48 changed files with 1431 additions and 808 deletions

View File

@@ -260,8 +260,8 @@
function buildConversationTitle(conversation) {
if (conversation?.title?.trim()) return conversation.title.trim();
if (!conversation?.conversation_id) return "Conversation";
return `Conversation ${conversation.conversation_id.slice(0, 8)}`;
if (!conversation?.conversation_id) return $t.assistant?.conversation;
return `${$t.assistant?.conversation} ${conversation.conversation_id.slice(0, 8)}`;
}
function setConversationFilter(filter) {
@@ -312,7 +312,7 @@
} catch (err) {
appendAssistantResponse({
response_id: `error-${Date.now()}`,
text: err.message || "Assistant request failed",
text: err.message || $t.assistant?.request_failed,
state: "failed",
created_at: new Date().toISOString(),
actions: [],
@@ -402,7 +402,7 @@
} catch (err) {
appendAssistantResponse({
response_id: `action-error-${Date.now()}`,
text: err.message || "Action failed",
text: err.message || $t.assistant?.action_failed,
state: "failed",
created_at: new Date().toISOString(),
actions: [],
@@ -484,13 +484,13 @@
<div class="flex items-center gap-2 text-slate-800">
<Icon name="clipboard" size={18} />
<h2 class="text-sm font-semibold">
{$t.assistant?.title || "AI Assistant"}
{$t.assistant?.title}
</h2>
</div>
<button
class="rounded-md p-1 text-slate-500 transition hover:bg-slate-100 hover:text-slate-900"
on:click={closeAssistantChat}
aria-label={$t.assistant?.close || "Close assistant"}
aria-label={$t.assistant?.close}
>
<Icon name="close" size={18} />
</button>
@@ -501,13 +501,13 @@
<div class="mb-2 flex items-center justify-between">
<span
class="text-xs font-semibold uppercase tracking-wide text-slate-500"
>Conversations</span
>{$t.assistant?.conversations}</span
>
<button
class="rounded-md border border-slate-300 px-2 py-1 text-[11px] font-medium text-slate-700 transition hover:bg-slate-100"
on:click={startNewConversation}
>
New
{$t.assistant?.new}
</button>
</div>
<div class="mb-2 flex items-center gap-1">
@@ -518,7 +518,7 @@
: 'border-slate-300 bg-white text-slate-700 hover:bg-slate-100'}"
on:click={() => setConversationFilter("active")}
>
Active ({activeConversationsTotal})
{$t.assistant?.active} ({activeConversationsTotal})
</button>
<button
class="rounded-md border px-2 py-1 text-[11px] font-medium transition {conversationFilter ===
@@ -527,7 +527,7 @@
: 'border-slate-300 bg-white text-slate-700 hover:bg-slate-100'}"
on:click={() => setConversationFilter("archived")}
>
Archived ({archivedConversationsTotal})
{$t.assistant?.archived} ({archivedConversationsTotal})
</button>
</div>
<div class="flex gap-2 overflow-x-auto pb-1">
@@ -560,7 +560,7 @@
class="rounded-lg border border-slate-300 px-2.5 py-1.5 text-xs font-medium text-slate-700 transition hover:bg-slate-100"
on:click={() => loadConversations(false)}
>
More
{$t.assistant?.more}
</button>
{/if}
</div>
@@ -575,24 +575,24 @@
<div
class="rounded-lg border border-slate-200 bg-slate-50 p-2 text-center text-xs text-slate-500"
>
Loading older messages...
{$t.assistant?.loading_older}
</div>
{/if}
{#if loadingHistory}
<div
class="rounded-lg border border-slate-200 bg-slate-50 p-3 text-sm text-slate-600"
>
{$t.assistant?.loading_history || "Loading history..."}
{$t.assistant?.loading_history}
</div>
{:else if messages.length === 0}
<div
class="rounded-lg border border-slate-200 bg-slate-50 p-3 text-sm text-slate-600"
>
{$t.assistant?.try_commands || "Try commands:"}
{$t.assistant?.try_commands}
<div class="mt-2 space-y-1 text-xs">
<div>сделай ветку feature/new-dashboard для дашборда 42</div>
<div>запусти миграцию с dev на prod для дашборда 42</div>
<div>проверь статус задачи task-123</div>
<div>{$t.assistant?.sample_command_branch}</div>
<div>{$t.assistant?.sample_command_migration}</div>
<div>{$t.assistant?.sample_command_status}</div>
</div>
</div>
{/if}
@@ -608,7 +608,7 @@
<span
class="text-[11px] font-semibold uppercase tracking-wide text-slate-500"
>
{message.role === "user" ? "You" : "Assistant"}
{message.role === "user" ? $t.assistant?.you : $t.assistant?.assistant}
</span>
{#if message.state}
<span
@@ -629,13 +629,13 @@
<div class="mt-2 flex items-center gap-2">
<span
class="rounded border border-slate-200 bg-slate-50 px-2 py-0.5 text-xs text-slate-700"
>task_id: {message.task_id}</span
>{$t.assistant?.task_id}: {message.task_id}</span
>
<button
class="text-xs font-medium text-sky-700 hover:text-sky-900"
on:click={() => openDrawerForTask(message.task_id)}
>
{$t.assistant?.open_task_drawer || "Open Task Drawer"}
{$t.assistant?.open_task_drawer}
</button>
</div>
{/if}
@@ -668,11 +668,11 @@
<span
class="text-[11px] font-semibold uppercase tracking-wide text-slate-500"
>
Assistant
{$t.assistant?.assistant}
</span>
</div>
<div class="flex items-center gap-2 text-sm text-slate-700">
<span>{$t.assistant?.thinking || "Думаю"}</span>
<span>{$t.assistant?.thinking}</span>
<span class="thinking-dots" aria-hidden="true">
<span></span><span></span><span></span>
</span>
@@ -687,7 +687,7 @@
<textarea
bind:value={input}
rows="2"
placeholder={$t.assistant?.input_placeholder || "Type a command..."}
placeholder={$t.assistant?.input_placeholder}
class="min-h-[52px] w-full resize-y rounded-lg border border-slate-300 px-3 py-2 text-sm outline-none transition focus:border-sky-400 focus:ring-2 focus:ring-sky-100"
on:keydown={handleKeydown}
></textarea>
@@ -696,7 +696,7 @@
on:click={handleSend}
disabled={loading || !input.trim()}
>
{loading ? "..." : $t.assistant?.send || "Send"}
{loading ? "..." : $t.assistant?.send}
</button>
</div>
</div>