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