From 554570cb0964f9eca6eb3d645a0a2ca0550d4733 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 15 Apr 2018 01:04:40 +0900 Subject: [PATCH 01/12] wip --- src/build/i18n.ts | 15 ++++++- .../connect-failed.troubleshooter.vue | 18 ++++----- .../views/components/connect-failed.vue | 12 +++--- .../app/common/views/components/forkit.vue | 2 +- .../views/components/messaging-room.form.vue | 4 +- .../components/messaging-room.message.vue | 4 +- .../views/components/messaging-room.vue | 8 ++-- .../app/common/views/components/messaging.vue | 6 +-- .../app/common/views/components/nav.vue | 14 +++---- .../app/common/views/components/note-menu.vue | 2 +- .../common/views/components/poll-editor.vue | 10 ++--- .../app/common/views/components/poll.vue | 10 ++--- .../views/components/reaction-picker.vue | 2 +- .../app/common/views/components/signin.vue | 8 ++-- .../app/common/views/components/signup.vue | 40 +++++++++---------- .../views/components/special-message.vue | 4 +- .../views/components/stream-indicator.vue | 6 +-- .../views/components/twitter-setting.vue | 8 ++-- .../app/common/views/components/uploader.vue | 2 +- .../app/common/views/widgets/access-log.vue | 2 +- .../app/common/views/widgets/broadcast.vue | 8 ++-- .../app/common/views/widgets/donation.vue | 6 +-- .../app/common/views/widgets/photo-stream.vue | 4 +- .../app/common/views/widgets/server.vue | 4 +- .../app/desktop/views/components/activity.vue | 4 +- .../app/desktop/views/components/calendar.vue | 8 ++-- .../desktop/views/components/drive-window.vue | 4 +- .../desktop/views/components/drive.file.vue | 28 ++++++------- .../desktop/views/components/drive.folder.vue | 16 ++++---- .../views/components/drive.nav-folder.vue | 2 +- .../app/desktop/views/components/drive.vue | 36 ++++++++--------- .../desktop/views/components/notes.note.vue | 12 +++--- .../views/components/notifications.vue | 2 +- .../views/components/post-form-window.vue | 8 ++-- .../desktop/views/components/post-form.vue | 38 +++++++++--------- .../views/components/renote-form-window.vue | 2 +- .../desktop/views/components/renote-form.vue | 10 ++--- .../views/components/repost-form-window.vue | 2 +- .../desktop/views/components/repost-form.vue | 10 ++--- .../desktop/views/components/settings.2fa.vue | 30 +++++++------- .../desktop/views/components/settings.api.vue | 10 ++--- .../views/components/settings.mute.vue | 2 +- .../views/components/settings.password.vue | 12 +++--- .../views/components/settings.profile.vue | 14 +++---- .../app/desktop/views/components/settings.vue | 22 +++++----- .../views/components/ui.header.account.vue | 10 ++--- .../views/components/ui.header.nav.vue | 4 +- .../components/ui.header.notifications.vue | 2 +- .../views/components/ui.header.post.vue | 2 +- .../views/components/ui.header.search.vue | 2 +- src/client/app/desktop/views/pages/note.vue | 4 +- .../app/desktop/views/pages/selectdrive.vue | 8 ++-- .../pages/user/user.followers-you-know.vue | 6 +-- .../desktop/views/pages/user/user.friends.vue | 6 +-- .../desktop/views/pages/user/user.home.vue | 2 +- .../desktop/views/pages/user/user.photos.vue | 6 +-- .../desktop/views/pages/user/user.profile.vue | 6 +-- .../app/desktop/views/widgets/channel.vue | 6 +-- .../app/desktop/views/widgets/messaging.vue | 2 +- .../desktop/views/widgets/notifications.vue | 4 +- .../app/desktop/views/widgets/polls.vue | 6 +-- .../app/desktop/views/widgets/post-form.vue | 6 +-- .../app/desktop/views/widgets/trends.vue | 6 +-- .../app/desktop/views/widgets/users.vue | 6 +-- .../views/components/drive-file-chooser.vue | 2 +- .../views/components/drive-folder-chooser.vue | 2 +- .../views/components/drive.file-detail.vue | 10 ++--- .../app/mobile/views/components/drive.vue | 18 ++++----- .../mobile/views/components/follow-button.vue | 2 +- .../mobile/views/components/note-detail.vue | 4 +- .../app/mobile/views/components/note.vue | 4 +- .../mobile/views/components/notifications.vue | 4 +- .../app/mobile/views/components/post-form.vue | 4 +- .../views/components/sub-note-content.vue | 2 +- .../app/mobile/views/components/timeline.vue | 4 +- .../app/mobile/views/components/ui.nav.vue | 16 ++++---- .../mobile/views/components/user-timeline.vue | 4 +- .../mobile/views/components/users-list.vue | 6 +-- src/client/app/mobile/views/pages/drive.vue | 2 +- .../app/mobile/views/pages/followers.vue | 6 +-- .../app/mobile/views/pages/following.vue | 6 +-- .../app/mobile/views/pages/messaging-room.vue | 2 +- .../app/mobile/views/pages/messaging.vue | 4 +- src/client/app/mobile/views/pages/note.vue | 6 +-- .../app/mobile/views/pages/notifications.vue | 6 +-- .../mobile/views/pages/profile-setting.vue | 30 +++++++------- src/client/app/mobile/views/pages/search.vue | 6 +-- .../app/mobile/views/pages/selectdrive.vue | 4 +- .../app/mobile/views/pages/settings.vue | 16 ++++---- src/client/app/mobile/views/pages/user.vue | 14 +++---- .../pages/user/home.followers-you-know.vue | 4 +- .../mobile/views/pages/user/home.friends.vue | 4 +- .../mobile/views/pages/user/home.notes.vue | 4 +- .../mobile/views/pages/user/home.photos.vue | 4 +- .../app/mobile/views/pages/user/home.vue | 12 +++--- webpack/loaders/replace.js | 5 ++- 96 files changed, 398 insertions(+), 384 deletions(-) diff --git a/src/build/i18n.ts b/src/build/i18n.ts index b9b7403214..d9dacccd34 100644 --- a/src/build/i18n.ts +++ b/src/build/i18n.ts @@ -44,8 +44,19 @@ export default class Replacer { } } - public replacement(match, a, b, c) { - const key = a || b || c; + public replacement(ctx, match, a, b, c) { + const client = 'misskey/src/client/app/'; + const name = ctx.src.substr(ctx.src.indexOf(client) + client.length); + if (name == '') return match; + + let key = a || b || c; + if (key[0] == '@') { + const prefix = name.split('.')[0].replace(/\//g, '.') + '.'; + //if (name.startsWith('app/desktop/views/')) prefix = 'desktop.views.'; + //if (name.startsWith('app/mobile/views/')) prefix = 'mobile.views.'; + key = prefix + key.substr(1); + } + if (match[0] == '"') { return '"' + this.get(key).replace(/"/g, '\\"') + '"'; } else if (match[0] == "'") { diff --git a/src/client/app/common/views/components/connect-failed.troubleshooter.vue b/src/client/app/common/views/components/connect-failed.troubleshooter.vue index cadbd36ba4..b0a9c87e78 100644 --- a/src/client/app/common/views/components/connect-failed.troubleshooter.vue +++ b/src/client/app/common/views/components/connect-failed.troubleshooter.vue @@ -1,34 +1,34 @@ diff --git a/src/client/app/common/views/components/connect-failed.vue b/src/client/app/common/views/components/connect-failed.vue index 185250dbd8..d90c8756b8 100644 --- a/src/client/app/common/views/components/connect-failed.vue +++ b/src/client/app/common/views/components/connect-failed.vue @@ -1,15 +1,15 @@ diff --git a/src/client/app/common/views/components/forkit.vue b/src/client/app/common/views/components/forkit.vue index 6f334b965a..05971cbf15 100644 --- a/src/client/app/common/views/components/forkit.vue +++ b/src/client/app/common/views/components/forkit.vue @@ -1,5 +1,5 @@ diff --git a/src/client/app/common/views/components/nav.vue b/src/client/app/common/views/components/nav.vue index 8ce75d3529..2295957928 100644 --- a/src/client/app/common/views/components/nav.vue +++ b/src/client/app/common/views/components/nav.vue @@ -1,18 +1,18 @@ diff --git a/src/client/app/common/views/components/poll-editor.vue b/src/client/app/common/views/components/poll-editor.vue index 47d901d7b1..fa1897f435 100644 --- a/src/client/app/common/views/components/poll-editor.vue +++ b/src/client/app/common/views/components/poll-editor.vue @@ -1,18 +1,18 @@ diff --git a/src/client/app/common/views/components/twitter-setting.vue b/src/client/app/common/views/components/twitter-setting.vue index 00669cd833..77788290f6 100644 --- a/src/client/app/common/views/components/twitter-setting.vue +++ b/src/client/app/common/views/components/twitter-setting.vue @@ -1,11 +1,11 @@