From 5a8cc7851b4af9ae4a0d7efc5b66b224bbe9b4c8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 26 Dec 2020 10:47:36 +0900 Subject: [PATCH] wip --- src/client/components/abuse-report-window.vue | 10 +- src/client/components/autocomplete.vue | 2 +- src/client/components/captcha.vue | 2 +- .../components/channel-follow-button.vue | 6 +- src/client/components/channel-preview.vue | 6 +- src/client/components/cw-button.vue | 4 +- src/client/components/dialog.vue | 4 +- src/client/components/drive-select-dialog.vue | 2 +- src/client/components/drive-window.vue | 2 +- src/client/components/drive.file.vue | 20 +- src/client/components/drive.folder.vue | 24 +-- src/client/components/drive.nav-folder.vue | 2 +- src/client/components/drive.vue | 50 ++--- src/client/components/emoji-picker.vue | 6 +- src/client/components/follow-button.vue | 12 +- src/client/components/form-dialog.vue | 10 +- src/client/components/form/input.vue | 2 +- src/client/components/form/pagination.vue | 2 +- src/client/components/form/textarea.vue | 2 +- src/client/components/global/a.vue | 10 +- src/client/components/global/error.vue | 4 +- src/client/components/global/i18n.ts | 32 +++- src/client/components/global/time.vue | 6 +- src/client/components/google.vue | 2 +- src/client/components/instance-stats.vue | 80 ++++---- src/client/components/launch-pad.vue | 4 +- src/client/components/media-banner.vue | 4 +- src/client/components/media-image.vue | 4 +- src/client/components/media-video.vue | 4 +- src/client/components/mention.vue | 2 +- src/client/components/note.vue | 82 ++++----- src/client/components/notes.vue | 6 +- .../notification-setting-window.vue | 12 +- src/client/components/notification.vue | 8 +- src/client/components/notifications.vue | 4 +- src/client/components/page-window.vue | 10 +- src/client/components/poll-editor.vue | 30 +-- src/client/components/poll.vue | 6 +- src/client/components/post-form-attaches.vue | 8 +- src/client/components/post-form.vue | 48 ++--- src/client/components/remote-caution.vue | 2 +- src/client/components/sidebar.vue | 40 ++-- src/client/components/signin-dialog.vue | 2 +- src/client/components/signin.vue | 26 +-- src/client/components/signup-dialog.vue | 2 +- src/client/components/signup.vue | 40 ++-- src/client/components/sub-note-content.vue | 6 +- .../components/token-generate-window.vue | 10 +- src/client/components/ui/input.vue | 2 +- src/client/components/ui/menu.vue | 2 +- src/client/components/ui/pagination.vue | 2 +- src/client/components/ui/textarea.vue | 2 +- src/client/components/url-preview.vue | 6 +- src/client/components/user-info.vue | 8 +- src/client/components/user-list.vue | 4 +- src/client/components/user-preview.vue | 6 +- src/client/components/user-select-dialog.vue | 8 +- src/client/components/users-dialog.vue | 4 +- src/client/components/visibility-picker.vue | 20 +- src/client/i18n.ts | 7 + src/client/pages/_error_.vue | 6 +- src/client/pages/about-misskey.vue | 18 +- src/client/pages/about.vue | 8 +- src/client/pages/announcements.vue | 4 +- src/client/pages/auth.form.vue | 6 +- src/client/pages/auth.vue | 10 +- src/client/pages/channel-editor.vue | 14 +- src/client/pages/channel.vue | 4 +- src/client/pages/channels.vue | 8 +- src/client/pages/clip.vue | 10 +- src/client/pages/doc.vue | 2 +- src/client/pages/docs.vue | 2 +- src/client/pages/drive.vue | 2 +- src/client/pages/explore.vue | 22 +-- src/client/pages/favorites.vue | 2 +- src/client/pages/featured.vue | 2 +- src/client/pages/follow-requests.vue | 4 +- src/client/pages/follow.vue | 2 +- src/client/pages/instance/abuses.vue | 32 ++-- src/client/pages/instance/announcements.vue | 18 +- .../pages/instance/emoji-edit-dialog.vue | 10 +- src/client/pages/instance/emojis.vue | 20 +- src/client/pages/instance/federation.vue | 58 +++--- src/client/pages/instance/file-dialog.vue | 4 +- src/client/pages/instance/files.vue | 30 +-- src/client/pages/instance/index.metrics.vue | 12 +- src/client/pages/instance/index.vue | 14 +- src/client/pages/instance/instance.vue | 74 ++++---- src/client/pages/instance/logs.vue | 20 +- src/client/pages/instance/queue.chart.vue | 2 +- src/client/pages/instance/queue.vue | 8 +- src/client/pages/instance/relays.vue | 12 +- src/client/pages/instance/settings.vue | 174 +++++++++--------- src/client/pages/instance/user-dialog.vue | 20 +- src/client/pages/instance/users.vue | 58 +++--- src/client/pages/mentions.vue | 2 +- src/client/pages/messages.vue | 2 +- src/client/pages/messaging/index.vue | 18 +- .../pages/messaging/messaging-room.form.vue | 12 +- .../messaging/messaging-room.message.vue | 8 +- src/client/pages/messaging/messaging-room.vue | 14 +- src/client/pages/mfm-cheat-sheet.vue | 102 +++++----- src/client/pages/miauth.vue | 14 +- .../pages/my-antennas/index.antenna.vue | 42 ++--- src/client/pages/my-antennas/index.vue | 4 +- src/client/pages/my-clips/index.vue | 12 +- src/client/pages/my-groups/group.vue | 12 +- src/client/pages/my-groups/index.vue | 16 +- src/client/pages/my-lists/index.vue | 6 +- src/client/pages/my-lists/list.vue | 10 +- src/client/pages/not-found.vue | 4 +- src/client/pages/note.vue | 4 +- src/client/pages/notifications.vue | 2 +- .../page-editor/els/page-editor.el.button.vue | 30 +-- .../page-editor/els/page-editor.el.canvas.vue | 8 +- .../els/page-editor.el.counter.vue | 8 +- .../page-editor/els/page-editor.el.if.vue | 10 +- .../page-editor/els/page-editor.el.image.vue | 2 +- .../page-editor/els/page-editor.el.note.vue | 8 +- .../els/page-editor.el.number-input.vue | 8 +- .../page-editor/els/page-editor.el.post.vue | 8 +- .../els/page-editor.el.radio-button.vue | 10 +- .../els/page-editor.el.section.vue | 2 +- .../page-editor/els/page-editor.el.switch.vue | 8 +- .../els/page-editor.el.text-input.vue | 8 +- .../page-editor/els/page-editor.el.text.vue | 2 +- .../els/page-editor.el.textarea-input.vue | 8 +- .../els/page-editor.el.textarea.vue | 2 +- .../page-editor/page-editor.script-block.vue | 14 +- src/client/pages/page-editor/page-editor.vue | 96 +++++----- src/client/pages/page.vue | 12 +- src/client/pages/pages.vue | 8 +- src/client/pages/reversi/game.board.vue | 20 +- src/client/pages/reversi/game.setting.vue | 38 ++-- src/client/pages/reversi/game.vue | 2 +- src/client/pages/reversi/index.vue | 20 +- src/client/pages/room/room.vue | 32 ++-- src/client/pages/scratchpad.vue | 6 +- src/client/pages/settings/2fa.vue | 50 ++--- src/client/pages/settings/account-info.vue | 62 +++---- src/client/pages/settings/api.vue | 6 +- src/client/pages/settings/apps.vue | 10 +- src/client/pages/settings/deck.vue | 14 +- src/client/pages/settings/drive.vue | 6 +- src/client/pages/settings/email-address.vue | 12 +- src/client/pages/settings/email.vue | 6 +- .../pages/settings/experimental-features.vue | 2 +- src/client/pages/settings/general.vue | 76 ++++---- src/client/pages/settings/import-export.vue | 20 +- src/client/pages/settings/index.vue | 40 ++-- src/client/pages/settings/integration.vue | 20 +- src/client/pages/settings/mute-block.vue | 10 +- src/client/pages/settings/notifications.vue | 10 +- src/client/pages/settings/other.vue | 10 +- src/client/pages/settings/plugins.vue | 28 +-- src/client/pages/settings/privacy.vue | 30 +-- src/client/pages/settings/profile.vue | 50 ++--- src/client/pages/settings/reaction.vue | 30 +-- src/client/pages/settings/security.vue | 22 +-- src/client/pages/settings/sidebar.vue | 22 +-- src/client/pages/settings/sounds.vue | 18 +- src/client/pages/settings/theme.install.vue | 14 +- src/client/pages/settings/theme.manage.vue | 14 +- src/client/pages/settings/theme.vue | 30 +-- src/client/pages/settings/word-mute.vue | 22 +-- src/client/pages/share.vue | 4 +- src/client/pages/theme-editor.vue | 60 +++--- src/client/pages/timeline.tutorial.vue | 56 +++--- src/client/pages/timeline.vue | 10 +- src/client/pages/user/index.activity.vue | 2 +- src/client/pages/user/index.photos.vue | 4 +- src/client/pages/user/index.timeline.vue | 6 +- src/client/pages/user/index.vue | 64 +++---- src/client/pages/welcome.entrance.vue | 4 +- src/client/pages/welcome.setup.vue | 10 +- src/client/ui/_common_/stream-indicator.vue | 6 +- src/client/ui/_common_/upload.vue | 2 +- src/client/ui/deck.vue | 2 +- src/client/ui/deck/antenna-column.vue | 4 +- src/client/ui/deck/column.vue | 18 +- src/client/ui/deck/list-column.vue | 4 +- src/client/ui/deck/notifications-column.vue | 2 +- src/client/ui/deck/tl-column.vue | 12 +- src/client/ui/deck/widgets-column.vue | 8 +- src/client/ui/default.side.vue | 8 +- src/client/ui/default.vue | 4 +- src/client/ui/default.widgets.vue | 6 +- src/client/ui/visitor/a.vue | 6 +- src/client/ui/visitor/b.vue | 12 +- src/client/ui/visitor/header.vue | 14 +- src/client/ui/visitor/kanban.vue | 8 +- src/client/widgets/activity.vue | 2 +- src/client/widgets/calendar.vue | 20 +- src/client/widgets/federation.vue | 2 +- src/client/widgets/memo.vue | 6 +- src/client/widgets/notifications.vue | 2 +- src/client/widgets/photos.vue | 2 +- src/client/widgets/slideshow.vue | 2 +- src/client/widgets/timeline.vue | 8 +- src/client/widgets/trends.vue | 2 +- 200 files changed, 1562 insertions(+), 1533 deletions(-) diff --git a/src/client/components/abuse-report-window.vue b/src/client/components/abuse-report-window.vue index c550e1e85d..98578ee44f 100644 --- a/src/client/components/abuse-report-window.vue +++ b/src/client/components/abuse-report-window.vue @@ -2,7 +2,7 @@ diff --git a/src/client/components/channel-preview.vue b/src/client/components/channel-preview.vue index 241fbe4f68..e222ad7ae7 100644 --- a/src/client/components/channel-preview.vue +++ b/src/client/components/channel-preview.vue @@ -6,7 +6,7 @@
- + @@ -14,7 +14,7 @@
- + @@ -27,7 +27,7 @@
- {{ $t('updatedAt') }}: + {{ $ts.updatedAt }}:
diff --git a/src/client/components/cw-button.vue b/src/client/components/cw-button.vue index d052c410d1..d2336085ad 100644 --- a/src/client/components/cw-button.vue +++ b/src/client/components/cw-button.vue @@ -1,6 +1,6 @@ @@ -27,7 +27,7 @@ export default defineComponent({ return concat([ this.note.text ? [this.$t('_cw.chars', { count: length(this.note.text) })] : [], this.note.files && this.note.files.length !== 0 ? [this.$t('_cw.files', { count: this.note.files.length }) ] : [], - this.note.poll != null ? [this.$t('poll')] : [] + this.note.poll != null ? [this.$ts.poll] : [] ] as string[][]).join(' / '); } }, diff --git a/src/client/components/dialog.vue b/src/client/components/dialog.vue index f8d700202a..a34f7f7947 100644 --- a/src/client/components/dialog.vue +++ b/src/client/components/dialog.vue @@ -26,8 +26,8 @@
- {{ (showCancelButton || input || select) ? $t('ok') : $t('gotIt') }} - {{ $t('cancel') }} + {{ (showCancelButton || input || select) ? $ts.ok : $ts.gotIt }} + {{ $ts.cancel }}
{{ action.text }} diff --git a/src/client/components/drive-select-dialog.vue b/src/client/components/drive-select-dialog.vue index 5221bdbb63..f9a4025452 100644 --- a/src/client/components/drive-select-dialog.vue +++ b/src/client/components/drive-select-dialog.vue @@ -10,7 +10,7 @@ @closed="$emit('closed')" > diff --git a/src/client/components/drive-window.vue b/src/client/components/drive-window.vue index 0806fc1808..43f07ebe76 100644 --- a/src/client/components/drive-window.vue +++ b/src/client/components/drive-window.vue @@ -6,7 +6,7 @@ @closed="$emit('closed')" > diff --git a/src/client/components/drive.file.vue b/src/client/components/drive.file.vue index 81e314a725..ddee81261e 100644 --- a/src/client/components/drive.file.vue +++ b/src/client/components/drive.file.vue @@ -10,15 +10,15 @@ >
-

{{ $t('avatar') }}

+

{{ $ts.avatar }}

-

{{ $t('banner') }}

+

{{ $ts.banner }}

-

{{ $t('nsfw') }}

+

{{ $ts.nsfw }}

@@ -82,26 +82,26 @@ export default defineComponent({ methods: { getMenu() { return [{ - text: this.$t('rename'), + text: this.$ts.rename, icon: faICursor, action: this.rename }, { - text: this.file.isSensitive ? this.$t('unmarkAsSensitive') : this.$t('markAsSensitive'), + text: this.file.isSensitive ? this.$ts.unmarkAsSensitive : this.$ts.markAsSensitive, icon: this.file.isSensitive ? faEye : faEyeSlash, action: this.toggleSensitive }, null, { - text: this.$t('copyUrl'), + text: this.$ts.copyUrl, icon: faLink, action: this.copyUrl }, { type: 'a', href: this.file.url, target: '_blank', - text: this.$t('download'), + text: this.$ts.download, icon: faDownload, download: this.file.name }, null, { - text: this.$t('delete'), + text: this.$ts.delete, icon: faTrashAlt, danger: true, action: this.deleteFile @@ -137,9 +137,9 @@ export default defineComponent({ rename() { os.dialog({ - title: this.$t('renameFile'), + title: this.$ts.renameFile, input: { - placeholder: this.$t('inputNewFileName'), + placeholder: this.$ts.inputNewFileName, default: this.file.name, allowEmpty: false } diff --git a/src/client/components/drive.folder.vue b/src/client/components/drive.folder.vue index 79ae789f78..745b6018da 100644 --- a/src/client/components/drive.folder.vue +++ b/src/client/components/drive.folder.vue @@ -20,7 +20,7 @@ {{ folder.name }}

- {{ $t('uploadFolder') }} + {{ $ts.uploadFolder }}

@@ -155,14 +155,14 @@ export default defineComponent({ switch (err) { case 'detected-circular-definition': os.dialog({ - title: this.$t('unableToProcess'), - text: this.$t('circularReferenceFolder') + title: this.$ts.unableToProcess, + text: this.$ts.circularReferenceFolder }); break; default: os.dialog({ type: 'error', - text: this.$t('somethingHappened') + text: this.$ts.somethingHappened }); } }); @@ -195,9 +195,9 @@ export default defineComponent({ rename() { os.dialog({ - title: this.$t('renameFolder'), + title: this.$ts.renameFolder, input: { - placeholder: this.$t('inputNewFolderName'), + placeholder: this.$ts.inputNewFolderName, default: this.folder.name } }).then(({ canceled, result: name }) => { @@ -221,14 +221,14 @@ export default defineComponent({ case 'b0fc8a17-963c-405d-bfbc-859a487295e1': os.dialog({ type: 'error', - title: this.$t('unableToDelete'), - text: this.$t('hasChildFilesOrFolders') + title: this.$ts.unableToDelete, + text: this.$ts.hasChildFilesOrFolders }); break; default: os.dialog({ type: 'error', - text: this.$t('unableToDelete') + text: this.$ts.unableToDelete }); } }); @@ -240,7 +240,7 @@ export default defineComponent({ onContextmenu(e) { os.contextMenu([{ - text: this.$t('openInWindow'), + text: this.$ts.openInWindow, icon: faWindowRestore, action: () => { os.popup(import('./drive-window.vue'), { @@ -249,11 +249,11 @@ export default defineComponent({ }, 'closed'); } }, null, { - text: this.$t('rename'), + text: this.$ts.rename, icon: faICursor, action: this.rename }, null, { - text: this.$t('delete'), + text: this.$ts.delete, icon: faTrashAlt, danger: true, action: this.deleteFolder diff --git a/src/client/components/drive.nav-folder.vue b/src/client/components/drive.nav-folder.vue index 16ebc433fa..881330529c 100644 --- a/src/client/components/drive.nav-folder.vue +++ b/src/client/components/drive.nav-folder.vue @@ -8,7 +8,7 @@ @drop.stop="onDrop" > - {{ folder == null ? $t('drive') : folder.name }} + {{ folder == null ? $ts.drive : folder.name }}
diff --git a/src/client/components/drive.vue b/src/client/components/drive.vue index a743249b9d..64e4d51e23 100644 --- a/src/client/components/drive.vue +++ b/src/client/components/drive.vue @@ -24,18 +24,18 @@
- {{ $t('loadMore') }} + {{ $ts.loadMore }}
- {{ $t('loadMore') }} + {{ $ts.loadMore }}

{{ $t('empty-draghover') }}

-

{{ $t('emptyDrive') }}
{{ $t('empty-drive-description') }}

-

{{ $t('emptyFolder') }}

+

{{ $ts.emptyDrive }}
{{ $t('empty-drive-description') }}

+

{{ $ts.emptyFolder }}

@@ -277,14 +277,14 @@ export default defineComponent({ switch (err) { case 'detected-circular-definition': os.dialog({ - title: this.$t('unableToProcess'), - text: this.$t('circularReferenceFolder') + title: this.$ts.unableToProcess, + text: this.$ts.circularReferenceFolder }); break; default: os.dialog({ type: 'error', - text: this.$t('somethingHappened') + text: this.$ts.somethingHappened }); } }); @@ -298,9 +298,9 @@ export default defineComponent({ urlUpload() { os.dialog({ - title: this.$t('uploadFromUrl'), + title: this.$ts.uploadFromUrl, input: { - placeholder: this.$t('uploadFromUrlDescription') + placeholder: this.$ts.uploadFromUrlDescription } }).then(({ canceled, result: url }) => { if (canceled) return; @@ -310,17 +310,17 @@ export default defineComponent({ }); os.dialog({ - title: this.$t('uploadFromUrlRequested'), - text: this.$t('uploadFromUrlMayTakeTime') + title: this.$ts.uploadFromUrlRequested, + text: this.$ts.uploadFromUrlMayTakeTime }); }); }, createFolder() { os.dialog({ - title: this.$t('createFolder'), + title: this.$ts.createFolder, input: { - placeholder: this.$t('folderName') + placeholder: this.$ts.folderName } }).then(({ canceled, result: name }) => { if (canceled) return; @@ -335,9 +335,9 @@ export default defineComponent({ renameFolder(folder) { os.dialog({ - title: this.$t('renameFolder'), + title: this.$ts.renameFolder, input: { - placeholder: this.$t('inputNewFolderName'), + placeholder: this.$ts.inputNewFolderName, default: folder.name } }).then(({ canceled, result: name }) => { @@ -363,14 +363,14 @@ export default defineComponent({ case 'b0fc8a17-963c-405d-bfbc-859a487295e1': os.dialog({ type: 'error', - title: this.$t('unableToDelete'), - text: this.$t('hasChildFilesOrFolders') + title: this.$ts.unableToDelete, + text: this.$ts.hasChildFilesOrFolders }); break; default: os.dialog({ type: 'error', - text: this.$t('unableToDelete') + text: this.$ts.unableToDelete }); } }); @@ -602,29 +602,29 @@ export default defineComponent({ getMenu() { return [{ - text: this.$t('addFile'), + text: this.$ts.addFile, type: 'label' }, { - text: this.$t('upload'), + text: this.$ts.upload, icon: faUpload, action: () => { this.selectLocalFile(); } }, { - text: this.$t('fromUrl'), + text: this.$ts.fromUrl, icon: faLink, action: () => { this.urlUpload(); } }, null, { - text: this.folder ? this.folder.name : this.$t('drive'), + text: this.folder ? this.folder.name : this.$ts.drive, type: 'label' }, this.folder ? { - text: this.$t('renameFolder'), + text: this.$ts.renameFolder, icon: faICursor, action: () => { this.renameFolder(this.folder); } } : undefined, this.folder ? { - text: this.$t('deleteFolder'), + text: this.$ts.deleteFolder, icon: faTrashAlt, action: () => { this.deleteFolder(this.folder); } } : undefined, { - text: this.$t('createFolder'), + text: this.$ts.createFolder, icon: faFolderPlus, action: () => { this.createFolder(); } }]; diff --git a/src/client/components/emoji-picker.vue b/src/client/components/emoji-picker.vue index a9fa357086..996dc7067c 100644 --- a/src/client/components/emoji-picker.vue +++ b/src/client/components/emoji-picker.vue @@ -1,7 +1,7 @@ diff --git a/src/client/components/form-dialog.vue b/src/client/components/form-dialog.vue index add6b230d3..7620abcd76 100644 --- a/src/client/components/form-dialog.vue +++ b/src/client/components/form-dialog.vue @@ -15,15 +15,15 @@ diff --git a/src/client/components/form/pagination.vue b/src/client/components/form/pagination.vue index 7dcaedf9bf..df65d9684d 100644 --- a/src/client/components/form/pagination.vue +++ b/src/client/components/form/pagination.vue @@ -6,7 +6,7 @@ - + diff --git a/src/client/components/form/textarea.vue b/src/client/components/form/textarea.vue index d84b48197a..711cd50124 100644 --- a/src/client/components/form/textarea.vue +++ b/src/client/components/form/textarea.vue @@ -14,7 +14,7 @@ @blur="focused = false" > - +
diff --git a/src/client/components/global/a.vue b/src/client/components/global/a.vue index e936003018..671245fec7 100644 --- a/src/client/components/global/a.vue +++ b/src/client/components/global/a.vue @@ -58,31 +58,31 @@ export default defineComponent({ text: this.to, }, { icon: faWindowMaximize, - text: this.$t('openInWindow'), + text: this.$ts.openInWindow, action: () => { os.pageWindow(this.to); } }, this.sideViewHook ? { icon: faColumns, - text: this.$t('openInSideView'), + text: this.$ts.openInSideView, action: () => { this.sideViewHook(this.to); } } : undefined, { icon: faExpandAlt, - text: this.$t('showInPage'), + text: this.$ts.showInPage, action: () => { this.$router.push(this.to); } }, null, { icon: faExternalLinkAlt, - text: this.$t('openInNewTab'), + text: this.$ts.openInNewTab, action: () => { window.open(this.to, '_blank'); } }, { icon: faLink, - text: this.$t('copyLink'), + text: this.$ts.copyLink, action: () => { copyToClipboard(`${url}${this.to}`); } diff --git a/src/client/components/global/error.vue b/src/client/components/global/error.vue index e4c76faa31..b78973ff82 100644 --- a/src/client/components/global/error.vue +++ b/src/client/components/global/error.vue @@ -2,8 +2,8 @@
-

{{ $t('somethingHappened') }}

- {{ $t('retry') }} +

{{ $ts.somethingHappened }}

+ {{ $ts.retry }}
diff --git a/src/client/components/global/i18n.ts b/src/client/components/global/i18n.ts index 603c07ca97..b1142caf96 100644 --- a/src/client/components/global/i18n.ts +++ b/src/client/components/global/i18n.ts @@ -1,15 +1,37 @@ -import { h, Fragment, defineComponent } from 'vue'; -import type { SetupContext, VNodeChild, RenderFunction } from 'vue'; +import { h, defineComponent } from 'vue'; export default defineComponent({ props: { src: { type: String, - required: true + required: true, + }, + tag: { + type: String, + required: false, + default: 'span', }, }, render() { - // TODO - return h('span', this.src); + let str = this.src; + const parsed = [] as (string | { arg: string; })[]; + while (true) { + const nextBracketOpen = str.indexOf('{'); + const nextBracketClose = str.indexOf('}'); + + if (nextBracketOpen === -1) { + parsed.push(str); + break; + } else { + if (nextBracketOpen > 0) parsed.push(str.substr(0, nextBracketOpen)); + parsed.push({ + arg: str.substring(nextBracketOpen + 1, nextBracketClose) + }); + } + + str = str.substr(nextBracketClose + 1); + } + + return h(this.tag, parsed.map(x => typeof x === 'string' ? x : this.$slots[x.arg]())); } }); diff --git a/src/client/components/global/time.vue b/src/client/components/global/time.vue index 544746c24b..6a330a2307 100644 --- a/src/client/components/global/time.vue +++ b/src/client/components/global/time.vue @@ -44,9 +44,9 @@ export default defineComponent({ ago >= 3600 ? this.$t('_ago.hoursAgo', { n: (~~(ago / 3600)).toString() }) : ago >= 60 ? this.$t('_ago.minutesAgo', { n: (~~(ago / 60)).toString() }) : ago >= 10 ? this.$t('_ago.secondsAgo', { n: (~~(ago % 60)).toString() }) : - ago >= -1 ? this.$t('_ago.justNow') : - ago < -1 ? this.$t('_ago.future') : - this.$t('_ago.unknown')); + ago >= -1 ? this.$ts._ago.justNow : + ago < -1 ? this.$ts._ago.future : + this.$ts._ago.unknown); } }, created() { diff --git a/src/client/components/google.vue b/src/client/components/google.vue index a63a1476a9..fe692a9255 100644 --- a/src/client/components/google.vue +++ b/src/client/components/google.vue @@ -1,7 +1,7 @@ diff --git a/src/client/components/instance-stats.vue b/src/client/components/instance-stats.vue index 652cedcebb..e9b496180a 100644 --- a/src/client/components/instance-stats.vue +++ b/src/client/components/instance-stats.vue @@ -3,80 +3,80 @@
- {{ $t('users') }} - {{ $t('local') }} + {{ $ts.users }} + {{ $ts.local }}
-
{{ $t('total') }}
+
{{ $ts.total }}
{{ number(info.originalUsersCount) }}
-
{{ $t('dayOverDayChanges') }}
+
{{ $ts.dayOverDayChanges }}
{{ number(usersLocalDoD) }}
-
{{ $t('weekOverWeekChanges') }}
+
{{ $ts.weekOverWeekChanges }}
{{ number(usersLocalWoW) }}
- {{ $t('users') }} - {{ $t('remote') }} + {{ $ts.users }} + {{ $ts.remote }}
-
{{ $t('total') }}
+
{{ $ts.total }}
{{ number((info.usersCount - info.originalUsersCount)) }}
-
{{ $t('dayOverDayChanges') }}
+
{{ $ts.dayOverDayChanges }}
{{ number(usersRemoteDoD) }}
-
{{ $t('weekOverWeekChanges') }}
+
{{ $ts.weekOverWeekChanges }}
{{ number(usersRemoteWoW) }}
- {{ $t('notes') }} - {{ $t('local') }} + {{ $ts.notes }} + {{ $ts.local }}
-
{{ $t('total') }}
+
{{ $ts.total }}
{{ number(info.originalNotesCount) }}
-
{{ $t('dayOverDayChanges') }}
+
{{ $ts.dayOverDayChanges }}
{{ number(notesLocalDoD) }}
-
{{ $t('weekOverWeekChanges') }}
+
{{ $ts.weekOverWeekChanges }}
{{ number(notesLocalWoW) }}
- {{ $t('notes') }} - {{ $t('remote') }} + {{ $ts.notes }} + {{ $ts.remote }}
-
{{ $t('total') }}
+
{{ $ts.total }}
{{ number((info.notesCount - info.originalNotesCount)) }}
-
{{ $t('dayOverDayChanges') }}
+
{{ $ts.dayOverDayChanges }}
{{ number(notesRemoteDoD) }}
-
{{ $t('weekOverWeekChanges') }}
+
{{ $ts.weekOverWeekChanges }}
{{ number(notesRemoteWoW) }}
@@ -84,35 +84,35 @@
-
{{ $t('statistics') }}
+
{{ $ts.statistics }}
- - - + + + - - - - + + + + - - - - - + + + + + - - - - - + + + + + - - + +
diff --git a/src/client/components/launch-pad.vue b/src/client/components/launch-pad.vue index 24af78247d..f732b675e7 100644 --- a/src/client/components/launch-pad.vue +++ b/src/client/components/launch-pad.vue @@ -18,7 +18,7 @@
-
{{ $t('help') }}
+
{{ $ts.help }}
@@ -26,7 +26,7 @@ -
{{ $t('aboutMisskey') }}
+
{{ $ts.aboutMisskey }}
diff --git a/src/client/components/media-banner.vue b/src/client/components/media-banner.vue index d90d1186e7..a2e1776d09 100644 --- a/src/client/components/media-banner.vue +++ b/src/client/components/media-banner.vue @@ -2,8 +2,8 @@
- {{ $t('sensitive') }} - {{ $t('clickToShow') }} + {{ $ts.sensitive }} + {{ $ts.clickToShow }}
diff --git a/src/client/components/media-video.vue b/src/client/components/media-video.vue index 78b011157f..3788947206 100644 --- a/src/client/components/media-video.vue +++ b/src/client/components/media-video.vue @@ -1,8 +1,8 @@