i18n: automatyczny język + ręczny przełącznik

This commit is contained in:
2026-02-08 16:28:30 +01:00
parent 2d4d03f5d3
commit 40a6725bf1
11 changed files with 253 additions and 42 deletions

View File

@@ -2,9 +2,11 @@
import { computed } from 'vue';
import { usePuzzleStore } from '@/stores/puzzle';
import { useTimer } from '@/composables/useTimer';
import { useI18n } from '@/composables/useI18n';
const store = usePuzzleStore();
const { formatTime } = useTimer();
const { t } = useI18n();
const formattedTime = computed(() => formatTime(store.elapsedTime));
const progressText = computed(() => `${store.progressPercentage.toFixed(3)}%`);
@@ -13,17 +15,17 @@ const progressText = computed(() => `${store.progressPercentage.toFixed(3)}%`);
<template>
<div class="status-panel glass-panel">
<div class="stat-item">
<span class="label">CZAS</span>
<span class="label">{{ t('status.time') }}</span>
<span class="value">{{ formattedTime }}</span>
</div>
<div class="stat-item">
<span class="label">RUCHY</span>
<span class="label">{{ t('status.moves') }}</span>
<span class="value">{{ store.moves }}</span>
</div>
<div class="stat-item">
<span class="label">POSTĘP</span>
<span class="label">{{ t('status.progress') }}</span>
<div class="progress-wrapper">
<span class="value small">{{ progressText }}</span>
<span class="eye-icon">👁</span>
@@ -83,4 +85,4 @@ const progressText = computed(() => `${store.progressPercentage.toFixed(3)}%`);
opacity: 0.7;
cursor: pointer;
}
</style>
</style>