i18 cleanup

This commit is contained in:
2026-02-25 18:31:50 +03:00
parent 31cdc7958d
commit 31341d083f
48 changed files with 1431 additions and 808 deletions

View File

@@ -50,10 +50,10 @@
`/git/repositories/${dashboardId}/generate-message`,
);
message = data.message;
toast($t.git?.commit_message_generated || "Commit message generated", "success");
toast($t.git?.commit_message_generated, "success");
} catch (e) {
console.error(`[CommitModal][Coherence:Failed] ${e.message}`);
toast(e.message || ($t.git?.commit_message_failed || "Failed to generate message"), "error");
toast(e.message || $t.git?.commit_message_failed, "error");
} finally {
generatingMessage = false;
}
@@ -94,7 +94,7 @@
if (!diff) diff = "";
} catch (e) {
console.error(`[CommitModal][Coherence:Failed] ${e.message}`);
toast($t.git?.load_changes_failed || "Failed to load changes", "error");
toast($t.git?.load_changes_failed, "error");
} finally {
loading = false;
}
@@ -115,7 +115,7 @@
committing = true;
try {
await gitService.commit(dashboardId, message, []);
toast($t.git?.commit_success || "Changes committed successfully", "success");
toast($t.git?.commit_success, "success");
dispatch("commit");
show = false;
message = "";
@@ -142,7 +142,7 @@
<div
class="bg-white p-6 rounded-lg shadow-xl w-full max-w-4xl max-h-[90vh] flex flex-col"
>
<h2 class="text-xl font-bold mb-4">{$t.git?.commit || "Commit Changes"}</h2>
<h2 class="text-xl font-bold mb-4">{$t.git?.commit}</h2>
<div class="flex flex-col md:flex-row gap-4 flex-1 overflow-hidden">
<!-- Left: Message and Files -->
@@ -151,7 +151,7 @@
<div class="flex justify-between items-center mb-1">
<label
class="block text-sm font-medium text-gray-700"
>{$t.git?.commit_message || "Commit Message"}</label
>{$t.git?.commit_message}</label
>
<button
onclick={handleGenerateMessage}
@@ -159,16 +159,16 @@
class="text-xs text-blue-600 hover:text-blue-800 disabled:opacity-50 flex items-center"
>
{#if generatingMessage}
<span class="animate-spin mr-1"></span> {$t.mapper?.generating || "Generating..."}
<span class="animate-spin mr-1"></span> {$t.mapper?.generating}
{:else}
<span class="mr-1"></span> {$t.git?.generate_with_ai || "Generate with AI"}
<span class="mr-1"></span> {$t.git?.generate_with_ai}
{/if}
</button>
</div>
<textarea
bind:value={message}
class="w-full border rounded p-2 h-32 focus:ring-2 focus:ring-blue-500 outline-none resize-none"
placeholder={$t.git?.describe_changes || "Describe your changes..."}
placeholder={$t.git?.describe_changes}
></textarea>
</div>
@@ -177,13 +177,13 @@
<h3
class="text-sm font-bold text-gray-500 uppercase mb-2"
>
{$t.git?.changed_files || "Changed Files"}
{$t.git?.changed_files}
</h3>
<ul class="text-xs space-y-1">
{#each status.staged_files as file}
<li
class="text-green-600 flex items-center font-semibold"
title="Staged"
title={$t.git?.staged}
>
<span class="mr-2">S</span>
{file}
@@ -192,7 +192,7 @@
{#each status.modified_files as file}
<li
class="text-yellow-600 flex items-center"
title="Modified (Unstaged)"
title={$t.git?.modified_unstaged}
>
<span class="mr-2">M</span>
{file}
@@ -201,7 +201,7 @@
{#each status.untracked_files as file}
<li
class="text-blue-600 flex items-center"
title="Untracked"
title={$t.git?.untracked}
>
<span class="mr-2">?</span>
{file}
@@ -219,14 +219,14 @@
<div
class="bg-gray-200 px-3 py-1 text-xs font-bold text-gray-600 border-b"
>
{$t.git?.changes_preview || "Changes Preview"}
{$t.git?.changes_preview}
</div>
<div class="flex-1 overflow-auto p-2">
{#if loading}
<div
class="flex items-center justify-center h-full text-gray-500"
>
{$t.git?.loading_diff || "Loading diff..."}
{$t.git?.loading_diff}
</div>
{:else if diff}
<pre
@@ -235,7 +235,7 @@
<div
class="flex items-center justify-center h-full text-gray-500 italic"
>
{$t.git?.no_changes || "No changes detected"}
{$t.git?.no_changes}
</div>
{/if}
</div>
@@ -247,7 +247,7 @@
onclick={() => (show = false)}
class="px-4 py-2 text-gray-600 hover:bg-gray-100 rounded"
>
{$t.common?.cancel || "Cancel"}
{$t.common?.cancel}
</button>
<button
onclick={handleCommit}
@@ -258,7 +258,7 @@
status?.staged_files?.length === 0)}
class="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50"
>
{committing ? ($t.git?.committing || "Committing...") : ($t.git?.commit || "Commit")}
{committing ? $t.git?.committing : $t.git?.commit}
</button>
</div>
</div>