@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
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
class="title-dropdown-item"
|
|
56
56
|
@click="selectItem(item)"
|
|
57
57
|
>
|
|
58
|
-
<p class="pageName">{{
|
|
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
|
|
174
|
-
if (!
|
|
175
|
-
|
|
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) => {
|