feat: add translation status to language settings (#1717)
This commit is contained in:
parent
3e648f6fbc
commit
c5fe184281
10 changed files with 85 additions and 28 deletions
|
@ -1,9 +1,17 @@
|
|||
<script setup lang="ts">
|
||||
const { t } = useI18n()
|
||||
import type { ElkTranslationStatus } from '~/types/translation-status'
|
||||
|
||||
const { t, locale } = useI18n()
|
||||
|
||||
const translationStatus: ElkTranslationStatus = await import('~/elk-translation-status.json').then(m => m.default)
|
||||
|
||||
useHeadFixed({
|
||||
title: () => `${t('settings.language.label')} | ${t('nav.settings')}`,
|
||||
})
|
||||
const status = computed(() => {
|
||||
const entry = translationStatus.locales[locale.value]
|
||||
return t('settings.language.status', [entry.total, translationStatus.total, entry.percentage])
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -15,7 +23,10 @@ useHeadFixed({
|
|||
</template>
|
||||
<div p6>
|
||||
<label space-y-2>
|
||||
<p font-medium>{{ $t('settings.language.display_language') }}</p>
|
||||
<span block font-medium>{{ $t('settings.language.display_language') }}</span>
|
||||
<span block>
|
||||
{{ status }}
|
||||
</span>
|
||||
<SettingsLanguage select-settings />
|
||||
</label>
|
||||
<h2 py4 mt2 font-bold text-xl flex="~ gap-1" items-center>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue