mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-19 07:19:58 +00:00
feat: memorize language
This commit is contained in:
parent
5e0119aa84
commit
30eb95f1bd
4 changed files with 6 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
import { decode } from 'blurhash'
|
import { decode } from 'blurhash'
|
||||||
import { getDataUrlFromArr } from '~~/composables/utils'
|
import { getDataUrlFromArr } from '~/composables/utils'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
|
import { STORAGE_KEY_LANG } from '~/constants'
|
||||||
|
|
||||||
const { locale } = useI18n()
|
const { locale } = useI18n()
|
||||||
|
useLocalStorage(STORAGE_KEY_LANG, locale)
|
||||||
|
|
||||||
const languageList = [
|
const languageList = [
|
||||||
{
|
{
|
||||||
value: 'en-US',
|
value: 'en-US',
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { UserLogin } from '~~/types'
|
import type { UserLogin } from '~/types'
|
||||||
|
|
||||||
const all = useUsers()
|
const all = useUsers()
|
||||||
|
|
||||||
|
|
|
@ -10,4 +10,5 @@ export const STORAGE_KEY_CURRENT_USER = 'elk-current-user'
|
||||||
export const STORAGE_KEY_NOTIFY_TAB = 'elk-notify-tab'
|
export const STORAGE_KEY_NOTIFY_TAB = 'elk-notify-tab'
|
||||||
export const STORAGE_KEY_FIRST_VISIT = 'elk-first-visit'
|
export const STORAGE_KEY_FIRST_VISIT = 'elk-first-visit'
|
||||||
export const STORAGE_KEY_ZEN_MODE = 'elk-zenmode'
|
export const STORAGE_KEY_ZEN_MODE = 'elk-zenmode'
|
||||||
|
export const STORAGE_KEY_LANG = 'elk-lang'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue