mirror of
https://github.com/certd/certd.git
synced 2026-05-17 13:57:31 +08:00
First translation step
This commit is contained in:
@@ -6,7 +6,7 @@ import type { IBreadcrumb } from "/@/vben//shadcn-ui";
|
||||
import { computed } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import { $t } from "/@/vben/locales";
|
||||
import { $t } from "/@/locales";
|
||||
|
||||
import { VbenBreadcrumbView } from "/@/vben//shadcn-ui";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, onUnmounted, ref } from "vue";
|
||||
|
||||
import { $t } from "../../../locales";
|
||||
import { $t } from "/@/locales";
|
||||
|
||||
import { useVbenModal } from "../../../popup-ui";
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { MenuRecordRaw } from "../../../types";
|
||||
import { nextTick, onMounted, onUnmounted, ref, watch } from "vue";
|
||||
|
||||
import { ArrowDown, ArrowUp, CornerDownLeft, MdiKeyboardEsc, Search } from "../../../icons";
|
||||
import { $t } from "../../../locales";
|
||||
import { $t } from "/@/locales";
|
||||
import { isWindowsOs } from "../../../utils";
|
||||
|
||||
import { useVbenModal } from "../../../popup-ui";
|
||||
|
||||
@@ -5,7 +5,7 @@ import { nextTick, onMounted, ref, shallowRef, watch } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
import { SearchX, X } from "../../../icons";
|
||||
import { $t } from "../../../locales";
|
||||
import { $t } from "/@/locales";
|
||||
import { mapTree, traverseTreeValues, uniqueByField } from "../../../utils";
|
||||
|
||||
import { VbenIcon, VbenScrollbar } from "../../../shadcn-ui";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import type { SupportedLanguagesType } from "/@/vben/locales";
|
||||
import type { SupportedLanguagesType } from "/@/locales";
|
||||
|
||||
import { SUPPORT_LANGUAGES } from "/@/vben/constants";
|
||||
import { Languages } from "/@/vben/icons";
|
||||
import { loadLocaleMessages } from "/@/vben/locales";
|
||||
import { loadLocaleMessages } from "/@/locales";
|
||||
import { preferences, updatePreferences } from "/@/vben/preferences";
|
||||
|
||||
import { VbenDropdownRadioMenu, VbenIconButton } from "/@/vben//shadcn-ui";
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { VbenDropdownMenuItem } from "/@/vben//shadcn-ui";
|
||||
import { computed } from "vue";
|
||||
|
||||
import { InspectionPanel, PanelLeft, PanelRight } from "/@/vben/icons";
|
||||
import { $t } from "/@/vben/locales";
|
||||
import { $t } from "/@/locales";
|
||||
import { preferences, updatePreferences, usePreferences } from "/@/vben/preferences";
|
||||
|
||||
import { VbenDropdownRadioMenu, VbenIconButton } from "/@/vben//shadcn-ui";
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { Recordable } from "../../../types";
|
||||
|
||||
import { computed, reactive } from "vue";
|
||||
|
||||
import { $t } from "../../../locales";
|
||||
import { $t } from "/@/locales";
|
||||
|
||||
import { useVbenForm, z } from "../../../form-ui";
|
||||
import { useVbenModal } from "../../../popup-ui";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { computed, reactive, ref } from "vue";
|
||||
|
||||
import { LockKeyhole } from "../../../icons";
|
||||
import { $t, useI18n } from "../../../locales";
|
||||
import { $t, useI18n } from "/@/locales";
|
||||
import { storeToRefs, useLockStore } from "../../../stores";
|
||||
|
||||
import { useScrollLock } from "../../../composables";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import type { NotificationItem } from "./types";
|
||||
|
||||
import { Bell, MailCheck } from "/@/vben/icons";
|
||||
import { $t } from "/@/vben/locales";
|
||||
import { $t } from "/@/locales";
|
||||
|
||||
import { VbenButton, VbenIconButton, VbenPopover, VbenScrollbar } from "/@/vben//shadcn-ui";
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { $t } from "/@/vben/locales";
|
||||
import { $t } from "/@/locales";
|
||||
|
||||
import SwitchItem from "../switch-item.vue";
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { SUPPORT_LANGUAGES } from "/@/vben/constants";
|
||||
import { $t } from "/@/vben/locales";
|
||||
import { $t } from "/@/locales";
|
||||
|
||||
import SelectItem from "../select-item.vue";
|
||||
import SwitchItem from "../switch-item.vue";
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import type { SelectOption } from "/@/vben/types";
|
||||
|
||||
import { computed } from "vue";
|
||||
|
||||
import { $t } from "/@/vben/locales";
|
||||
import { $t } from "/@/locales";
|
||||
|
||||
import SwitchItem from "../switch-item.vue";
|
||||
import ToggleItem from "../toggle-item.vue";
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import type { Component } from "vue";
|
||||
|
||||
import { computed } from "vue";
|
||||
|
||||
import { $t } from "/@/vben/locales";
|
||||
import { $t } from "/@/locales";
|
||||
|
||||
import { ContentCompact, ContentWide } from "../../icons";
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import { $t } from "/@/vben/locales";
|
||||
import { $t } from "/@/locales";
|
||||
|
||||
import InputItem from "../input-item.vue";
|
||||
import SwitchItem from "../switch-item.vue";
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { $t } from "/@/vben/locales";
|
||||
import { $t } from "/@/locales";
|
||||
|
||||
import SwitchItem from "../switch-item.vue";
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import type {
|
||||
SelectOption,
|
||||
} from '/@/vben/types';
|
||||
|
||||
import { $t } from '/@/vben/locales';
|
||||
import { $t } from '/@/locales';
|
||||
|
||||
import SelectItem from '../select-item.vue';
|
||||
import SwitchItem from '../switch-item.vue';
|
||||
|
||||
+73
-78
@@ -6,107 +6,102 @@ import type { LayoutType } from '/@/vben/types';
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { CircleHelp } from '/@/vben/icons';
|
||||
import { $t } from '/@/vben/locales';
|
||||
import { $t } from '/@/locales';
|
||||
|
||||
import { VbenTooltip } from '/@/vben//shadcn-ui';
|
||||
|
||||
import {
|
||||
FullContent,
|
||||
HeaderMixedNav,
|
||||
HeaderNav,
|
||||
HeaderSidebarNav,
|
||||
MixedNav,
|
||||
SidebarMixedNav,
|
||||
SidebarNav,
|
||||
FullContent,
|
||||
HeaderMixedNav,
|
||||
HeaderNav,
|
||||
HeaderSidebarNav,
|
||||
MixedNav,
|
||||
SidebarMixedNav,
|
||||
SidebarNav,
|
||||
} from '../../icons';
|
||||
|
||||
interface PresetItem {
|
||||
name: string;
|
||||
tip: string;
|
||||
type: LayoutType;
|
||||
name: string;
|
||||
tip: string;
|
||||
type: LayoutType;
|
||||
}
|
||||
|
||||
defineOptions({
|
||||
name: 'PreferenceLayout',
|
||||
name: 'PreferenceLayout',
|
||||
});
|
||||
|
||||
const modelValue = defineModel<LayoutType>({ default: 'sidebar-nav' });
|
||||
|
||||
const components: Record<LayoutType, Component> = {
|
||||
'full-content': FullContent,
|
||||
'header-nav': HeaderNav,
|
||||
'mixed-nav': MixedNav,
|
||||
'sidebar-mixed-nav': SidebarMixedNav,
|
||||
'sidebar-nav': SidebarNav,
|
||||
'header-mixed-nav': HeaderMixedNav,
|
||||
'header-sidebar-nav': HeaderSidebarNav,
|
||||
'full-content': FullContent,
|
||||
'header-nav': HeaderNav,
|
||||
'mixed-nav': MixedNav,
|
||||
'sidebar-mixed-nav': SidebarMixedNav,
|
||||
'sidebar-nav': SidebarNav,
|
||||
'header-mixed-nav': HeaderMixedNav,
|
||||
'header-sidebar-nav': HeaderSidebarNav,
|
||||
};
|
||||
|
||||
const PRESET = computed((): PresetItem[] => [
|
||||
{
|
||||
name: $t('preferences.vertical'),
|
||||
tip: $t('preferences.verticalTip'),
|
||||
type: 'sidebar-nav',
|
||||
},
|
||||
{
|
||||
name: $t('preferences.twoColumn'),
|
||||
tip: $t('preferences.twoColumnTip'),
|
||||
type: 'sidebar-mixed-nav',
|
||||
},
|
||||
{
|
||||
name: $t('preferences.horizontal'),
|
||||
tip: $t('preferences.horizontalTip'),
|
||||
type: 'header-nav',
|
||||
},
|
||||
{
|
||||
name: $t('preferences.headerSidebarNav'),
|
||||
tip: $t('preferences.headerSidebarNavTip'),
|
||||
type: 'header-sidebar-nav',
|
||||
},
|
||||
{
|
||||
name: $t('preferences.mixedMenu'),
|
||||
tip: $t('preferences.mixedMenuTip'),
|
||||
type: 'mixed-nav',
|
||||
},
|
||||
{
|
||||
name: $t('preferences.headerTwoColumn'),
|
||||
tip: $t('preferences.headerTwoColumnTip'),
|
||||
type: 'header-mixed-nav',
|
||||
},
|
||||
{
|
||||
name: $t('preferences.fullContent'),
|
||||
tip: $t('preferences.fullContentTip'),
|
||||
type: 'full-content',
|
||||
},
|
||||
{
|
||||
name: $t('preferences.vertical'),
|
||||
tip: $t('preferences.verticalTip'),
|
||||
type: 'sidebar-nav',
|
||||
},
|
||||
{
|
||||
name: $t('preferences.twoColumn'),
|
||||
tip: $t('preferences.twoColumnTip'),
|
||||
type: 'sidebar-mixed-nav',
|
||||
},
|
||||
{
|
||||
name: $t('preferences.horizontal'),
|
||||
tip: $t('preferences.horizontalTip'),
|
||||
type: 'header-nav',
|
||||
},
|
||||
{
|
||||
name: $t('preferences.headerSidebarNav'),
|
||||
tip: $t('preferences.headerSidebarNavTip'),
|
||||
type: 'header-sidebar-nav',
|
||||
},
|
||||
{
|
||||
name: $t('preferences.mixedMenu'),
|
||||
tip: $t('preferences.mixedMenuTip'),
|
||||
type: 'mixed-nav',
|
||||
},
|
||||
{
|
||||
name: $t('preferences.headerTwoColumn'),
|
||||
tip: $t('preferences.headerTwoColumnTip'),
|
||||
type: 'header-mixed-nav',
|
||||
},
|
||||
{
|
||||
name: $t('preferences.fullContent'),
|
||||
tip: $t('preferences.fullContentTip'),
|
||||
type: 'full-content',
|
||||
},
|
||||
]);
|
||||
|
||||
function activeClass(theme: string): string[] {
|
||||
return theme === modelValue.value ? ['outline-box-active'] : [];
|
||||
return theme === modelValue.value ? ['outline-box-active'] : [];
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex w-full flex-wrap gap-5">
|
||||
<template v-for="theme in PRESET" :key="theme.name">
|
||||
<div
|
||||
class="flex w-[100px] cursor-pointer flex-col"
|
||||
@click="modelValue = theme.type"
|
||||
>
|
||||
<div :class="activeClass(theme.type)" class="outline-box flex-center">
|
||||
<component :is="components[theme.type]" />
|
||||
</div>
|
||||
<div
|
||||
class="text-muted-foreground flex-center hover:text-foreground mt-2 text-center text-xs"
|
||||
>
|
||||
{{ theme.name }}
|
||||
<VbenTooltip v-if="theme.tip" side="bottom">
|
||||
<template #trigger>
|
||||
<CircleHelp class="ml-1 size-3 cursor-help" />
|
||||
</template>
|
||||
{{ theme.tip }}
|
||||
</VbenTooltip>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="flex w-full flex-wrap gap-5">
|
||||
<template v-for="theme in PRESET" :key="theme.name">
|
||||
<div class="flex w-[100px] cursor-pointer flex-col" @click="modelValue = theme.type">
|
||||
<div :class="activeClass(theme.type)" class="outline-box flex-center">
|
||||
<component :is="components[theme.type]" />
|
||||
</div>
|
||||
<div class="text-muted-foreground flex-center hover:text-foreground mt-2 text-center text-xs">
|
||||
{{ theme.name }}
|
||||
<VbenTooltip v-if="theme.tip" side="bottom">
|
||||
<template #trigger>
|
||||
<CircleHelp class="ml-1 size-3 cursor-help" />
|
||||
</template>
|
||||
{{ theme.tip }}
|
||||
</VbenTooltip>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { SelectOption } from '/@/vben/types';
|
||||
|
||||
import { $t } from '/@/vben/locales';
|
||||
import { $t } from '/@/locales';
|
||||
|
||||
import SwitchItem from '../switch-item.vue';
|
||||
import ToggleItem from '../toggle-item.vue';
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { LayoutType } from '/@/vben/types';
|
||||
|
||||
import { $t } from '/@/vben/locales';
|
||||
import { $t } from '/@/locales';
|
||||
|
||||
import NumberFieldItem from '../number-field-item.vue';
|
||||
import SwitchItem from '../switch-item.vue';
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import type { SelectOption } from '/@/vben/types';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { $t } from '/@/vben/locales';
|
||||
import { $t } from '/@/locales';
|
||||
|
||||
import NumberFieldItem from '../number-field-item.vue';
|
||||
import SelectItem from '../select-item.vue';
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import type { SelectOption } from '/@/vben/types';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { $t } from '/@/vben/locales';
|
||||
import { $t } from '/@/locales';
|
||||
|
||||
import SelectItem from '../select-item.vue';
|
||||
import SwitchItem from '../switch-item.vue';
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { $t } from '/@/vben/locales';
|
||||
import { $t } from '/@/locales';
|
||||
import { isWindowsOs } from '/@/vben/utils';
|
||||
|
||||
import SwitchItem from '../switch-item.vue';
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import type { BuiltinThemeType } from '/@/vben/types';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
|
||||
import { UserRoundPen } from '/@/vben/icons';
|
||||
import { $t } from '/@/vben/locales';
|
||||
import { $t } from '/@/locales';
|
||||
import { BUILT_IN_THEME_PRESETS } from '/@/vben/preferences';
|
||||
import { convertToHsl, TinyColor } from '/@/vben/utils';
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { $t } from '/@/vben/locales';
|
||||
import { $t } from '/@/locales';
|
||||
|
||||
import SwitchItem from '../switch-item.vue';
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import type { Component } from 'vue';
|
||||
import type { ThemeModeType } from '/@/vben/types';
|
||||
|
||||
import { MoonStar, Sun, SunMoon } from '/@/vben/icons';
|
||||
import { $t } from '/@/vben/locales';
|
||||
import { $t } from '/@/locales';
|
||||
|
||||
import SwitchItem from '../switch-item.vue';
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { SupportedLanguagesType } from "/@/vben/locales";
|
||||
import type { SupportedLanguagesType } from "/@/locales";
|
||||
import type {
|
||||
BreadcrumbStyleType,
|
||||
BuiltinThemeType,
|
||||
@@ -17,7 +17,7 @@ import type { SegmentedItem } from "/@/vben//shadcn-ui";
|
||||
import { computed, ref } from "vue";
|
||||
|
||||
import { Copy, RotateCw, X } from "/@/vben/icons";
|
||||
import { $t, loadLocaleMessages } from "/@/vben/locales";
|
||||
import { $t, loadLocaleMessages } from "/@/locales";
|
||||
import { clearPreferencesCache, preferences, resetPreferences, usePreferences } from "/@/vben/preferences";
|
||||
|
||||
import { useVbenDrawer } from "/@/vben//popup-ui";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { computed } from "vue";
|
||||
|
||||
import { Settings } from "/@/vben/icons";
|
||||
import { $t, loadLocaleMessages } from "/@/vben/locales";
|
||||
import { $t, loadLocaleMessages } from "/@/locales";
|
||||
import { preferences, updatePreferences } from "/@/vben/preferences";
|
||||
import { capitalizeFirstLetter } from "/@/vben/utils";
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import type { ThemeModeType } from "/@/vben/types";
|
||||
|
||||
import { MoonStar, Sun, SunMoon } from "/@/vben/icons";
|
||||
import { $t } from "/@/vben/locales";
|
||||
import { $t } from "/@/locales";
|
||||
import { preferences, updatePreferences, usePreferences } from "/@/vben/preferences";
|
||||
|
||||
import { ToggleGroup, ToggleGroupItem, VbenTooltip } from "/@/vben//shadcn-ui";
|
||||
|
||||
@@ -7,7 +7,7 @@ import { computed, useTemplateRef, watch } from "vue";
|
||||
|
||||
import { useHoverToggle } from "/@/vben/hooks";
|
||||
import { LockKeyhole, LogOut } from "/@/vben/icons";
|
||||
import { $t } from "/@/vben/locales";
|
||||
import { $t } from "/@/locales";
|
||||
import { preferences, usePreferences } from "/@/vben/preferences";
|
||||
import { useLockStore } from "/@/vben/stores";
|
||||
import { isWindowsOs } from "/@/vben/utils";
|
||||
|
||||
Reference in New Issue
Block a user