refactor: i18n

This commit is contained in:
Anthony Fu 2022-11-30 05:50:13 +08:00
parent 59e365591d
commit cf63bce459
11 changed files with 18 additions and 10 deletions

View file

@ -220,7 +220,7 @@ const onKeyDown = (e: KeyboardEvent) => {
:class="active === cmd.index ? 'opacity-100' : 'opacity-0'" :class="active === cmd.index ? 'opacity-100' : 'opacity-0'"
> >
<div class="text-xs text-secondary"> <div class="text-xs text-secondary">
Complete {{ $t('command.complete') }}
</div> </div>
<CommandKey name="Tab" /> <CommandKey name="Tab" />
</div> </div>
@ -230,7 +230,7 @@ const onKeyDown = (e: KeyboardEvent) => {
:class="active === cmd.index ? 'opacity-100' : 'opacity-0'" :class="active === cmd.index ? 'opacity-100' : 'opacity-0'"
> >
<div class="text-xs text-secondary"> <div class="text-xs text-secondary">
Activate {{ $t('command.activate') }}
</div> </div>
<CommandKey name="Enter" /> <CommandKey name="Enter" />
</div> </div>

View file

@ -21,11 +21,18 @@
"save_changes": "Save changes", "save_changes": "Save changes",
"sign_in": "Sign in" "sign_in": "Sign in"
}, },
"command": {
"activate": "Activate",
"complete": "Complete"
},
"common": { "common": {
"end_of_list": "End of the list", "end_of_list": "End of the list",
"error": "ERROR", "error": "ERROR",
"not_found": "404 Not Found" "not_found": "404 Not Found"
}, },
"error": {
"account_not_found": "Account {0} not found"
},
"feature_flag": { "feature_flag": {
"virtual_scroll": "Virtual Scrolling" "virtual_scroll": "Virtual Scrolling"
}, },

View file

@ -31,7 +31,7 @@ onReactivated(() => {
</template> </template>
<CommonNotFound v-else> <CommonNotFound v-else>
Account @{{ accountName }} not found {{ $t('error.account_not_found', [`@${accountName}`]) }}
</CommonNotFound> </CommonNotFound>
</MainContent> </MainContent>
</template> </template>

View file

@ -13,7 +13,7 @@ useHead({
<template> <template>
<MainContent back> <MainContent back>
<template #title> <template #title>
<span text-lg font-bold>Blocked users</span> <span text-lg font-bold>{{ $t('account.blocked_users') }}</span>
</template> </template>
<AccountPaginator :paginator="paginator" /> <AccountPaginator :paginator="paginator" />
</MainContent> </MainContent>

View file

@ -17,7 +17,7 @@ const unblock = async (domain: string) => {
<template> <template>
<MainContent back> <MainContent back>
<template #title> <template #title>
<span text-lg font-bold>Blocked domains</span> <span text-lg font-bold>{{ $t('account.blocked_domains') }}</span>
</template> </template>
<CommonPaginator :paginator="paginator"> <CommonPaginator :paginator="paginator">

View file

@ -13,7 +13,7 @@ useHead({
<template> <template>
<MainContent back> <MainContent back>
<template #title> <template #title>
<span text-lg font-bold>Muted users</span> <span text-lg font-bold>{{ $t('account.muted_users') }}</span>
</template> </template>
<AccountPaginator :paginator="paginator" /> <AccountPaginator :paginator="paginator" />
</MainContent> </MainContent>

View file

@ -4,9 +4,10 @@ definePageMeta({
}) })
const paginator = useMasto().accounts.getStatusesIterable(currentUser.value!.account.id, { pinned: true }) const paginator = useMasto().accounts.getStatusesIterable(currentUser.value!.account.id, { pinned: true })
const { t } = useI18n()
useHead({ useHead({
title: 'Pinned', title: () => t('account.pinned'),
}) })
</script> </script>
@ -14,7 +15,7 @@ useHead({
<MainContent> <MainContent>
<template #title> <template #title>
<div i-ri:pushpin-line h-6 mr-1 /> <div i-ri:pushpin-line h-6 mr-1 />
<span>Pinned</span> <span>{{ t('account.pinned') }}</span>
</template> </template>
<TimelinePaginator :paginator="paginator" /> <TimelinePaginator :paginator="paginator" />

View file

@ -6,7 +6,7 @@ onBeforeUnmount(() => stream.disconnect())
const { t } = useI18n() const { t } = useI18n()
useHead({ useHead({
title: () => t('nav_side.federated'), title: () => t('title.federated_timeline'),
}) })
</script> </script>

View file

@ -6,7 +6,7 @@ onBeforeUnmount(() => stream.disconnect())
const { t } = useI18n() const { t } = useI18n()
useHead({ useHead({
title: () => t('nav_side.local'), title: () => t('title.local_timeline'),
}) })
</script> </script>