From c8b45f4f42a451bc44dc17e37cc31146f5de458a Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Wed, 26 Dec 2018 19:39:51 +0900 Subject: [PATCH] Fix #3346 Co-authored-by: syuilo --- src/client/app/desktop/api/update-avatar.ts | 16 ++++++++-------- src/client/app/desktop/api/update-banner.ts | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/client/app/desktop/api/update-avatar.ts b/src/client/app/desktop/api/update-avatar.ts index 07a614fc1..ff3d4dccf 100644 --- a/src/client/app/desktop/api/update-avatar.ts +++ b/src/client/app/desktop/api/update-avatar.ts @@ -1,4 +1,4 @@ -import { apiUrl } from '../../config'; +import { apiUrl, locale } from '../../config'; import CropWindow from '../views/components/crop-window.vue'; import ProgressDialog from '../views/components/progress-dialog.vue'; @@ -9,7 +9,7 @@ export default ($root: any) => { const regex = RegExp('\.(jpg|jpeg|png|gif|webp|bmp|tiff)$'); if (!regex.test(file.name) ) { $root.dialog({ - title: '%fa:info-circle% %i18n:desktop.invalid-filetype%', + title: locale['desktop']['invalid-filetype'], text: null }); return reject('invalid-filetype'); @@ -17,7 +17,7 @@ export default ($root: any) => { const w = $root.new(CropWindow, { image: file, - title: '%i18n:desktop.avatar-crop-title%', + title: locale['desktop']['avatar-crop-title'], aspectRatio: 1 / 1 }); @@ -27,11 +27,11 @@ export default ($root: any) => { data.append('file', blob, file.name + '.cropped.png'); $root.api('drive/folders/find', { - name: '%i18n:desktop.avatar%' + name: locale['desktop']['avatar'] }).then(avatarFolder => { if (avatarFolder.length === 0) { $root.api('drive/folders/create', { - name: '%i18n:desktop.avatar%' + name: locale['desktop']['avatar'] }).then(iconFolder => { resolve(upload(data, iconFolder)); }); @@ -52,7 +52,7 @@ export default ($root: any) => { const upload = (data, folder) => new Promise((resolve, reject) => { const dialog = $root.new(ProgressDialog, { - title: '%i18n:desktop.uploading-avatar%' + title: locale['desktop']['uploading-avatar'] }); document.body.appendChild(dialog.$el); @@ -88,7 +88,7 @@ export default ($root: any) => { }); $root.dialog({ - title: '%fa:info-circle% %i18n:desktop.avatar-updated%', + title: locale['desktop']['avatar-updated'], text: null }); @@ -101,7 +101,7 @@ export default ($root: any) => { ? Promise.resolve(file) : $root.$chooseDriveFile({ multiple: false, - title: '%fa:image% %i18n:desktop.choose-avatar%' + title: locale['desktop']['choose-avatar'] }); return selectedFile diff --git a/src/client/app/desktop/api/update-banner.ts b/src/client/app/desktop/api/update-banner.ts index ef84a32c0..3b2cf113b 100644 --- a/src/client/app/desktop/api/update-banner.ts +++ b/src/client/app/desktop/api/update-banner.ts @@ -1,4 +1,4 @@ -import { apiUrl } from '../../config'; +import { apiUrl, locale } from '../../config'; import CropWindow from '../views/components/crop-window.vue'; import ProgressDialog from '../views/components/progress-dialog.vue'; @@ -9,7 +9,7 @@ export default ($root: any) => { const regex = RegExp('\.(jpg|jpeg|png|gif|webp|bmp|tiff)$'); if (!regex.test(file.name) ) { $root.dialog({ - title: '%fa:info-circle% %i18n:desktop.invalid-filetype%', + title: locale['desktop']['invalid-filetype'], text: null }); return reject('invalid-filetype'); @@ -17,7 +17,7 @@ export default ($root: any) => { const w = $root.new(CropWindow, { image: file, - title: '%i18n:desktop.banner-crop-title%', + title: locale['desktop']['banner-crop-title'], aspectRatio: 16 / 9 }); @@ -27,11 +27,11 @@ export default ($root: any) => { data.append('file', blob, file.name + '.cropped.png'); $root.api('drive/folders/find', { - name: '%i18n:desktop.banner%' + name: locale['desktop']['banner'] }).then(bannerFolder => { if (bannerFolder.length === 0) { $root.api('drive/folders/create', { - name: '%i18n:desktop.banner%' + name: locale['desktop']['banner'] }).then(iconFolder => { resolve(upload(data, iconFolder)); }); @@ -52,7 +52,7 @@ export default ($root: any) => { const upload = (data, folder) => new Promise((resolve, reject) => { const dialog = $root.new(ProgressDialog, { - title: '%i18n:desktop.uploading-banner%' + title: locale['desktop']['uploading-banner'] }); document.body.appendChild(dialog.$el); @@ -88,7 +88,7 @@ export default ($root: any) => { }); $root.dialog({ - title: '%fa:info-circle% %i18n:desktop.banner-updated%', + title: locale['desktop']['banner-updated'], text: null }); @@ -101,7 +101,7 @@ export default ($root: any) => { ? Promise.resolve(file) : $root.$chooseDriveFile({ multiple: false, - title: '%fa:image% %i18n:desktop.choose-banner%' + title: locale['desktop']['choose-banner'] }); return selectedFile