Skip to content

Commit

Permalink
remove theme.translations
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Sep 16, 2022
1 parent e1b0645 commit c13b911
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/client/theme-default/components/VPDocAsideOutline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function handleClick({ target: el }: Event) {
{{
(typeof theme.outline === 'object' &&
!Array.isArray(theme.outline) &&
theme.outline.title) ||
theme.outline.label) ||
theme.outlineTitle ||
'On this page'
}}
Expand Down
4 changes: 2 additions & 2 deletions src/client/theme-default/components/VPLocalNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ function scrollToTop() {
>
<VPIconAlignLeft class="menu-icon" />
<span class="menu-text">
{{ theme.translations?.sidebarMenuLabel || 'Menu' }}
{{ theme.sidebarMenuLabel || 'Menu' }}
</span>
</button>

<a class="top-link" href="#" @click="scrollToTop">
{{ theme.translations?.returnToTopLabel || 'Return to top' }}
{{ theme.returnToTopLabel || 'Return to top' }}
</a>
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/client/theme-default/components/VPNavBarExtra.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const hasExtraContent = computed(
<div v-if="site.appearance" class="group">
<div class="item appearance">
<p class="label">
{{ theme.translations?.darkModeSwitchLabel || 'Appearance' }}
{{ theme.darkModeSwitchLabel || 'Appearance' }}
</p>
<div class="appearance-action">
<VPSwitchAppearance />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { site, theme } = useData()
<template>
<div v-if="site.appearance" class="VPNavScreenAppearance">
<p class="text">
{{ theme.translations?.darkModeSwitchLabel || 'Appearance' }}
{{ theme.darkModeSwitchLabel || 'Appearance' }}
</p>
<VPSwitchAppearance />
</div>
Expand Down
39 changes: 17 additions & 22 deletions types/default-theme.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export namespace DefaultTheme {

/**
* @deprecated
* Use `outline.title` instead.
* Use `outline.label` instead.
*
* Custom outline title in the aside component.
*
Expand Down Expand Up @@ -69,6 +69,21 @@ export namespace DefaultTheme {
*/
footer?: Footer

/**
* @default 'Appearance'
*/
darkModeSwitchLabel?: string

/**
* @default 'Menu'
*/
sidebarMenuLabel?: string

/**
* @default 'Return to top'
*/
returnToTopLabel?: string

/**
* The algolia options. Leave it undefined to disable the search feature.
*/
Expand All @@ -78,26 +93,6 @@ export namespace DefaultTheme {
* The carbon ads options. Leave it undefined to disable the ads feature.
*/
carbonAds?: CarbonAdsOptions

/**
* Custom labels
*/
translations?: {
/**
* @default 'Appearance'
*/
darkModeSwitchLabel?: string

/**
* @default 'Menu'
*/
sidebarMenuLabel?: string

/**
* @default 'Return to top'
*/
returnToTopLabel?: string
}
}

// nav -----------------------------------------------------------------------
Expand Down Expand Up @@ -245,7 +240,7 @@ export namespace DefaultTheme {

export interface Outline {
level?: number | [number, number] | 'deep'
title?: string
label?: string
}

// algolia ------------------------------------------------------------------
Expand Down

0 comments on commit c13b911

Please sign in to comment.