fix: document.tile is not translated

This commit is contained in:
0xJacky 2023-12-03 12:42:57 +08:00
parent c783b962ac
commit 002d9c22ab
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
4 changed files with 9 additions and 5 deletions

View file

@ -7,6 +7,7 @@ import { computed } from 'vue'
const props = defineProps<{
content?: string
defaultHeight?: string
readonly?: boolean
}>()
const emit = defineEmits(['update:content'])
@ -30,6 +31,7 @@ const value = computed({
minHeight: defaultHeight || '100vh',
borderRadius: '5px',
}"
:readonly="readonly"
/>
</template>

View file

@ -13,11 +13,14 @@ const current = ref(gettext.current)
const languageAvailable = gettext.available
function init() {
async function init() {
if (current.value !== 'en') {
http.get(`/translation/${current.value}`).then(r => {
await http.get(`/translation/${current.value}`).then(r => {
gettext.translations[current.value] = r
})
// @ts-expect-error name type
document.title = `${route.name?.()} | Nginx UI`
}
}

View file

@ -8,5 +8,4 @@ export default createGettext({
silent: true,
})
export class useGettext {
}
export class useGettext {}

View file

@ -15,7 +15,7 @@ import {
} from '@ant-design/icons-vue'
import NProgress from 'nprogress'
import gettext from '../gettext'
import gettext from '@/gettext'
import { useUserStore } from '@/pinia'
import 'nprogress/nprogress.css'