Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions frontend/src/components/layout/AppLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,18 @@ onUnmounted(() => {
</nav>

<div class="sidebar-footer">
<!-- Language switcher -->
<!-- Language switcher. The :title on both variants surfaces a hint
that in-game broadcast messages (vote-thanks, restart warnings,
etc.) stay in whatever language they were saved in — switching
panel language only translates the panel UI itself. -->
<div class="lang-switcher" v-if="!sidebarCollapsed">
<Select
v-model="selectedLocale"
:options="localeOptions"
optionLabel="label"
optionValue="value"
class="lang-select"
:title="t('layout.broadcastsHint')"
/>
</div>
<Button
Expand All @@ -167,7 +171,7 @@ onUnmounted(() => {
severity="secondary"
@click="cycleLocale"
class="lang-cycle-btn"
:title="SUPPORTED_LOCALES[localeIndex]?.name"
:title="`${SUPPORTED_LOCALES[localeIndex]?.name} — ${t('layout.broadcastsHint')}`"
/>

<!-- Connection indicator -->
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { createI18n } from 'vue-i18n'
import en from './locales/en'
import de from './locales/de'
import zhCN from './locales/zh-CN'
import zhTW from './locales/zh-TW'
import ja from './locales/ja'
import ko from './locales/ko'

export const SUPPORTED_LOCALES = [
{ code: 'en', name: 'English' },
{ code: 'de', name: 'Deutsch' },
{ code: 'zh-CN', name: '简体中文' },
{ code: 'zh-TW', name: '繁體中文' },
{ code: 'ja', name: '日本語' },
Expand All @@ -27,6 +29,7 @@ function getSavedLocale(): LocaleCode {
}
if (browserLang.startsWith('ja')) return 'ja'
if (browserLang.startsWith('ko')) return 'ko'
if (browserLang.startsWith('de')) return 'de'
return 'en'
}

Expand All @@ -36,6 +39,7 @@ const i18n = createI18n({
fallbackLocale: 'en',
messages: {
en,
de,
'zh-CN': zhCN,
'zh-TW': zhTW,
ja,
Expand Down
Loading
Loading