Skip to content

Commit

Permalink
refactor(i18n): migrate to composition API syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
strahe committed Jan 31, 2025
1 parent 0c0ae7b commit b165341
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
7 changes: 5 additions & 2 deletions ui/src/layouts/sidebar/NavCollapse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { PropType } from 'vue'
import NavItem from './NavItem.vue'
import { IconChevronRight } from '@tabler/icons-vue'
import { useI18n } from 'vue-i18n'
import { menuItem } from './sidebarItems'
defineProps({
Expand All @@ -18,6 +19,8 @@ defineProps({
default: 'vertical'
}
})
const { t } = useI18n()
</script>

<template>
Expand All @@ -32,7 +35,7 @@ defineProps({
size="20"
/>
</i>
<span class="mr-auto">{{ $t("nav."+item.title) }}</span>
<span class="mr-auto">{{ t("nav."+item.title) }}</span>
<!---If Caption-->
<small
v-if="item.subCaption"
Expand Down Expand Up @@ -84,7 +87,7 @@ defineProps({
/>
</template>
<v-list-item-title class="mr-auto">
{{ $t("nav."+item.title) }}
{{ t("nav."+item.title) }}
</v-list-item-title>
</v-list-item>
</template>
Expand Down
5 changes: 4 additions & 1 deletion ui/src/layouts/sidebar/NavGroup.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n'
const props = defineProps({
item: {
type: Object,
required: true,
},
})
const { t } = useI18n()
</script>

<template>
<v-list-subheader
class="smallCap text-subtitle-2"
color="lightText"
>
{{ $t("nav."+props.item.header) }}
{{ t("nav."+props.item.header) }}
</v-list-subheader>
</template>
6 changes: 4 additions & 2 deletions ui/src/layouts/sidebar/NavItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { PropType, onMounted, ref,computed } from 'vue'
import { IconPointFilled } from '@tabler/icons-vue'
import { menuItem } from './sidebarItems'
import { useI18n } from 'vue-i18n'
const props = defineProps({
item: {
Expand All @@ -17,6 +18,7 @@ const props = defineProps({
default: 'vertical'
}
})
const { t } = useI18n()
const relativeURL = ref('')
Expand Down Expand Up @@ -55,7 +57,7 @@ const icon = computed(() => {
size="20"
/>
</i>
<span>{{ $t("nav."+item.title) }}</span>
<span>{{ t("nav."+item.title) }}</span>
<small
v-if="item.subCaption"
class="text-caption mt-n1 hide-menu"
Expand Down Expand Up @@ -95,7 +97,7 @@ const icon = computed(() => {
/>
</template>
<v-list-item-title class="mr-auto">
{{ $t("nav."+item.title) }}
{{ t("nav."+item.title) }}
</v-list-item-title>
<v-list-item-subtitle
v-if="item.subCaption"
Expand Down
7 changes: 5 additions & 2 deletions ui/src/views/market/asks/AskList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ import { MarketMk12StorageAsk } from '@/typed-graph'
import { attoFilToFilPerTiBPerMonth } from '@/utils/helpers/convertPrice'
import { formatBytes } from '@/utils/helpers/formatBytes'
import { IconReload } from '@tabler/icons-vue'
import { useI18n } from 'vue-i18n'
import SetAsk from './widgets/SetAsk.vue'
const { d } = useI18n()
const { result, loading, refetch } = useQuery(GetMarketMk12StorageAsks, null, () => ({
fetchPolicy: 'cache-first',
}))
Expand Down Expand Up @@ -73,10 +76,10 @@ const searchValue = ref<string>()
{{ formatBytes(value).combined }}
</template>
<template #item.createdAt="{ value }">
{{ $d(value * 1000, 'long') }}
{{ d(value * 1000, 'long') }}
</template>
<template #item.expiry="{ value }">
{{ $d(value * 1000, 'long') }}
{{ d(value * 1000, 'long') }}
</template>
<template #item.actions="{ item }">
<SetAsk
Expand Down

0 comments on commit b165341

Please sign in to comment.