Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(projects): multi language buttons support hiding. #683

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/layouts/modules/global-header/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ const { isFullscreen, toggle } = useFullscreen();
<div class="h-full flex-y-center justify-end">
<GlobalSearch />
<FullScreen v-if="!appStore.isMobile" :full="isFullscreen" @click="toggle" />
<LangSwitch :lang="appStore.locale" :lang-options="appStore.localeOptions" @change-lang="appStore.changeLocale" />
<LangSwitch
v-if="themeStore.header.multilingual.visible"
:lang="appStore.locale"
:lang-options="appStore.localeOptions"
@change-lang="appStore.changeLocale"
/>
<ThemeSchemaSwitch
:theme-schema="themeStore.themeScheme"
:is-dark="themeStore.darkMode"
Expand Down
3 changes: 3 additions & 0 deletions src/layouts/modules/theme-drawer/modules/page-fun.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ const isWrapperScrollMode = computed(() => themeStore.layout.scrollMode === 'wra
placeholder="SoybeanAdmin"
/>
</SettingItem>
<SettingItem key="9" :label="$t('theme.header.multilingual.visible')">
<NSwitch v-model:value="themeStore.header.multilingual.visible" />
</SettingItem>
</TransitionGroup>
</template>

Expand Down
3 changes: 3 additions & 0 deletions src/locales/langs/en-us.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ const local: App.I18n.Schema = {
breadcrumb: {
visible: 'Breadcrumb Visible',
showIcon: 'Breadcrumb Icon Visible'
},
multilingual: {
visible: 'Display multilingual button'
}
},
tab: {
Expand Down
3 changes: 3 additions & 0 deletions src/locales/langs/zh-cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ const local: App.I18n.Schema = {
breadcrumb: {
visible: '显示面包屑',
showIcon: '显示面包屑图标'
},
multilingual: {
visible: '显示多语言按钮'
}
},
tab: {
Expand Down
3 changes: 3 additions & 0 deletions src/theme/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export const themeSettings: App.Theme.ThemeSetting = {
breadcrumb: {
visible: true,
showIcon: true
},
multilingual: {
visible: true
}
},
tab: {
Expand Down
8 changes: 8 additions & 0 deletions src/typings/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ declare namespace App {
/** Whether to show the breadcrumb icon */
showIcon: boolean;
};
/** Multilingual */
multilingual: {
/** Whether to show the multilingual */
visible: boolean;
};
};
/** Tab */
tab: {
Expand Down Expand Up @@ -363,6 +368,9 @@ declare namespace App {
visible: string;
showIcon: string;
};
multilingual: {
visible: string;
};
};
tab: {
visible: string;
Expand Down
Loading