fix(dm): polish hardcoded strings, typo, and aria-labels
- Fix typo "combatантов" -> "участников боя" in dm-translations
- Replace hardcoded English "Result", "Rolls:", "Invalid notation"
in DiceRoller with translation keys
- Translate English aria-labels ("Quick dice selectors", "Roll history",
"Combatants") to Russian
- Move InitiativeTracker hardcoded strings ("Итого", "Инициатива",
"Порядок хода", help text) into the translation file
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -28,7 +28,7 @@ const quickDice = [
|
||||
class="grid grid-cols-4 sm:grid-cols-7 gap-2"
|
||||
id="quick-dice-grid"
|
||||
role="group"
|
||||
aria-label="Quick dice selectors"
|
||||
aria-label={T.ariaQuickDice}
|
||||
>
|
||||
{
|
||||
quickDice.map((d) => (
|
||||
@@ -64,7 +64,7 @@ const quickDice = [
|
||||
aria-live="polite"
|
||||
>
|
||||
<div class="text-sm text-[var(--text-secondary)] mb-1" id="result-label">
|
||||
Result
|
||||
{T.resultLabel}
|
||||
</div>
|
||||
<div
|
||||
class="text-5xl font-bold text-[var(--gold)]"
|
||||
@@ -126,7 +126,7 @@ const quickDice = [
|
||||
id="history-list"
|
||||
class="space-y-1 max-h-40 overflow-y-auto hidden"
|
||||
role="list"
|
||||
aria-label="Roll history"
|
||||
aria-label={T.ariaRollHistory}
|
||||
>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -315,9 +315,9 @@ const quickDice = [
|
||||
const rolls = result.rolls.join(", ");
|
||||
if (result.modifier !== 0) {
|
||||
const sign = result.modifier > 0 ? "+" : "";
|
||||
detailsEl.textContent = `Rolls: ${rolls} ${sign}${result.modifier}`;
|
||||
detailsEl.textContent = `${T.rollsLabel}: ${rolls} ${sign}${result.modifier}`;
|
||||
} else {
|
||||
detailsEl.textContent = `Rolls: ${rolls}`;
|
||||
detailsEl.textContent = `${T.rollsLabel}: ${rolls}`;
|
||||
}
|
||||
|
||||
totalEl.className = `text-5xl font-bold ${
|
||||
@@ -373,7 +373,7 @@ const quickDice = [
|
||||
totalEl.textContent = "?";
|
||||
totalEl.className = "text-5xl font-bold text-[var(--gold)]";
|
||||
labelEl.textContent = trimmed;
|
||||
detailsEl.textContent = "Invalid notation";
|
||||
detailsEl.textContent = T.invalidNotation;
|
||||
if (critMsg) {
|
||||
critMsg.className = "text-sm font-semibold mt-1 hidden";
|
||||
}
|
||||
|
||||
@@ -47,13 +47,13 @@ import { dmTranslations as T } from "@/i18n/dm-translations";
|
||||
id="it-initiative"
|
||||
name="initiative"
|
||||
type="number"
|
||||
placeholder="Итого"
|
||||
label="Инициатива"
|
||||
placeholder={T.initiativeTotal}
|
||||
label={T.initiative}
|
||||
class="sm:max-w-[120px]"
|
||||
dataTestid="init-initiative-input"
|
||||
/>
|
||||
<span class="text-xs text-[var(--text-secondary)]">
|
||||
Бросок d20 + модификатор, или введите итог вручную
|
||||
{T.initiativeHelp}
|
||||
</span>
|
||||
</div>
|
||||
</DmCard>
|
||||
@@ -64,14 +64,14 @@ import { dmTranslations as T } from "@/i18n/dm-translations";
|
||||
<DmCard>
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<h3 class="text-sm font-semibold text-[var(--text-primary)] uppercase tracking-wider">
|
||||
Порядок хода
|
||||
{T.turnOrder}
|
||||
</h3>
|
||||
<DmButton id="it-clear-btn" variant="secondary" size="sm">
|
||||
{T.actionClear}
|
||||
</DmButton>
|
||||
</div>
|
||||
|
||||
<ul id="it-list" class="space-y-2" role="list" aria-label="Combatants"></ul>
|
||||
<ul id="it-list" class="space-y-2" role="list" aria-label={T.ariaCombatants}></ul>
|
||||
|
||||
<div id="it-announcer" aria-live="polite" class="sr-only"></div>
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ export const dmTranslations = {
|
||||
|
||||
// Empty states
|
||||
emptyDiceHistory: "Нет истории бросков",
|
||||
emptyCombatants: "Нет combatантов",
|
||||
emptyCombatants: "Нет участников боя",
|
||||
emptySearchResults: "Ничего не найдено",
|
||||
emptyNotesPlaceholder: "Начните писать заметки...",
|
||||
|
||||
@@ -63,6 +63,17 @@ export const dmTranslations = {
|
||||
rollHistory: "История бросков",
|
||||
criticalHit: "Критический успех!",
|
||||
criticalFail: "Критический провал!",
|
||||
resultLabel: "Результат",
|
||||
rollsLabel: "Броски",
|
||||
invalidNotation: "Неверная нотация",
|
||||
ariaQuickDice: "Быстрый выбор кубика",
|
||||
ariaRollHistory: "История бросков",
|
||||
|
||||
// Initiative
|
||||
turnOrder: "Порядок хода",
|
||||
initiativeTotal: "Итого",
|
||||
initiativeHelp: "Бросок d20 + модификатор, или введите итог вручную",
|
||||
ariaCombatants: "Участники боя",
|
||||
|
||||
// Auth
|
||||
loginVk: "Войти через VK",
|
||||
|
||||
Reference in New Issue
Block a user