From b20b9759350f5c0e8b6a668d010c45b4b7338ff0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 20 May 2018 20:26:38 +0900 Subject: [PATCH] Fix bug --- src/build/i18n.ts | 11 ++------ .../app/common/scripts/check-for-update.ts | 2 +- .../app/common/scripts/streaming/home.ts | 2 +- .../connect-failed.troubleshooter.vue | 6 ++--- .../views/components/connect-failed.vue | 6 ++--- .../views/components/messaging-room.vue | 4 +-- .../common/views/components/poll-editor.vue | 2 +- .../app/common/views/components/poll.vue | 8 +++--- .../views/components/reaction-picker.vue | 2 +- .../app/common/views/components/signin.vue | 2 +- .../app/common/views/components/signup.vue | 2 +- .../app/common/views/components/time.vue | 20 +++++++------- .../views/components/twitter-setting.vue | 2 +- .../app/common/views/widgets/broadcast.vue | 2 +- .../app/common/views/widgets/donation.vue | 4 +-- .../app/desktop/views/components/calendar.vue | 18 ++++++------- .../desktop/views/components/drive.file.vue | 26 +++++++++---------- .../desktop/views/components/drive.folder.vue | 20 +++++++------- .../views/components/drive.nav-folder.vue | 2 +- .../app/desktop/views/components/drive.vue | 26 +++++++++---------- .../views/components/followers-window.vue | 2 +- .../views/components/following-window.vue | 2 +- .../desktop/views/components/notes.note.vue | 4 +-- .../views/components/notifications.vue | 2 +- .../views/components/post-form-window.vue | 4 +-- .../desktop/views/components/post-form.vue | 26 +++++++++---------- .../desktop/views/components/renote-form.vue | 6 ++--- .../desktop/views/components/settings.2fa.vue | 10 +++---- .../desktop/views/components/settings.api.vue | 2 +- .../views/components/settings.password.vue | 10 +++---- .../app/desktop/views/components/settings.vue | 12 ++++----- .../app/desktop/views/pages/selectdrive.vue | 2 +- src/client/app/init.ts | 2 +- .../app/mobile/views/components/drive.vue | 2 +- .../mobile/views/components/follow-button.vue | 2 +- .../app/mobile/views/components/note.vue | 4 +-- .../mobile/views/components/notifications.vue | 2 +- .../app/mobile/views/components/post-form.vue | 2 +- .../app/mobile/views/components/ui.nav.vue | 2 +- .../mobile/views/components/user-timeline.vue | 2 +- .../app/mobile/views/pages/followers.vue | 4 +-- .../app/mobile/views/pages/following.vue | 4 +-- .../app/mobile/views/pages/notifications.vue | 2 +- src/client/app/mobile/views/pages/search.vue | 2 +- .../app/mobile/views/pages/selectdrive.vue | 2 +- .../app/mobile/views/pages/settings.vue | 12 ++++----- .../views/pages/settings/settings.profile.vue | 2 +- webpack/i18n.ts | 9 ++----- 48 files changed, 146 insertions(+), 158 deletions(-) diff --git a/src/build/i18n.ts b/src/build/i18n.ts index addc35ce5..35854055d 100644 --- a/src/build/i18n.ts +++ b/src/build/i18n.ts @@ -7,7 +7,7 @@ import locale from '../../locales'; export default class Replacer { private lang: string; - public pattern = /%i18n:([a-z0-9_\-\.\/\|\!]+?)%/g; + public pattern = /%i18n:([a-z0-9_\-\.\/\|]+?)%/g; constructor(lang: string) { this.lang = lang; @@ -56,11 +56,6 @@ export default class Replacer { public replacement(match, key) { let path = null; - const shouldEscape = key[0] == '!'; - if (shouldEscape) { - key = key.substr(1); - } - if (key.indexOf('|') != -1) { path = key.split('|')[0]; key = key.split('|')[1]; @@ -68,8 +63,6 @@ export default class Replacer { const txt = this.get(path, key); - return shouldEscape - ? txt.replace(/'/g, '\\x27').replace(/"/g, '\\x22') - : txt.replace(/"/g, '"'); + return txt.replace(/'/g, '\\x27').replace(/"/g, '\\x22'); } } diff --git a/src/client/app/common/scripts/check-for-update.ts b/src/client/app/common/scripts/check-for-update.ts index 1e303017e..b5ba6916d 100644 --- a/src/client/app/common/scripts/check-for-update.ts +++ b/src/client/app/common/scripts/check-for-update.ts @@ -23,7 +23,7 @@ export default async function(mios: MiOS, force = false, silent = false) { } if (!silent) { - alert('%i18n:!common.update-available%'.replace('{newer}', newer).replace('{current}', current)); + alert('%i18n:common.update-available%'.replace('{newer}', newer).replace('{current}', current)); } return newer; diff --git a/src/client/app/common/scripts/streaming/home.ts b/src/client/app/common/scripts/streaming/home.ts index 09d830bec..44d07e331 100644 --- a/src/client/app/common/scripts/streaming/home.ts +++ b/src/client/app/common/scripts/streaming/home.ts @@ -62,7 +62,7 @@ export class HomeStream extends Stream { // トークンが再生成されたとき // このままではMisskeyが利用できないので強制的にサインアウトさせる this.on('my_token_regenerated', () => { - alert('%i18n:!common.my-token-regenerated%'); + alert('%i18n:common.my-token-regenerated%'); os.signout(); }); } 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 6a922676b..6c23cc796 100644 --- a/src/client/app/common/views/components/connect-failed.troubleshooter.vue +++ b/src/client/app/common/views/components/connect-failed.troubleshooter.vue @@ -8,21 +8,21 @@ - {{ network == null ? '%i18n:!@checking-network%' : '%i18n:!@network%' }} + {{ network == null ? '%i18n:@checking-network%' : '%i18n:@network%' }}

- {{ internet == null ? '%i18n:!@checking-internet%' : '%i18n:!@internet%' }} + {{ internet == null ? '%i18n:@checking-internet%' : '%i18n:@internet%' }}

- {{ server == null ? '%i18n:!@checking-server%' : '%i18n:!@server%' }} + {{ server == null ? '%i18n:@checking-server%' : '%i18n:@server%' }}

%i18n:@finding%

diff --git a/src/client/app/common/views/components/connect-failed.vue b/src/client/app/common/views/components/connect-failed.vue index 6c194ff98..4bc9b2b3d 100644 --- a/src/client/app/common/views/components/connect-failed.vue +++ b/src/client/app/common/views/components/connect-failed.vue @@ -3,9 +3,9 @@

%i18n:@title%

- {{ '%i18n:!@description%'.substr(0, '%i18n:!@description%'.indexOf('{')) }} - {{ '%i18n:!@description%'.match(/\{(.+?)\}/)[1] }} - {{ '%i18n:!@description%'.substr('%i18n:!@description%'.indexOf('}') + 1) }} + {{ '%i18n:@description%'.substr(0, '%i18n:@description%'.indexOf('{')) }} + {{ '%i18n:@description%'.match(/\{(.+?)\}/)[1] }} + {{ '%i18n:@description%'.substr('%i18n:@description%'.indexOf('}') + 1) }}

diff --git a/src/client/app/common/views/components/messaging-room.vue b/src/client/app/common/views/components/messaging-room.vue index a45114e6b..330834233 100644 --- a/src/client/app/common/views/components/messaging-room.vue +++ b/src/client/app/common/views/components/messaging-room.vue @@ -8,7 +8,7 @@

%fa:info-circle%%i18n:@empty%

%fa:flag%%i18n:@no-history%

diff --git a/src/client/app/desktop/views/components/drive.vue b/src/client/app/desktop/views/components/drive.vue index 973df1014..cae40f306 100644 --- a/src/client/app/desktop/views/components/drive.vue +++ b/src/client/app/desktop/views/components/drive.vue @@ -138,17 +138,17 @@ export default Vue.extend({ onContextmenu(e) { contextmenu(e, [{ type: 'item', - text: '%i18n:!@contextmenu.create-folder%', + text: '%i18n:@contextmenu.create-folder%', icon: '%fa:R folder%', onClick: this.createFolder }, { type: 'item', - text: '%i18n:!@contextmenu.upload%', + text: '%i18n:@contextmenu.upload%', icon: '%fa:upload%', onClick: this.selectLocalFile }, { type: 'item', - text: '%i18n:!@contextmenu.url-upload%', + text: '%i18n:@contextmenu.url-upload%', icon: '%fa:cloud-upload-alt%', onClick: this.urlUpload }]); @@ -306,15 +306,15 @@ export default Vue.extend({ switch (err) { case 'detected-circular-definition': (this as any).apis.dialog({ - title: '%fa:exclamation-triangle%%i18n:!@unable-to-process%', - text: '%i18n:!@circular-reference-detected%', + title: '%fa:exclamation-triangle%%i18n:@unable-to-process%', + text: '%i18n:@circular-reference-detected%', actions: [{ - text: '%i18n:!common.ok%' + text: '%i18n:common.ok%' }] }); break; default: - alert('%i18n:!@unhandled-error% ' + err); + alert('%i18n:@unhandled-error% ' + err); } }); } @@ -327,8 +327,8 @@ export default Vue.extend({ urlUpload() { (this as any).apis.input({ - title: '%i18n:!@url-upload%', - placeholder: '%i18n:!@url-of-file%' + title: '%i18n:@url-upload%', + placeholder: '%i18n:@url-of-file%' }).then(url => { (this as any).api('drive/files/upload_from_url', { url: url, @@ -337,9 +337,9 @@ export default Vue.extend({ (this as any).apis.dialog({ title: '%fa:check%%i18n:@url-upload-requested%', - text: '%i18n:!@may-take-time%', + text: '%i18n:@may-take-time%', actions: [{ - text: '%i18n:!common.ok%' + text: '%i18n:common.ok%' }] }); }); @@ -347,8 +347,8 @@ export default Vue.extend({ createFolder() { (this as any).apis.input({ - title: '%i18n:!@create-folder%', - placeholder: '%i18n:!@folder-name%' + title: '%i18n:@create-folder%', + placeholder: '%i18n:@folder-name%' }).then(name => { (this as any).api('drive/folders/create', { name: name, diff --git a/src/client/app/desktop/views/components/followers-window.vue b/src/client/app/desktop/views/components/followers-window.vue index f3eec13e0..af1dea99c 100644 --- a/src/client/app/desktop/views/components/followers-window.vue +++ b/src/client/app/desktop/views/components/followers-window.vue @@ -1,7 +1,7 @@