Files
hermes-web-ui/packages/client/src/components/layout/LanguageSwitch.vue
T
ekko 7da934fe8b revert: remove i18n lazy loading and highlight.js selective import (#736)
Revert the dynamic import() for i18n locales and highlight.js core+
registration from #696. Dynamic imports create separate chunk files
that cause 404 errors for users after updating when the browser still
references old chunk hashes.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 23:32:33 +08:00

36 lines
843 B
Vue

<script setup lang="ts">
import { useI18n } from 'vue-i18n'
import { NSelect } from 'naive-ui'
import { switchLocale } from '@/i18n'
const { locale } = useI18n()
const options = [
{ label: '简体中文', value: 'zh' },
{ label: '繁體中文', value: 'zh-TW' },
{ label: 'English', value: 'en' },
{ label: '日本語', value: 'ja' },
{ label: '한국어', value: 'ko' },
{ label: 'Français', value: 'fr' },
{ label: 'Español', value: 'es' },
{ label: 'Deutsch', value: 'de' },
{ label: 'Português', value: 'pt' },
]
function handleChange(val: string) {
switchLocale(val)
localStorage.setItem('hermes_locale', val)
}
</script>
<template>
<NSelect
:value="locale"
:options="options"
size="tiny"
:consistent-menu-width="false"
class="input-sm"
@update:value="handleChange"
/>
</template>