i18 cleanup

This commit is contained in:
2026-02-25 18:31:50 +03:00
parent 99f19ac305
commit 5d42a6b930
48 changed files with 1431 additions and 808 deletions

View File

@@ -48,7 +48,7 @@
]);
console.log('[AdminRolesPage][loadData][Coherence:OK]');
} catch (e) {
error = "Failed to load roles data.";
error = $t.admin?.roles?.load_failed ;
console.error('[AdminRolesPage][loadData][Coherence:Failed]', e);
} finally {
loading = false;
@@ -108,7 +108,7 @@
await loadData();
console.log('[AdminRolesPage][handleSaveRole][Coherence:OK]');
} catch (e) {
alert("Failed to save role: " + e.message);
alert(($t.admin?.roles?.save_failed ).replace('{error}', e.message));
console.error('[AdminRolesPage][handleSaveRole][Coherence:Failed]', e);
}
}
@@ -129,7 +129,7 @@
await loadData();
console.log('[AdminRolesPage][handleDeleteRole][Coherence:OK]');
} catch (e) {
alert("Failed to delete role: " + e.message);
alert(($t.admin?.roles?.delete_failed ).replace('{error}', e.message));
console.error('[AdminRolesPage][handleDeleteRole][Coherence:Failed]', e);
}
}
@@ -231,4 +231,4 @@
</ProtectedRoute>
<!-- [/DEF:AdminRolesPage:Component] -->
<!-- [/DEF:AdminRolesPage:Component] -->

View File

@@ -67,7 +67,7 @@
console.log('[AdminSettingsPage][loadData][Coherence:OK]');
} catch (e) {
error = "Failed to load roles or configuration.";
error = $t.admin?.settings?.load_failed ;
console.error('[AdminSettingsPage][loadData][Coherence:Failed]', e);
} finally {
loading = false;
@@ -89,7 +89,7 @@
// Guard Clause (@PRE)
if (!newMapping.ad_group || !newMapping.role_id) {
alert("Please fill in all fields.");
alert($t.admin?.settings?.fill_all_fields );
return;
}
@@ -101,7 +101,10 @@
await loadData();
console.log('[AdminSettingsPage][handleCreateMapping][Coherence:OK]');
} catch (e) {
alert("Failed to create mapping: " + (e.message || "Unknown error"));
alert(
($t.admin?.settings?.create_mapping_failed )
.replace('{error}', e.message || ($t.common?.unknown )),
);
console.error('[AdminSettingsPage][handleCreateMapping][Coherence:Failed]', e);
}
}
@@ -153,7 +156,10 @@
// Reset saved indicator after 2 seconds
setTimeout(() => { loggingConfigSaved = false; }, 2000);
} catch (e) {
alert("Failed to save logging configuration: " + (e.message || "Unknown error"));
alert(
($t.admin?.settings?.save_logging_failed )
.replace('{error}', e.message || ($t.common?.unknown )),
);
console.error('[AdminSettingsPage][saveLoggingConfig][Coherence:Failed]', e);
} finally {
loggingConfigSaving = false;
@@ -228,17 +234,17 @@
<!-- [SECTION: LOGGING_CONFIG_UI] -->
<div class="mt-8 bg-white shadow rounded-lg border border-gray-200 p-6">
<h2 class="text-xl font-bold mb-4 text-gray-800">Logging Configuration</h2>
<h2 class="text-xl font-bold mb-4 text-gray-800">{$t.settings?.logging }</h2>
{#if loggingConfigLoading}
<div class="flex justify-center py-4">
<p class="text-gray-500 animate-pulse">Loading logging configuration...</p>
<p class="text-gray-500 animate-pulse">{$t.admin?.settings?.loading_logging }</p>
</div>
{:else}
<div class="space-y-4">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Application Log Level</label>
<label class="block text-sm font-medium text-gray-700 mb-1">{$t.admin?.settings?.app_log_level }</label>
<select
bind:value={loggingConfig.level}
class="w-full border border-gray-300 p-2 rounded focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
@@ -247,11 +253,11 @@
<option value={level}>{level}</option>
{/each}
</select>
<p class="text-xs text-gray-500 mt-1">Controls the verbosity of application logs.</p>
<p class="text-xs text-gray-500 mt-1">{$t.admin?.settings?.app_log_level_hint }</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Task Log Level</label>
<label class="block text-sm font-medium text-gray-700 mb-1">{$t.settings?.task_log_level }</label>
<select
bind:value={loggingConfig.task_log_level}
class="w-full border border-gray-300 p-2 rounded focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
@@ -260,7 +266,7 @@
<option value={level}>{level}</option>
{/each}
</select>
<p class="text-xs text-gray-500 mt-1">Minimum level for logs stored in task history. DEBUG shows all logs.</p>
<p class="text-xs text-gray-500 mt-1">{$t.admin?.settings?.task_log_level_hint }</p>
</div>
</div>
@@ -272,10 +278,10 @@
class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"
/>
<label for="enable_belief_state" class="ml-2 block text-sm text-gray-700">
Enable Belief State Logging (Entry/Exit/Coherence logs)
{$t.settings?.enable_belief_state }
</label>
</div>
<p class="text-xs text-gray-500 -mt-2">When disabled, belief scope logs are hidden. Requires DEBUG level to see in task logs.</p>
<p class="text-xs text-gray-500 -mt-2">{$t.admin?.settings?.belief_state_hint }</p>
<div class="flex items-center gap-3 pt-2">
<button
@@ -283,10 +289,10 @@
disabled={loggingConfigSaving}
class="px-4 py-2 bg-blue-600 text-white rounded font-medium hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed transition-colors"
>
{loggingConfigSaving ? 'Saving...' : 'Save Configuration'}
{loggingConfigSaving ? ($t.settings?.saving ) : ($t.admin?.settings?.save_configuration )}
</button>
{#if loggingConfigSaved}
<span class="text-green-600 text-sm font-medium">Saved</span>
<span class="text-green-600 text-sm font-medium">{$t.admin?.settings?.saved }</span>
{/if}
</div>
</div>
@@ -305,7 +311,7 @@
type="text"
bind:value={newMapping.ad_group}
class="w-full border border-gray-300 p-2 rounded focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
placeholder="e.g. CN=SS_ADMINS,OU=Groups,DC=org"
placeholder={$t.admin?.settings?.ad_group_placeholder }
required
/>
<p class="text-xs text-gray-500 mt-1">{$t.admin.settings.ad_group_hint}</p>
@@ -347,4 +353,4 @@
</ProtectedRoute>
<!-- [/DEF:AdminSettingsPage:Component] -->
<!-- [/DEF:AdminSettingsPage:Component] -->

View File

@@ -109,10 +109,10 @@
},
};
await requestApi('/settings/consolidated', 'PATCH', payload);
addToast($t.settings?.save_success || 'Settings saved', 'success');
addToast($t.settings?.save_success , 'success');
} catch (err) {
console.error('[LLMSettingsPage][Coherence:Failed] Failed to save llm settings', err);
addToast($t.settings?.save_failed || 'Failed to save settings', 'error');
addToast($t.settings?.save_failed , 'error');
} finally {
savingPrompts = false;
}
@@ -123,9 +123,10 @@
<div class="max-w-4xl mx-auto py-8 px-4">
<div class="mb-8">
<h1 class="text-3xl font-bold text-gray-900">LLM Settings</h1>
<h1 class="text-3xl font-bold text-gray-900">{$t.settings?.llm }</h1>
<p class="mt-2 text-gray-600">
Configure LLM providers for dashboard validation, documentation generation, and git assistance.
{$t.settings?.llm_description ||
"Configure LLM providers for dashboard validation, documentation generation, and git assistance."}
</p>
</div>
@@ -138,7 +139,7 @@
<div class="mt-6 rounded-lg border border-gray-200 bg-white p-4">
<h2 class="text-lg font-semibold text-gray-900">
{$t.settings?.llm_chatbot_settings_title || 'Chatbot Planner Settings'}
{$t.settings?.llm_chatbot_settings_title }
</h2>
<p class="mt-1 text-sm text-gray-600">
{$t.settings?.llm_chatbot_settings_description ||
@@ -148,14 +149,14 @@
<div class="mt-4 grid grid-cols-1 gap-4 md:grid-cols-2">
<div>
<label for="admin-planner-provider" class="block text-sm font-medium text-gray-700">
{$t.settings?.llm_chatbot_provider || 'Chatbot Provider'}
{$t.settings?.llm_chatbot_provider }
</label>
<select
id="admin-planner-provider"
bind:value={plannerProvider}
class="mt-1 block w-full rounded-md border border-gray-300 p-2 text-sm"
>
<option value="">{$t.dashboard?.use_default || 'Use Default'}</option>
<option value="">{$t.dashboard?.use_default }</option>
{#each providers as provider}
<option value={provider.id}>
{provider.name} ({provider.default_model})
@@ -166,13 +167,13 @@
<div>
<label for="admin-planner-model" class="block text-sm font-medium text-gray-700">
{$t.settings?.llm_chatbot_model || 'Chatbot Model Override'}
{$t.settings?.llm_chatbot_model }
</label>
<input
id="admin-planner-model"
type="text"
bind:value={plannerModel}
placeholder={$t.settings?.llm_chatbot_model_placeholder || 'Optional, e.g. gpt-4.1-mini'}
placeholder={$t.settings?.llm_chatbot_model_placeholder }
class="mt-1 block w-full rounded-md border border-gray-300 p-2 text-sm"
/>
</div>
@@ -181,7 +182,7 @@
<div class="mt-6 rounded-lg border border-gray-200 bg-white p-4">
<h2 class="text-lg font-semibold text-gray-900">
{$t.settings?.llm_provider_bindings_title || 'Provider Bindings by Task'}
{$t.settings?.llm_provider_bindings_title }
</h2>
<p class="mt-1 text-sm text-gray-600">
{$t.settings?.llm_provider_bindings_description ||
@@ -191,14 +192,14 @@
<div class="mt-4 grid grid-cols-1 gap-4 md:grid-cols-2">
<div>
<label for="admin-binding-dashboard-validation" class="block text-sm font-medium text-gray-700">
{$t.settings?.llm_binding_dashboard_validation || 'Dashboard Validation Provider'}
{$t.settings?.llm_binding_dashboard_validation }
</label>
<select
id="admin-binding-dashboard-validation"
bind:value={bindings.dashboard_validation}
class="mt-1 block w-full rounded-md border border-gray-300 p-2 text-sm"
>
<option value="">{$t.dashboard?.use_default || 'Use Default'}</option>
<option value="">{$t.dashboard?.use_default }</option>
{#each providers as provider}
<option value={provider.id}>
{provider.name} ({provider.default_model})
@@ -215,14 +216,14 @@
<div>
<label for="admin-binding-documentation" class="block text-sm font-medium text-gray-700">
{$t.settings?.llm_binding_documentation || 'Documentation Provider'}
{$t.settings?.llm_binding_documentation }
</label>
<select
id="admin-binding-documentation"
bind:value={bindings.documentation}
class="mt-1 block w-full rounded-md border border-gray-300 p-2 text-sm"
>
<option value="">{$t.dashboard?.use_default || 'Use Default'}</option>
<option value="">{$t.dashboard?.use_default }</option>
{#each providers as provider}
<option value={provider.id}>
{provider.name} ({provider.default_model})
@@ -233,14 +234,14 @@
<div class="md:col-span-2">
<label for="admin-binding-git-commit" class="block text-sm font-medium text-gray-700">
{$t.settings?.llm_binding_git_commit || 'Git Commit Provider'}
{$t.settings?.llm_binding_git_commit }
</label>
<select
id="admin-binding-git-commit"
bind:value={bindings.git_commit}
class="mt-1 block w-full rounded-md border border-gray-300 p-2 text-sm"
>
<option value="">{$t.dashboard?.use_default || 'Use Default'}</option>
<option value="">{$t.dashboard?.use_default }</option>
{#each providers as provider}
<option value={provider.id}>
{provider.name} ({provider.default_model})
@@ -253,7 +254,7 @@
<div class="mt-6 rounded-lg border border-gray-200 bg-gray-50 p-4">
<h2 class="text-lg font-semibold text-gray-900">
{$t.settings?.llm_prompts_title || 'LLM Prompt Templates'}
{$t.settings?.llm_prompts_title }
</h2>
<p class="mt-1 text-sm text-gray-600">
{$t.settings?.llm_prompts_description ||
@@ -263,7 +264,7 @@
<div class="mt-4 space-y-4">
<div>
<label for="admin-documentation-prompt" class="block text-sm font-medium text-gray-700">
{$t.settings?.llm_prompt_documentation || 'Documentation Prompt'}
{$t.settings?.llm_prompt_documentation }
</label>
<textarea
id="admin-documentation-prompt"
@@ -275,7 +276,7 @@
<div>
<label for="admin-dashboard-validation-prompt" class="block text-sm font-medium text-gray-700">
{$t.settings?.llm_prompt_dashboard_validation || 'Dashboard Validation Prompt'}
{$t.settings?.llm_prompt_dashboard_validation }
</label>
<textarea
id="admin-dashboard-validation-prompt"
@@ -287,7 +288,7 @@
<div>
<label for="admin-git-commit-prompt" class="block text-sm font-medium text-gray-700">
{$t.settings?.llm_prompt_git_commit || 'Git Commit Prompt'}
{$t.settings?.llm_prompt_git_commit }
</label>
<textarea
id="admin-git-commit-prompt"
@@ -304,7 +305,7 @@
disabled={savingPrompts}
on:click={saveSettings}
>
{savingPrompts ? '...' : ($t.settings?.save_llm_prompts || 'Save LLM Prompts')}
{savingPrompts ? '...' : ($t.settings?.save_llm_prompts )}
</button>
</div>
</div>

View File

@@ -50,7 +50,7 @@
]);
console.log('[AdminUsersPage][loadData][Coherence:OK]');
} catch (e) {
error = "Failed to load admin data.";
error = $t.admin?.users?.load_failed ;
console.error('[AdminUsersPage][loadData][Coherence:Failed]', e);
} finally {
loading = false;
@@ -115,7 +115,7 @@
await loadData();
console.log('[AdminUsersPage][handleSaveUser][Coherence:OK]');
} catch (e) {
alert("Failed to save user: " + e.message);
alert(($t.admin?.users?.save_failed ).replace('{error}', e.message));
console.error('[AdminUsersPage][handleSaveUser][Coherence:Failed]', e);
}
}
@@ -141,7 +141,7 @@
await loadData();
console.log('[AdminUsersPage][handleDeleteUser][Coherence:OK]');
} catch (e) {
alert("Failed to delete user: " + e.message);
alert(($t.admin?.users?.delete_failed ).replace('{error}', e.message));
console.error('[AdminUsersPage][handleDeleteUser][Coherence:Failed]', e);
} finally {
deletingUserId = null;
@@ -219,7 +219,7 @@
class="text-red-600 hover:text-red-900 disabled:opacity-50"
disabled={deletingUserId === user.id}
>
{deletingUserId === user.id ? ($t.common.deleting || 'Deleting...') : $t.common.delete}
{deletingUserId === user.id ? ($t.common.deleting ) : $t.common.delete}
</button>
</td>
</tr>