refactor (client, minor): replace i18n.t with i18n.ts

This commit is contained in:
naskya 2024-04-03 13:36:09 +09:00
parent 46baec14d2
commit 6dc4f3d8a1
No known key found for this signature in database
GPG Key ID: 712D413B3A9FED5C
19 changed files with 38 additions and 38 deletions

View File

@ -49,7 +49,7 @@
<button
class="_button"
:class="$style.close"
:aria-label="i18n.t('close')"
:aria-label="i18n.ts.close"
@click="close"
>
<i :class="icon('ph-x')"></i>

View File

@ -123,7 +123,7 @@ async function onClick() {
if (isBlocking.value) {
const { canceled } = await os.confirm({
type: "warning",
text: i18n.t("unblockConfirm"),
text: i18n.ts.unblockConfirm,
});
if (canceled) return;

View File

@ -7,7 +7,7 @@
v-if="closeable"
v-tooltip="i18n.ts.close"
class="_buttonIcon close"
:aria-label="i18n.t('close')"
:aria-label="i18n.ts.close"
@click.stop="close"
>
<i :class="iconClass('ph-x')"></i>

View File

@ -28,7 +28,7 @@
</span>
<button
class="_button"
:aria-label="i18n.t('close')"
:aria-label="i18n.ts.close"
@click="$refs.modal.close()"
>
<i :class="icon('ph-x')"></i>

View File

@ -26,7 +26,7 @@
<button
v-if="props.withOkButton"
v-tooltip="i18n.ts.close"
:aria-label="i18n.t('close')"
:aria-label="i18n.ts.close"
class="_button"
@click="$emit('close')"
>
@ -37,7 +37,7 @@
</span>
<button
v-if="!props.withOkButton"
:aria-label="i18n.t('close')"
:aria-label="i18n.ts.close"
class="_button"
@click="$emit('close')"
>
@ -45,7 +45,7 @@
</button>
<button
v-if="props.withOkButton"
:aria-label="i18n.t('ok')"
:aria-label="i18n.ts.ok"
class="_button"
:disabled="props.okButtonDisabled"
@click="$emit('ok')"

View File

@ -636,9 +636,9 @@ function setPostExpanded(val: boolean) {
const accessibleLabel = computed(() => {
let label = `${appearNote.value.user.username}; `;
if (appearNote.value.renote) {
label += `${i18n.t("renoted")} ${appearNote.value.renote.user.username}; `;
label += `${i18n.ts.renoted} ${appearNote.value.renote.user.username}; `;
if (appearNote.value.renote.cw) {
label += `${i18n.t("cw")}: ${appearNote.value.renote.cw}; `;
label += `${i18n.ts.cw}: ${appearNote.value.renote.cw}; `;
if (postIsExpanded.value) {
label += `${appearNote.value.renote.text}; `;
}
@ -647,7 +647,7 @@ const accessibleLabel = computed(() => {
}
} else {
if (appearNote.value.cw) {
label += `${i18n.t("cw")}: ${appearNote.value.cw}; `;
label += `${i18n.ts.cw}: ${appearNote.value.cw}; `;
if (postIsExpanded.value) {
label += `${appearNote.value.text}; `;
}

View File

@ -16,7 +16,7 @@
</MkInput>
<button
class="_button"
:aria-label="i18n.t('remove')"
:aria-label="i18n.ts.remove"
@click="remove(i)"
>
<i :class="icon('ph-x')"></i>

View File

@ -11,7 +11,7 @@
>
<header>
<button v-if="!fixed" class="cancel _button" @click="cancel">
<i :class="icon('ph-x')" :aria-label="i18n.t('close')"></i>
<i :class="icon('ph-x')" :aria-label="i18n.ts.close"></i>
</button>
<button
v-if="$props.editId == null"
@ -108,7 +108,7 @@
{{ i18n.ts.quoteAttached
}}<button
class="_button"
:aria-label="i18n.t('removeQuote')"
:aria-label="i18n.ts.removeQuote"
@click="quoteId = null"
>
<i :class="icon('ph-x')"></i>
@ -121,7 +121,7 @@
<MkAcct :user="u" />
<button
class="_button"
:aria-label="i18n.t('removeRecipient')"
:aria-label="i18n.ts.removeRecipient"
@click="removeVisibleUser(u)"
>
<i :class="icon('ph-x')"></i>

View File

@ -39,7 +39,7 @@
</button>
<button
class="remove _button"
:aria-label="i18n.t('close')"
:aria-label="i18n.ts.close"
@click.prevent.stop="removeWidget(element)"
>
<i :class="icon('ph-x')"></i>

View File

@ -59,14 +59,14 @@
<div class="actions">
<button
class="_button"
:aria-label="i18n.t('accept')"
:aria-label="i18n.ts.accept"
@click="accept(req.follower)"
>
<i :class="icon('ph-check')"></i>
</button>
<button
class="_button"
:aria-label="i18n.t('reject')"
:aria-label="i18n.ts.reject"
@click="reject(req.follower)"
>
<i :class="icon('ph-x')"></i>

View File

@ -28,7 +28,7 @@
<button
v-tooltip="i18n.ts.remove"
class="remove _button"
:aria-label="i18n.t('remove')"
:aria-label="i18n.ts.remove"
@click="remove(file)"
>
<i :class="icon('ph-x')"></i>

View File

@ -19,14 +19,14 @@
<div class="buttons">
<button
class="_button"
:aria-label="i18n.t('attachFile')"
:aria-label="i18n.ts.attachFile"
@click="chooseFile"
>
<i :class="icon('ph-upload')"></i>
</button>
<button
class="_button"
:aria-label="i18n.t('chooseEmoji')"
:aria-label="i18n.ts.chooseEmoji"
@click="insertEmoji"
>
<i :class="icon('ph-smiley')"></i>

View File

@ -22,7 +22,7 @@
<div class="action">
<button
class="_button"
:aria-label="i18n.t('removeMember')"
:aria-label="i18n.ts.removeMember"
@click="removeUser(user)"
>
<i :class="icon('ph-x')"></i>

View File

@ -49,7 +49,7 @@
<div class="action">
<button
class="_button"
:aria-label="i18n.t('removeMember')"
:aria-label="i18n.ts.removeMember"
@click="removeUser(user)"
>
<i :class="icon('ph-x')"></i>

View File

@ -104,7 +104,7 @@
<XV
v-if="modelValue.value.expression"
v-model="modelValue.value.expression"
:title="i18n.t(`_pages.script.blocks._fn.arg1`)"
:title="i18n.ts._pages.script.blocks._fn.arg1"
:get-expected-type="() => null"
:hpml="hpml"
:fn-slots="modelValue.value.slots"

View File

@ -431,7 +431,7 @@ function getScriptBlockList(type: string = null) {
const userFns = variables.value.filter((x) => x.type === "fn");
if (userFns.length > 0) {
list.unshift({
label: i18n.t("_pages.script.categories.fn"),
label: i18n.ts._pages.script.categories.fn,
items: userFns.map((v) => ({
value: "fn:" + v.name,
text: v.name,

View File

@ -239,7 +239,7 @@ function changeAvatar(ev) {
const { canceled } = await os.yesno({
type: "question",
text: i18n.t("cropImageAsk"),
text: i18n.ts.cropImageAsk,
});
if (!canceled) {
@ -264,7 +264,7 @@ function changeBanner(ev) {
const { canceled } = await os.yesno({
type: "question",
text: i18n.t("cropImageAsk"),
text: i18n.ts.cropImageAsk,
});
if (!canceled) {

View File

@ -123,7 +123,7 @@
<div v-if="isMobile" class="buttons">
<button
:aria-label="i18n.t('menu')"
:aria-label="i18n.ts.menu"
class="button nav _button"
@click="drawerMenuShowing = true"
>
@ -138,14 +138,14 @@
></span>
</button>
<button
:aria-label="i18n.t('home')"
:aria-label="i18n.ts.home"
class="button home _button"
@click="mainRouter.push('/')"
>
<i :class="icon('ph-house')"></i>
</button>
<button
:aria-label="i18n.t('notifications')"
:aria-label="i18n.ts.notifications"
class="button notifications _button"
@click="mainRouter.push('/my/notifications')"
>
@ -160,7 +160,7 @@
></span>
</button>
<button
:aria-label="i18n.t('note')"
:aria-label="i18n.ts.note"
class="button post _button"
@click="os.post()"
>

View File

@ -35,7 +35,7 @@
<div v-if="isMobile" class="buttons">
<button
v-vibrate="5"
:aria-label="i18n.t('menu')"
:aria-label="i18n.ts.menu"
class="button nav _button"
@click="drawerMenuShowing = true"
>
@ -53,7 +53,7 @@
</button>
<button
v-vibrate="5"
:aria-label="i18n.t('home')"
:aria-label="i18n.ts.home"
class="button home _button"
@click="
mainRouter.currentRoute.value.name === 'index'
@ -71,7 +71,7 @@
</button>
<button
v-vibrate="5"
:aria-label="i18n.t('notifications')"
:aria-label="i18n.ts.notifications"
class="button notifications _button"
@click="
mainRouter.push('/my/notifications');
@ -96,7 +96,7 @@
</button>
<button
v-if="replaceChatButtonWithAccountButton"
:aria-label="i18n.t('accounts')"
:aria-label="i18n.ts.accounts"
class="button messaging _button"
@click="openAccountMenu"
>
@ -107,7 +107,7 @@
<button
v-else
v-vibrate="5"
:aria-label="i18n.t('messaging')"
:aria-label="i18n.ts.messaging"
class="button messaging _button"
@click="
mainRouter.push('/my/messaging');
@ -142,7 +142,7 @@
<button
v-else
v-vibrate="5"
:aria-label="i18n.t('_deck._columns.widgets')"
:aria-label="i18n.ts._deck._columns.widgets"
class="button widget _button"
@click="widgetsShowing = true"
>
@ -156,7 +156,7 @@
v-if="isMobile && mainRouter.currentRoute.value.name === 'index'"
ref="postButton"
v-vibrate="5"
:aria-label="i18n.t('note')"
:aria-label="i18n.ts.note"
class="postButton button post _button"
@click="os.post()"
>
@ -168,7 +168,7 @@
"
ref="postButton"
class="postButton button post _button"
:aria-label="i18n.t('startMessaging')"
:aria-label="i18n.ts.startMessaging"
@click="messagingStart"
>
<i :class="icon('ph-user-plus')"></i>