valaxy-theme-press 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { NavigationMenuRoot } from 'reka-ui'
3
- import { useSidebar, useSiteConfig, withBase } from 'valaxy'
3
+ import { useSidebar, useSiteConfig, useValaxyI18n, withBase } from 'valaxy'
4
4
  import { computed } from 'vue'
5
5
  import { useLocaleConfig } from '../composables'
6
6
 
@@ -15,6 +15,7 @@ defineEmits<{
15
15
  const { hasSidebar } = useSidebar()
16
16
 
17
17
  const siteConfig = useSiteConfig()
18
+ const { $t } = useValaxyI18n()
18
19
  const { localeConfig, currentLocale, hasLocales } = useLocaleConfig()
19
20
  const homeLink = computed(() => hasLocales.value ? currentLocale.value.link : '/')
20
21
  </script>
@@ -23,10 +24,10 @@ const homeLink = computed(() => hasLocales.value ? currentLocale.value.link : '/
23
24
  <div class="pr-navbar flex justify-between items-center pl-4 pr-2" :class="{ 'has-sidebar': hasSidebar }">
24
25
  <RouterLink
25
26
  class="pr-navbar-brand text-xl flex justify-center items-center"
26
- :to="homeLink" :aria-label="siteConfig.title"
27
+ :to="homeLink" :aria-label="$t(siteConfig.title)"
27
28
  >
28
29
  <img v-if="localeConfig.logo" class="logo" :src="withBase(localeConfig.logo)" alt="LOGO">
29
- <span class="pr-navbar-title inline-flex">{{ siteConfig.title }}</span>
30
+ <span class="pr-navbar-title inline-flex">{{ $t(siteConfig.title) }}</span>
30
31
  </RouterLink>
31
32
  <!-- Share one active item and pointer-leave timer across all desktop menus. -->
32
33
  <NavigationMenuRoot
@@ -1,5 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { inject } from 'vue'
3
+ import { useI18n } from 'vue-i18n'
3
4
 
4
5
  defineProps<{
5
6
  text: string
@@ -7,11 +8,12 @@ defineProps<{
7
8
  }>()
8
9
 
9
10
  const closeScreen = inject('close-screen') as () => void
11
+ const { t } = useI18n()
10
12
  </script>
11
13
 
12
14
  <template>
13
15
  <AppLink class="pr-nav-screen-menu-link" :href="link" @click="closeScreen">
14
- {{ text }}
16
+ {{ t(text) }}
15
17
  </AppLink>
16
18
  </template>
17
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-press",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Docs (VitePress-like) theme for Valaxy",
5
5
  "author": {
6
6
  "email": "me@yunyoujun.cn",
@@ -37,6 +37,6 @@
37
37
  "reka-ui": "^2.10.4"
38
38
  },
39
39
  "devDependencies": {
40
- "valaxy": "1.2.0"
40
+ "valaxy": "1.2.1"
41
41
  }
42
42
  }