refactor(frontend): remove $ts and $t

This commit is contained in:
syuilo
2023-04-01 14:01:57 +09:00
parent f16a7cbcf2
commit 9224b6635f
49 changed files with 183 additions and 165 deletions

View File

@@ -22,22 +22,22 @@
</h1>
<div class="about">
<!-- eslint-disable-next-line vue/no-v-html -->
<div class="desc" v-html="meta.description || $ts.headlineMisskey"></div>
<div class="desc" v-html="meta.description || i18n.ts.headlineMisskey"></div>
</div>
<div class="action">
<MkButton inline gradate @click="signup()">{{ $ts.signup }}</MkButton>
<MkButton inline @click="signin()">{{ $ts.login }}</MkButton>
<MkButton inline gradate @click="signup()">{{ i18n.ts.signup }}</MkButton>
<MkButton inline @click="signin()">{{ i18n.ts.login }}</MkButton>
</div>
<div v-if="onlineUsersCount && stats" class="status">
<div>
<I18n :src="$ts.nUsers" text-tag="span" class="users">
<I18n :src="i18n.ts.nUsers" text-tag="span" class="users">
<template #n><b>{{ number(stats.originalUsersCount) }}</b></template>
</I18n>
<I18n :src="$ts.nNotes" text-tag="span" class="notes">
<I18n :src="i18n.ts.nNotes" text-tag="span" class="notes">
<template #n><b>{{ number(stats.originalNotesCount) }}</b></template>
</I18n>
</div>
<I18n :src="$ts.onlineUsersCount" text-tag="span" class="online">
<I18n :src="i18n.ts.onlineUsersCount" text-tag="span" class="online">
<template #n><b>{{ onlineUsersCount }}</b></template>
</I18n>
</div>
@@ -45,10 +45,10 @@
</div>
</div>
<nav class="nav">
<MkA to="/announcements">{{ $ts.announcements }}</MkA>
<MkA to="/explore">{{ $ts.explore }}</MkA>
<MkA to="/channels">{{ $ts.channel }}</MkA>
<MkA to="/featured">{{ $ts.featured }}</MkA>
<MkA to="/announcements">{{ i18n.ts.announcements }}</MkA>
<MkA to="/explore">{{ i18n.ts.explore }}</MkA>
<MkA to="/channels">{{ i18n.ts.channel }}</MkA>
<MkA to="/featured">{{ i18n.ts.featured }}</MkA>
</nav>
</div>
</div>
@@ -58,15 +58,16 @@
<script lang="ts">
import { defineComponent } from 'vue';
import { toUnicode } from 'punycode/';
import XTimeline from './welcome.timeline.vue';
import XSigninDialog from '@/components/MkSigninDialog.vue';
import XSignupDialog from '@/components/MkSignupDialog.vue';
import MkButton from '@/components/MkButton.vue';
import MkNote from '@/components/MkNote.vue';
import MkFeaturedPhotos from '@/components/MkFeaturedPhotos.vue';
import XTimeline from './welcome.timeline.vue';
import { host, instanceName } from '@/config';
import * as os from '@/os';
import number from '@/filters/number';
import { i18n } from '@/i18n';
export default defineComponent({
components: {
@@ -84,6 +85,7 @@ export default defineComponent({
stats: null,
tags: [],
onlineUsersCount: null,
i18n,
};
},
@@ -123,22 +125,22 @@ export default defineComponent({
showMenu(ev) {
os.popupMenu([{
text: this.$t('aboutX', { x: instanceName }),
text: i18n.t('aboutX', { x: instanceName }),
icon: 'ti ti-info-circle',
action: () => {
os.pageWindow('/about');
},
}, {
text: this.$ts.aboutMisskey,
text: i18n.ts.aboutMisskey,
icon: 'ti ti-info-circle',
action: () => {
os.pageWindow('/about-misskey');
},
}, null, {
text: this.$ts.help,
text: i18n.ts.help,
icon: 'ti ti-question-circle',
action: () => {
window.open(`https://misskey-hub.net/help.md`, '_blank');
window.open('https://misskey-hub.net/help.md', '_blank');
},
}], ev.currentTarget ?? ev.target);
},