-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
apps/admin/src/layouts/header/components/LocaleSwitcher.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script setup lang="ts"> | ||
import { LocalesEngine, languagesNameList, useI18n } from "@celeris/locale"; | ||
import IconButtonWithToolTip from "~/layouts/header/components/IconButtonWithToolTip.vue"; | ||
import { useAppSetting } from "~/composables"; | ||
const { getLocale, setProjectSetting } = useAppSetting(); | ||
const { locale, availableLocales, t } = useI18n(); | ||
const options = computed( | ||
() => availableLocales.map(item => ({ | ||
label: languagesNameList.find(languagesName => languagesName.code === item)?.nativeName, | ||
key: item, | ||
})), | ||
); | ||
const handleSelect = (key: string) => { | ||
setProjectSetting({ locale: key }); | ||
locale.value = key; | ||
LocalesEngine.setLocale(key); | ||
}; | ||
</script> | ||
|
||
<template> | ||
<NDropdown :options="options" trigger="click" :value="getLocale" @select="handleSelect"> | ||
<IconButtonWithToolTip tooltip-text="Switch Locale" icon="i-tabler-language" color="gray" /> | ||
</NDropdown> | ||
</template> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
499f96a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
celeris-web-api – ./services/admin
celeris-web-api-kirklin.vercel.app
celeris-web-api-git-master-kirklin.vercel.app
celeris-web-api.vercel.app
499f96a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
celeris-web – ./apps/admin
celeris-web-git-master-kirklin.vercel.app
celeris-web.vercel.app
celeris-web-kirklin.vercel.app