ui: improve localization and plural handling

This commit is contained in:
a.tolmachev
2026-04-12 01:24:09 +03:00
parent 4dffad603f
commit fa75393e5f
5 changed files with 158 additions and 69 deletions
+6 -4
View File
@@ -265,7 +265,7 @@ document.addEventListener('DOMContentLoaded', function () {
'<td>' + secretKindLabel(secret.kind) + '</td>',
'<td class="col-mono">v' + secret.current_version + '</td>',
'<td>' + (secret.last_used_at ? formatDate(secret.last_used_at) : tKey('secrets.last_used.never')) + '</td>',
'<td>' + tfKey('secrets.used_by_count', { count: references.length }) + '</td>',
'<td>' + window.tPlural('secrets.used_by_count', references.length, { count: references.length }) + '</td>',
'<td><span class="badge ' + (secret.status === 'disabled' ? 'badge-revoked' : 'badge-active') + '">' + tKey('secrets.status.' + secret.status) + '</span></td>',
'<td class="col-actions"></td>'
].join('');
@@ -298,9 +298,11 @@ document.addEventListener('DOMContentLoaded', function () {
secretsById[secret.id] = secret;
});
profilesSummary.textContent = tfKey('secrets.profiles.subtitle_count', {
count: state.profiles.length,
});
profilesSummary.textContent = window.tPlural(
'secrets.profiles.subtitle_count',
state.profiles.length,
{ count: state.profiles.length }
);
if (state.error) {
profilesList.innerHTML = '<div class="empty-state"><div class="empty-state-title">' + tKey('secrets.profiles.error_title') + '</div><div class="empty-state-text">' + state.error + '</div></div>';