Skip to content

Commit 703d026

Browse files
committed
add russian translations
1 parent 4de1525 commit 703d026

7 files changed

Lines changed: 88 additions & 18 deletions

File tree

src/lib/BottomNav.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@
105105
font-family: 'Barlow Condensed', sans-serif;
106106
font-size: 9px;
107107
font-weight: 600;
108-
letter-spacing: 1px;
108+
letter-spacing: 0.5px;
109109
text-transform: uppercase;
110+
text-align: center;
111+
white-space: normal;
112+
line-height: 1.1;
113+
word-break: break-word;
110114
}
111115
</style>

src/lib/HeroSelect.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script>
22
import { getHeroIconUrl } from './heroes.js';
3+
import { _ } from "svelte-i18n";
34
45
let {
56
value = $bindable(''),
@@ -138,7 +139,7 @@
138139
</div>
139140
140141
{#if groupOptions.length > 0}
141-
<div class="group-label">By Role</div>
142+
<div class="group-label">{$_('hero_select.by_role')}</div>
142143
{#each groupOptions as opt}
143144
<div
144145
class="hero-option"
@@ -155,13 +156,13 @@
155156
{/if}
156157
157158
{#if favoriteHeroList.length > 0}
158-
<div class="group-label">⭐ Favorites</div>
159+
<div class="group-label">{$_('hero_select.favorites')}</div>
159160
{#each favoriteHeroList as hero (hero.id)}
160161
{@render heroOptionRow(hero, hero.id == value)}
161162
{/each}
162163
{/if}
163164
164-
<div class="group-label">All Heroes</div>
165+
<div class="group-label">{$_('hero_select.all_heroes')}</div>
165166
{#each otherHeroList as hero (hero.id)}
166167
{@render heroOptionRow(hero, hero.id == value)}
167168
{/each}

src/lib/locales/en.json

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,17 @@
275275
"filter_daily": "Daily",
276276
"history_loading": "Loading history...",
277277
"history_empty": "No challenge history yet. Complete some challenges to see them here!",
278-
"week_of": "Week of {date}"
278+
"week_of": "Week of {date}",
279+
"desc_kills": "Get {n}+ kills in one game",
280+
"desc_gpm": "Achieve {n}+ GPM in one game",
281+
"desc_low_deaths": "Die {n} times or less in one game",
282+
"desc_hero_damage": "Deal {n}+ hero damage in one game",
283+
"desc_cs_at_10": "Get {n}+ CS at 10 minutes",
284+
"desc_kills_total": "Get {n}+ total kills this week",
285+
"desc_avg_gpm": "Average {n}+ GPM across {g} games",
286+
"desc_low_deaths_games": "Die {n} or fewer times in {g} games",
287+
"desc_hero_damage_total": "Deal {n}+ total hero damage this week",
288+
"desc_cs_at_10_avg": "Average {n}+ CS at 10 minutes across {g} games"
279289
},
280290
"mental_health": {
281291
"title": "Mental Wellbeing",
@@ -488,6 +498,19 @@
488498
"saving": "Saving..."
489499
},
490500
"hero_select": {
491-
"any_hero": "Any Hero"
501+
"any_hero": "Any Hero",
502+
"by_role": "By Role",
503+
"favorites": "⭐ Favorites",
504+
"all_heroes": "All Heroes"
505+
},
506+
"goals_detail": {
507+
"hero_filter": "Hero",
508+
"all_heroes": "All Heroes",
509+
"period": "Period",
510+
"period_7d": "Last 7 Days",
511+
"period_30d": "Last 30 Days",
512+
"period_1y": "Last Year",
513+
"reset": "Reset",
514+
"distribution": "Distribution"
492515
}
493516
}

src/lib/locales/ru.json

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,17 @@
275275
"filter_daily": "Ежедневные",
276276
"history_loading": "Загрузка истории...",
277277
"history_empty": "Историй испытаний пока нет. Выполните испытания, чтобы увидеть их здесь!",
278-
"week_of": "Неделя от {date}"
278+
"week_of": "Неделя от {date}",
279+
"desc_kills": "Получить {n}+ убийств за игру",
280+
"desc_gpm": "Достичь {n}+ GPM за игру",
281+
"desc_low_deaths": "Умереть {n} раз или меньше за игру",
282+
"desc_hero_damage": "Нанести {n}+ урона героям за игру",
283+
"desc_cs_at_10": "Получить {n}+ CS к 10 минутам",
284+
"desc_kills_total": "Получить {n}+ убийств за неделю",
285+
"desc_avg_gpm": "Средний {n}+ GPM за {g} игр",
286+
"desc_low_deaths_games": "Умирать {n} раз или меньше в {g} играх",
287+
"desc_hero_damage_total": "Нанести {n}+ урона героям за неделю",
288+
"desc_cs_at_10_avg": "Средний {n}+ CS к 10 минутам за {g} игр"
279289
},
280290
"mental_health": {
281291
"title": "Психологическое здоровье",
@@ -488,6 +498,19 @@
488498
"saving": "Сохранение..."
489499
},
490500
"hero_select": {
491-
"any_hero": "Любой герой"
501+
"any_hero": "Любой герой",
502+
"by_role": "По роли",
503+
"favorites": "⭐ Избранные",
504+
"all_heroes": "Все герои"
505+
},
506+
"goals_detail": {
507+
"hero_filter": "Герой",
508+
"all_heroes": "Все герои",
509+
"period": "Период",
510+
"period_7d": "7 дней",
511+
"period_30d": "30 дней",
512+
"period_1y": "Год",
513+
"reset": "Сбросить",
514+
"distribution": "Распределение"
492515
}
493516
}

src/routes/challenges/+page.svelte

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,25 @@
104104
if (target <= 0) return 0;
105105
return Math.min(100, Math.round((current / target) * 100));
106106
}
107+
108+
function challengeDesc(metric, target, targetGames, fallback) {
109+
const g = targetGames ?? 5;
110+
const keyMap = {
111+
kills: 'challenges.desc_kills',
112+
gpm: 'challenges.desc_gpm',
113+
low_deaths: 'challenges.desc_low_deaths',
114+
hero_damage: 'challenges.desc_hero_damage',
115+
cs_at_10: 'challenges.desc_cs_at_10',
116+
kills_total: 'challenges.desc_kills_total',
117+
avg_gpm: 'challenges.desc_avg_gpm',
118+
low_deaths_games: 'challenges.desc_low_deaths_games',
119+
hero_damage_total: 'challenges.desc_hero_damage_total',
120+
cs_at_10_avg: 'challenges.desc_cs_at_10_avg',
121+
};
122+
const key = keyMap[metric];
123+
if (!key) return fallback;
124+
return $_( key, { values: { n: target, g } });
125+
}
107126
</script>
108127
109128
<div class="challenges-content">
@@ -129,7 +148,7 @@
129148
<div class="difficulty-badge" style="color: {difficultyColor(activeChallenge.challenge_type)}">
130149
{difficultyTKey(activeChallenge.challenge_type) ? $_(difficultyTKey(activeChallenge.challenge_type)) : activeChallenge.challenge_type}
131150
</div>
132-
<h2>{activeChallenge.challenge_description}</h2>
151+
<h2>{challengeDesc(activeChallenge.metric, activeChallenge.challenge_target, activeChallenge.challenge_target_games, activeChallenge.challenge_description)}</h2>
133152
{#if activeChallenge.hero_id !== null}
134153
<p class="hero-label">{$_('challenges.hero_label', { values: { name: getHeroName(activeChallenge.hero_id) } })}</p>
135154
{/if}
@@ -204,7 +223,7 @@
204223
</span>
205224
<span class="option-type">{option.metric.replace(/_/g, ' ')}</span>
206225
</div>
207-
<p class="option-description">{option.challenge_description}</p>
226+
<p class="option-description">{challengeDesc(option.metric, option.challenge_target, option.challenge_target_games, option.challenge_description)}</p>
208227
{#if option.hero_id !== null}
209228
<p class="option-hero">{$_('challenges.hero_label', { values: { name: getHeroName(option.hero_id) } })}</p>
210229
{/if}

src/routes/goals/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@
326326
<div class="form-row">
327327
<div class="fg">
328328
<div class="form-label">{$_('goals.hero')}</div>
329-
<HeroSelect bind:value={formHeroId} heroes={allHeroesSorted} favoriteIds={favoriteHeroIds} anyLabel="Any Hero" groupOptions={HERO_GROUP_OPTIONS} />
329+
<HeroSelect bind:value={formHeroId} heroes={allHeroesSorted} favoriteIds={favoriteHeroIds} anyLabel={$_('goals.any_hero')} groupOptions={HERO_GROUP_OPTIONS} />
330330
</div>
331331
332332
<div class="fg">

src/routes/goals/[goalId]/+page.svelte

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -517,28 +517,28 @@
517517
<div class="filters-row">
518518
{#if goal.hero_id === null}
519519
<div class="filter-group">
520-
<div class="filter-label">Hero</div>
521-
<HeroSelect bind:value={selectedHeroId} heroes={allHeroesSorted} favoriteIds={favoriteHeroIds} anyLabel="All Heroes" />
520+
<div class="filter-label">{$_('goals_detail.hero_filter')}</div>
521+
<HeroSelect bind:value={selectedHeroId} heroes={allHeroesSorted} favoriteIds={favoriteHeroIds} anyLabel={$_('goals_detail.all_heroes')} />
522522
</div>
523523
{/if}
524524
<div class="filter-group">
525-
<div class="filter-label">Period</div>
525+
<div class="filter-label">{$_('goals_detail.period')}</div>
526526
<div class="period-buttons">
527-
{#each [['7d', 'Last 7 Days'], ['30d', 'Last 30 Days'], ['1y', 'Last Year']] as [val, label]}
527+
{#each [['7d', 'goals_detail.period_7d'], ['30d', 'goals_detail.period_30d'], ['1y', 'goals_detail.period_1y']] as [val, tkey]}
528528
<button
529529
class="period-btn"
530530
class:active={selectedPeriod === val}
531531
onclick={() => selectedPeriod = selectedPeriod === val ? '' : val}
532-
>{label}</button>
532+
>{$_(tkey)}</button>
533533
{/each}
534534
</div>
535535
</div>
536-
<button class="reset-btn" onclick={resetFilters}>Reset</button>
536+
<button class="reset-btn" onclick={resetFilters}>{$_('goals_detail.reset')}</button>
537537
</div>
538538
539539
<!-- Histogram Section -->
540540
<section class="histogram-section">
541-
<h2>Distribution</h2>
541+
<h2>{$_('goals_detail.distribution')}</h2>
542542
543543
<!-- Goal suggestion banner -->
544544
{#if goalSuggestion() && !bannerDismissed}

0 commit comments

Comments
 (0)