@skyservice-developers/vue-dev-kit 1.2.4 → 1.2.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyservice-developers/vue-dev-kit",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "Vue 2 and Vue 3 developer toolkit - components and helpers",
5
5
  "type": "module",
6
6
  "main": "./dist/vue3/vue-dev-kit.cjs",
@@ -45,3 +45,7 @@ export function getParentLocalStorage(key) {
45
45
  export function getParentStoreValue(key) {
46
46
  return requestFromParent('store', key)
47
47
  }
48
+
49
+ export function getParentWindowValue(key) {
50
+ return requestFromParent('window', key)
51
+ }
@@ -55,7 +55,7 @@
55
55
  class="title-dropdown-item"
56
56
  @click="selectItem(item)"
57
57
  >
58
- <p class="pageName">{{ capitalize(item.name) }}</p>
58
+ <p class="pageName">{{ translateName(item.name) }}</p>
59
59
  <small class="pageVisit">
60
60
  ({{ visitLabel }} {{ getTimeAgo(item.lastVisit) }})
61
61
  </small>
@@ -80,7 +80,7 @@
80
80
  <script setup>
81
81
  import { ref, computed, onMounted, onUnmounted } from 'vue'
82
82
  import { isInIframe } from '../../shared/utils/webviewCheck'
83
- import { getParentLocalStorage } from '../../shared/utils/parentBridge'
83
+ import { getParentLocalStorage, getParentWindowValue } from '../../shared/utils/parentBridge'
84
84
 
85
85
  const props = defineProps({
86
86
  title: {
@@ -123,6 +123,16 @@ const dropdownRef = ref(null)
123
123
  const isDropdownOpen = ref(false)
124
124
 
125
125
  const localStorageItems = ref([])
126
+ const parentLang = ref({})
127
+
128
+ // Load translations from parent
129
+ if (isInIframe()) {
130
+ getParentWindowValue('lang').then((data) => {
131
+ if (data != null) {
132
+ parentLang.value = data
133
+ }
134
+ })
135
+ }
126
136
 
127
137
  function loadComponentStats(raw) {
128
138
  try {
@@ -170,9 +180,10 @@ const selectItem = (item) => {
170
180
  closeDropdown()
171
181
  }
172
182
 
173
- const capitalize = (str) => {
174
- if (!str) return ''
175
- return str.charAt(0).toUpperCase() + str.slice(1)
183
+ const translateName = (name) => {
184
+ if (!name) return ''
185
+ const translated = parentLang.value[name] || name
186
+ return translated.charAt(0).toUpperCase() + translated.slice(1)
176
187
  }
177
188
 
178
189
  const getTimeAgo = (lastVisit) => {