From c13b911d539f2eb4c24cad8044201fc0c1dfc994 Mon Sep 17 00:00:00 2001
From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
Date: Fri, 16 Sep 2022 11:35:54 +0530
Subject: [PATCH] remove theme.translations
---
.../components/VPDocAsideOutline.vue | 2 +-
.../theme-default/components/VPLocalNav.vue | 4 +-
.../components/VPNavBarExtra.vue | 2 +-
.../components/VPNavScreenAppearance.vue | 2 +-
types/default-theme.d.ts | 39 ++++++++-----------
5 files changed, 22 insertions(+), 27 deletions(-)
diff --git a/src/client/theme-default/components/VPDocAsideOutline.vue b/src/client/theme-default/components/VPDocAsideOutline.vue
index 2fbb7813dcdf..197436ba7c2a 100644
--- a/src/client/theme-default/components/VPDocAsideOutline.vue
+++ b/src/client/theme-default/components/VPDocAsideOutline.vue
@@ -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'
}}
diff --git a/src/client/theme-default/components/VPLocalNav.vue b/src/client/theme-default/components/VPLocalNav.vue
index 4833a5ee2840..e92846dafab7 100644
--- a/src/client/theme-default/components/VPLocalNav.vue
+++ b/src/client/theme-default/components/VPLocalNav.vue
@@ -29,12 +29,12 @@ function scrollToTop() {
>
- {{ theme.translations?.returnToTopLabel || 'Return to top' }}
+ {{ theme.returnToTopLabel || 'Return to top' }}
diff --git a/src/client/theme-default/components/VPNavBarExtra.vue b/src/client/theme-default/components/VPNavBarExtra.vue
index 35966cc6bb26..65b6dda5264c 100644
--- a/src/client/theme-default/components/VPNavBarExtra.vue
+++ b/src/client/theme-default/components/VPNavBarExtra.vue
@@ -31,7 +31,7 @@ const hasExtraContent = computed(
- {{ theme.translations?.darkModeSwitchLabel || 'Appearance' }}
+ {{ theme.darkModeSwitchLabel || 'Appearance' }}
diff --git a/src/client/theme-default/components/VPNavScreenAppearance.vue b/src/client/theme-default/components/VPNavScreenAppearance.vue
index 87bbcb4d05de..1bff9cad923d 100644
--- a/src/client/theme-default/components/VPNavScreenAppearance.vue
+++ b/src/client/theme-default/components/VPNavScreenAppearance.vue
@@ -8,7 +8,7 @@ const { site, theme } = useData()
- {{ theme.translations?.darkModeSwitchLabel || 'Appearance' }}
+ {{ theme.darkModeSwitchLabel || 'Appearance' }}
diff --git a/types/default-theme.d.ts b/types/default-theme.d.ts
index aea08cb6a11e..c5ebb8feacd1 100644
--- a/types/default-theme.d.ts
+++ b/types/default-theme.d.ts
@@ -22,7 +22,7 @@ export namespace DefaultTheme {
/**
* @deprecated
- * Use `outline.title` instead.
+ * Use `outline.label` instead.
*
* Custom outline title in the aside component.
*
@@ -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.
*/
@@ -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 -----------------------------------------------------------------------
@@ -245,7 +240,7 @@ export namespace DefaultTheme {
export interface Outline {
level?: number | [number, number] | 'deep'
- title?: string
+ label?: string
}
// algolia ------------------------------------------------------------------