Skip to content

Commit

Permalink
Merge pull request #310 from neo773/i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx authored Aug 27, 2023
2 parents 2f00178 + 21d11cc commit d98db0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/components/TabSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { watch } from 'vue'
import { useRouter } from 'vue-router'
import type { Tab } from './comp_def'
import { useI18n } from 'vue-i18n';
const props = defineProps<{
tabs: Tab[]
Expand All @@ -11,6 +12,7 @@ const props = defineProps<{
const emit = defineEmits(['update:activeTab'])
const router = useRouter()
const { t } = useI18n()
function openLink(link: string) {
emit('update:activeTab', link)
Expand Down Expand Up @@ -47,7 +49,7 @@ watch(props, (p) => {
<li v-for="(m, i) in tabs" :key="i" class="mr-0.5 md:mb-0.5 md:mr-0" @click="openLink(m.key)">
<button class="flex items-center whitespace-nowrap rounded px-2.5 py-2">
<component :is="m.icon" class="w-4 h-4 mr-2 fill-current shrink-0" :class="{ 'text-blue-600': isActive(m.key), 'text-slate-400': !isActive(m.key) }" />
<span class="hidden text-sm font-medium md:block" :class="{ 'text-blue-600': isActive(m.key), 'text-slate-400': !isActive(m.key) }">{{ m.label }}</span>
<span class="hidden text-sm font-medium md:block" :class="{ 'text-blue-600': isActive(m.key), 'text-slate-400': !isActive(m.key) }">{{ t(m.label) }}</span>
</button>
</li>
</ul>
Expand Down
12 changes: 6 additions & 6 deletions src/layouts/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@ const ActiveTab = ref('')
const tabs = ref<Tab[]>([
{
label: t('account'),
label: 'account',
icon: shallowRef(IconAcount),
key: '/dashboard/settings/account',
},
{
label: t('password'),
label: 'password',
icon: shallowRef(IconPassword),
key: '/dashboard/settings/changepassword',
},
{
label: t('notifications'),
label: 'notifications',
icon: shallowRef(IconNotification),
key: '/dashboard/settings/notifications',
},
{
label: t('plans'),
label: 'plans',
icon: shallowRef(IconPlans),
key: '/dashboard/settings/plans',
},
])
if (!Capacitor.isNativePlatform()) {
tabs.value.push({
label: t('billing'),
label: 'billing',
icon: shallowRef(IconBilling) as any,
key: '/billing',
onClick: openPortal,
Expand All @@ -56,7 +56,7 @@ if (main.user?.id) {
isAdmin(main.user?.id).then((res) => {
if (!!res || isSpoofed()) {
tabs.value.push({
label: t('admin'),
label: 'admin',
icon: shallowRef(IconAdmin) as any,
key: '/dashboard/settings/admin',
})
Expand Down

0 comments on commit d98db0e

Please sign in to comment.