Download src/hooks/useLanguage.ts from ID221183/gpt4ui: direct link, hf CLI and curl.
- Browser
- Download file 464 Bytes
-
https://huggingface.co/spaces/ID221183/gpt4ui/resolve/main/src/hooks/useLanguage.ts
- Command line
-
hf download hf://spaces/ID221183/gpt4ui/src/hooks/useLanguage.ts
-
curl -L -o useLanguage.ts https://huggingface.co/spaces/ID221183/gpt4ui/resolve/main/src/hooks/useLanguage.ts
464 Bytes
| import { computed } from 'vue' | |
| import { enUS, viVN } from 'naive-ui' | |
| import { useAppStore } from '@/store' | |
| import { setLocale } from '@/locales' | |
| export function useLanguage() { | |
| const appStore = useAppStore() | |
| const language = computed(() => { | |
| setLocale(appStore.language) | |
| switch (appStore.language) { | |
| case 'en-US': | |
| return enUS | |
| case 'vi-VN': | |
| return viVN | |
| default: | |
| return enUS | |
| } | |
| }) | |
| return { language } | |
| } |