From 4ed72f01d4cae35504402d730c9b5faa46c23670 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Mon, 13 Aug 2018 15:27:53 +0900 Subject: [PATCH] refs #151 Translate messages --- src/config/locales/en/translation.json | 45 +++++++++++++++++++ src/config/locales/ja/translation.json | 45 +++++++++++++++++++ src/renderer/components/Authorize.vue | 4 +- src/renderer/components/Login/LoginForm.vue | 42 +++++++++-------- .../components/Preferences/Account.vue | 8 ++-- .../components/Preferences/General.vue | 2 +- src/renderer/components/TimelineSpace.vue | 14 +++--- .../Contents/Cards/Notification/Favourite.vue | 2 +- .../Contents/Cards/Notification/Reblog.vue | 2 +- .../TimelineSpace/Contents/Cards/Toot.vue | 12 ++--- .../TimelineSpace/Contents/Favourites.vue | 8 ++-- .../TimelineSpace/Contents/Hashtag/Tag.vue | 10 ++--- .../TimelineSpace/Contents/Home.vue | 8 ++-- .../TimelineSpace/Contents/Lists/Edit.vue | 4 +- .../TimelineSpace/Contents/Lists/Index.vue | 4 +- .../TimelineSpace/Contents/Lists/Show.vue | 10 ++--- .../TimelineSpace/Contents/Local.vue | 8 ++-- .../TimelineSpace/Contents/Notifications.vue | 6 +-- .../TimelineSpace/Contents/Public.vue | 12 ++--- .../TimelineSpace/Contents/Search.vue | 2 +- .../Contents/SideBar/AccountProfile.vue | 4 +- .../SideBar/AccountProfile/Followers.vue | 2 +- .../SideBar/AccountProfile/Follows.vue | 2 +- .../SideBar/AccountProfile/Timeline.vue | 4 +- .../Contents/SideBar/TootDetail.vue | 2 +- .../TimelineSpace/Modals/AddListMember.vue | 2 +- .../TimelineSpace/Modals/ListMembership.vue | 4 +- .../TimelineSpace/Modals/NewToot.vue | 10 ++--- 28 files changed, 186 insertions(+), 92 deletions(-) diff --git a/src/config/locales/en/translation.json b/src/config/locales/en/translation.json index 21fec2db..bd0873ac 100644 --- a/src/config/locales/en/translation.json +++ b/src/config/locales/en/translation.json @@ -159,5 +159,50 @@ "new_list": "New List", "edit": "Edit" } + }, + "message": { + "account_load_error": "Failed to load accounts", + "account_remove_error": "Failed to remove the account", + "preferences_load_error": "Failed to load preferences", + "timeline_fetch_error": "Failed to fetch timeline", + "notification_fetch_error": "Failed to fetch notification", + "favourite_fetch_error": "Failed to fetch favorite", + "start_streaming_error": "Failed to start streaming", + "attach_error": "Could not attach the file", + "authorize_duplicate_error": "Can not login the same account of the same domain", + "authorize_error": "Failed to authorize", + "followers_fetch_error": "Failed to fetch followers", + "follows_fetch_error": "Failed to fetch follows", + "toot_fetch_error": "Failed to fetch the toot detail", + "follow_error": "Failed to follow the user", + "unfollow_error": "Failed to unfollow the user", + "lists_fetch_error": "Failed to fetch lists", + "list_create_error": "Failed to create a list", + "members_fetch_error": "Failed to fetch members", + "remove_user_error": "Failed to remove the user", + "find_account_error": "Account not found", + "reblog_error": "Failed to reblog", + "unreblog_error": "Failed to unreblog", + "favourite_error": "Failed to favourite", + "unfavourite_error": "Failed to unfavourite", + "delete_error": "Failed to delete the toot", + "search_error": "Failed to search", + "toot_error": "Failed to toot", + "update_list_memberships_error": "Failed to update the list memberships", + "add_user_error": "Failed to add user", + "authorize_url_error": "Failed to get authorize url", + "domain_confirmed": "{{domain}} is confirmed, please login", + "domain_doesnt_exist": "{{domain}} does not exist" + }, + "validation": { + "login": { + "rquire_domain_name": "Domain name is required", + "domain_format": "Please write only domain name" + }, + "new_toot": { + "toot_length": "Toot length should be {{min}} to {{max}}", + "attach_length": "You can only attach up to {{max}} images", + "attach_image": "You can only attach images or videos" + } } } diff --git a/src/config/locales/ja/translation.json b/src/config/locales/ja/translation.json index f3892a26..09549de8 100644 --- a/src/config/locales/ja/translation.json +++ b/src/config/locales/ja/translation.json @@ -159,5 +159,50 @@ "new_list": "新規リスト", "edit": "編集" } + }, + "message": { + "account_load_error": "アカウントの読み込みに失敗しました", + "account_remove_error": "アカウントの削除に失敗しました", + "preferences_load_error": "設定の読み込みに失敗しました", + "timeline_fetch_error": "タイムラインの読み込みに失敗しました", + "notification_fetch_error": "通知の読み込みに失敗しました", + "favourite_fetch_error": "お気に入りの読み込みに失敗しました", + "start_streaming_error": "ストリーミングを開始できませんでした", + "attach_error": "ファイルを添付できませんでした", + "authorize_duplicate_error": "同一ドメイン同一アカウントではログインできません", + "authorize_error": "認証に失敗しました", + "followers_fetch_error": "フォロワーの取得に失敗しました", + "follows_fetch_error": "フォローの取得に失敗しました", + "toot_fetch_error": "トゥート詳細の読み込みに失敗しました", + "follow_error": "フォローに失敗しました", + "unfollow_error": "フォロー解除に失敗しました", + "lists_fetch_error": "リストの読み込みに失敗しました", + "list_create_error": "リストの作成に失敗しました", + "members_fetch_error": "メンバーの取得に失敗しました", + "remove_user_error": "ユーザの削除に失敗しました", + "find_account_error": "アカウントが見つかりません", + "reblog_error": "ブーストできませんでした", + "unreblog_error": "ブースト解除に失敗しました", + "favourite_error": "お気に入りできませんでした", + "unfavourite_error": "お気に入り解除に失敗しました", + "delete_error": "トゥート削除に失敗しました", + "search_error": "検索に失敗しました", + "toot_error": "トゥートに失敗しました", + "update_list_memberships_error": "リストメンバーの更新に失敗しました", + "add_user_error": "メンバー追加に失敗しました", + "authorize_url_error": "認証用URLの取得に失敗しました", + "domain_confirmed": "{{domain}} が確認できました,ログインしてください", + "domain_doesnt_exist": "{{domain}} は存在しません" + }, + "validation": { + "login": { + "rquire_domain_name": "ドメイン名は必須です", + "domain_format": "ドメイン名のみを入力してください" + }, + "new_toot": { + "toot_length": "トゥートの長さは {{min}} から {{max}}文字である必要があります", + "attach_length": "添付ファイルは {{max}} つまでです", + "attach_image": "画像かビデオしか添付できません" + } } } diff --git a/src/renderer/components/Authorize.vue b/src/renderer/components/Authorize.vue index 5211d292..66f0ca36 100644 --- a/src/renderer/components/Authorize.vue +++ b/src/renderer/components/Authorize.vue @@ -71,12 +71,12 @@ export default { .catch((err) => { if (err.name === 'DuplicateRecordError') { this.$message({ - message: 'Can not login the same account of the same domain', + message: this.$t('message.authorize_duplicate_error'), type: 'error' }) } else { this.$message({ - message: 'Failed to authorize', + message: this.$t('message.authorize_error'), type: 'error' }) } diff --git a/src/renderer/components/Login/LoginForm.vue b/src/renderer/components/Login/LoginForm.vue index e9ec34b5..3657c3bd 100644 --- a/src/renderer/components/Login/LoginForm.vue +++ b/src/renderer/components/Login/LoginForm.vue @@ -37,20 +37,6 @@ export default { return { form: { domainName: '' - }, - rules: { - domainName: [ - { - type: 'string', - required: true, - message: 'Domain name is required' - }, - { - pattern: domainFormat, - trigger: 'change', - message: 'Please write only domain name' - } - ] } } }, @@ -58,7 +44,25 @@ export default { ...mapState({ selectedInstance: state => state.Login.selectedInstance, searching: state => state.Login.searching - }) + }), + rules: { + get () { + return { + domainName: [ + { + type: 'string', + required: true, + message: this.$t('validation.login.require_domain_name') + }, + { + pattern: domainFormat, + trigger: 'change', + message: this.$t('validation.login.domain_format') + } + ] + } + } + } }, methods: { login () { @@ -77,7 +81,7 @@ export default { .catch(() => { loading.close() this.$message({ - message: 'Could not get authorize url', + message: this.$t('message.authorize_url_error'), type: 'error' }) }) @@ -88,19 +92,19 @@ export default { this.$store.dispatch('Login/confirmInstance', this.form.domainName) .then(() => { this.$message({ - message: `${this.form.domainName} is confirmed, please login`, + message: this.$t('message.domain_confirmed', {domain: this.form.domainName}), type: 'success' }) }) .catch(() => { this.$message({ - message: `${this.form.domainName} does not exist`, + message: this.$t('domain_doesnt_exist', {domain: this.form.domainName}), type: 'error' }) }) } else { this.$message({ - message: 'Please write only domain name', + message: this.$t('validation.login.domain_format'), type: 'error' }) return false diff --git a/src/renderer/components/Preferences/Account.vue b/src/renderer/components/Preferences/Account.vue index 3a05da62..0ea12585 100644 --- a/src/renderer/components/Preferences/Account.vue +++ b/src/renderer/components/Preferences/Account.vue @@ -85,13 +85,13 @@ export default { this.$store.commit('Preferences/Account/updateAccountLoading', true) try { await this.$store.dispatch('Preferences/Account/loadAccounts') - this.$store.commit('Preferences/Account/updateAccountLoading', false) } catch (err) { - this.$store.commit('Preferences/Account/updateAccountLoading', false) return this.$message({ - message: 'Failed to load accounts', + message: this.$t('message.account_load_error'), type: 'error' }) + } finally { + this.$store.commit('Preferences/Account/updateAccountLoading', false) } }, removeAccount (index, accounts) { @@ -101,7 +101,7 @@ export default { }) .catch(() => { this.$message({ - message: 'Failed to remove the association', + message: this.$t('message.account_remove_error'), type: 'error' }) }) diff --git a/src/renderer/components/Preferences/General.vue b/src/renderer/components/Preferences/General.vue index fc12565b..1d444a17 100644 --- a/src/renderer/components/Preferences/General.vue +++ b/src/renderer/components/Preferences/General.vue @@ -161,7 +161,7 @@ export default { this.$store.dispatch('Preferences/General/loadGeneral') .catch(() => { this.$message({ - message: 'Failed to load preferences', + message: this.$t('message.preferences_load_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace.vue b/src/renderer/components/TimelineSpace.vue index c3dadcef..ce4a5c6f 100644 --- a/src/renderer/components/TimelineSpace.vue +++ b/src/renderer/components/TimelineSpace.vue @@ -83,7 +83,7 @@ export default { this.$store.dispatch('TimelineSpace/watchShortcutEvents') const account = await this.$store.dispatch('TimelineSpace/localAccount', this.$route.params.id).catch(() => { this.$message({ - message: 'Could not find account', + message: this.$t('message.account_load_error'), type: 'error' }) }) @@ -91,7 +91,7 @@ export default { await this.$store.dispatch('TimelineSpace/Contents/Home/fetchTimeline', account) } catch (err) { this.$message({ - message: 'Could not fetch timeline', + message: this.$t('message.timeline_fetch_error'), type: 'error' }) } @@ -99,7 +99,7 @@ export default { await this.$store.dispatch('TimelineSpace/Contents/Notifications/fetchNotifications', account) } catch (err) { this.$message({ - message: 'Could not fetch notification', + message: this.$t('message.notification_fetch_error'), type: 'error' }) } @@ -107,7 +107,7 @@ export default { await this.$store.dispatch('TimelineSpace/Contents/Local/fetchLocalTimeline', account) } catch (err) { this.$message({ - message: 'Could not fetch local timeline', + message: this.$t('message.timeline_fetch_error'), type: 'error' }) } @@ -115,7 +115,7 @@ export default { this.$store.dispatch('TimelineSpace/startUserStreaming', account) .catch(() => { this.$message({ - message: 'Failed to start streaming', + message: this.$t('message.start_streaming_error'), type: 'error' }) }) @@ -131,7 +131,7 @@ export default { const file = e.dataTransfer.files.item(0) if (!file.type.includes('image') && !file.type.includes('video')) { this.$message({ - message: 'You can only attach images or videos', + message: this.$t('validation.new_toot.attach_image'), type: 'error' }) return false @@ -141,7 +141,7 @@ export default { this.$store.dispatch('TimelineSpace/Modals/NewToot/uploadImage', file) .catch(() => { this.$message({ - message: 'Could not attach the file', + message: this.$t('message.attach_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace/Contents/Cards/Notification/Favourite.vue b/src/renderer/components/TimelineSpace/Contents/Cards/Notification/Favourite.vue index d104059f..c75035ae 100644 --- a/src/renderer/components/TimelineSpace/Contents/Cards/Notification/Favourite.vue +++ b/src/renderer/components/TimelineSpace/Contents/Cards/Notification/Favourite.vue @@ -82,7 +82,7 @@ export default { }) .catch(() => { this.$message({ - message: 'Account not found', + message: this.$t('message.find_account_error'), type: 'error' }) this.$store.commit('TimelineSpace/Contents/SideBar/changeOpenSideBar', false) diff --git a/src/renderer/components/TimelineSpace/Contents/Cards/Notification/Reblog.vue b/src/renderer/components/TimelineSpace/Contents/Cards/Notification/Reblog.vue index dbca3328..6d069415 100644 --- a/src/renderer/components/TimelineSpace/Contents/Cards/Notification/Reblog.vue +++ b/src/renderer/components/TimelineSpace/Contents/Cards/Notification/Reblog.vue @@ -82,7 +82,7 @@ export default { }) .catch(() => { this.$message({ - message: 'Account not found', + message: this.$t('message.find_account_error'), type: 'error' }) this.$store.commit('TimelineSpace/Contents/SideBar/changeOpenSideBar', false) diff --git a/src/renderer/components/TimelineSpace/Contents/Cards/Toot.vue b/src/renderer/components/TimelineSpace/Contents/Cards/Toot.vue index 90d9d68c..3660861c 100644 --- a/src/renderer/components/TimelineSpace/Contents/Cards/Toot.vue +++ b/src/renderer/components/TimelineSpace/Contents/Cards/Toot.vue @@ -188,7 +188,7 @@ export default { }) .catch(() => { this.$message({ - message: 'Account not found', + message: this.$t('message.find_account_error'), type: 'error' }) this.$store.commit('TimelineSpace/Contents/SideBar/changeOpenSideBar', false) @@ -225,7 +225,7 @@ export default { }) .catch(() => { this.$message({ - message: 'Failed to unreblog', + message: this.$t('message.unreblog_error'), type: 'error' }) }) @@ -236,7 +236,7 @@ export default { }) .catch(() => { this.$message({ - message: 'Failed to reblog', + message: this.$t('message.reblog_error'), type: 'error' }) }) @@ -250,7 +250,7 @@ export default { }) .catch(() => { this.$message({ - message: 'Failed to unfavourite', + message: this.$t('message.unfavourite_error'), type: 'error' }) }) @@ -261,7 +261,7 @@ export default { }) .catch(() => { this.$message({ - message: 'Failed to favourite', + message: this.$t('message.favourite_error'), type: 'error' }) }) @@ -309,7 +309,7 @@ export default { }) .catch(() => { this.$message({ - message: 'Failed to delete the toot', + message: this.$t('message.delete_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace/Contents/Favourites.vue b/src/renderer/components/TimelineSpace/Contents/Favourites.vue index 1a5b159a..187f2e1d 100644 --- a/src/renderer/components/TimelineSpace/Contents/Favourites.vue +++ b/src/renderer/components/TimelineSpace/Contents/Favourites.vue @@ -42,7 +42,7 @@ export default { this.$store.dispatch('TimelineSpace/Contents/Favourites/fetchFavourites', this.account) .catch(() => { this.$message({ - message: 'Could not fetch favourites', + message: this.$t('message.favourite_fetch_error'), type: 'error' }) }) @@ -82,7 +82,7 @@ export default { this.$store.dispatch('TimelineSpace/Contents/Favourites/lazyFetchFavourites', this.favourites[this.favourites.length - 1]) .catch(() => { this.$message({ - message: 'Could not fetch favourites', + message: this.$t('message.favourite_fetch_error'), type: 'error' }) }) @@ -99,7 +99,7 @@ export default { try { const account = await this.$store.dispatch('TimelineSpace/localAccount', this.$route.params.id).catch((err) => { this.$message({ - message: 'Could not find account', + message: this.$t('message.account_load_error'), type: 'error' }) throw err @@ -113,7 +113,7 @@ export default { await this.$store.dispatch('TimelineSpace/Contents/Favourites/fetchFavourites', account) .catch(() => { this.$message({ - message: 'Could not fetch favourites', + message: this.$t('message.favourite_fetch_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace/Contents/Hashtag/Tag.vue b/src/renderer/components/TimelineSpace/Contents/Hashtag/Tag.vue index 4fb6193d..2dc9f7d8 100644 --- a/src/renderer/components/TimelineSpace/Contents/Hashtag/Tag.vue +++ b/src/renderer/components/TimelineSpace/Contents/Hashtag/Tag.vue @@ -73,14 +73,14 @@ export default { await this.$store.dispatch('TimelineSpace/Contents/Hashtag/Tag/fetch', tag) .catch(() => { this.$message({ - message: 'Could not fetch timeline', + message: this.$t('message.timeline_fetch_error'), type: 'error' }) }) this.$store.dispatch('TimelineSpace/Contents/Hashtag/Tag/startStreaming', tag) .catch(() => { this.$message({ - message: 'Could not start streaming', + message: this.$t('message.start_streaming_error'), type: 'error' }) }) @@ -124,7 +124,7 @@ export default { try { const account = await this.$store.dispatch('TimelineSpace/localAccount', this.$route.params.id).catch((err) => { this.$message({ - message: 'Could not find account', + message: this.$t('message.account_load_error'), type: 'error' }) throw err @@ -139,7 +139,7 @@ export default { await this.$store.dispatch('TimelineSpace/Contents/Hashtag/Tag/fetch', tag) .catch(() => { this.$message({ - message: 'Could not fetch timeline with tag', + message: this.$t('message.timeline_fetch_error'), type: 'error' }) }) @@ -149,7 +149,7 @@ export default { this.$store.dispatch('TimelineSpace/Contents/Hashtag/Tag/startStreaming', tag) .catch(() => { this.$message({ - message: 'Failed to restart streaming', + message: this.$t('message.start_streaming_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace/Contents/Home.vue b/src/renderer/components/TimelineSpace/Contents/Home.vue index 6753455b..d3ad5e6f 100644 --- a/src/renderer/components/TimelineSpace/Contents/Home.vue +++ b/src/renderer/components/TimelineSpace/Contents/Home.vue @@ -71,7 +71,7 @@ export default { this.$store.dispatch('TimelineSpace/Contents/Home/lazyFetchTimeline', this.timeline[this.timeline.length - 1]) .catch(() => { this.$message({ - message: 'Could not fetch home timeline', + message: this.$t('message.timeline_fetch_error'), type: 'error' }) }) @@ -95,7 +95,7 @@ export default { try { const account = await this.$store.dispatch('TimelineSpace/localAccount', this.$route.params.id).catch((err) => { this.$message({ - message: 'Could not find account', + message: this.$t('message.account_load_error'), type: 'error' }) throw err @@ -106,7 +106,7 @@ export default { await this.$store.dispatch('TimelineSpace/Contents/Home/fetchTimeline', account) .catch(() => { this.$message({ - message: 'Could not fetch timeline', + message: this.$t('message.timeline_fetch_error'), type: 'error' }) }) @@ -115,7 +115,7 @@ export default { this.$store.dispatch('TimelineSpace/startUserStreaming', account) .catch(() => { this.$message({ - message: 'Failed to restart streaming', + message: this.$t('message.start_streaming_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace/Contents/Lists/Edit.vue b/src/renderer/components/TimelineSpace/Contents/Lists/Edit.vue index d5fd3262..59358ac1 100644 --- a/src/renderer/components/TimelineSpace/Contents/Lists/Edit.vue +++ b/src/renderer/components/TimelineSpace/Contents/Lists/Edit.vue @@ -34,7 +34,7 @@ export default { await this.$store.dispatch('TimelineSpace/Contents/Lists/Edit/fetchMembers', this.list_id) } catch (err) { this.$message({ - message: 'Failed to fetch members', + message: this.$t('message.members_fetch_error'), type: 'error' }) } finally { @@ -51,7 +51,7 @@ export default { await this.$store.dispatch('TimelineSpace/Contents/Lists/Edit/fetchMembers', this.list_id) } catch (err) { this.$message({ - message: 'Failed to remove user', + message: this.$t('message.remove_user_error'), type: 'error' }) } finally { diff --git a/src/renderer/components/TimelineSpace/Contents/Lists/Index.vue b/src/renderer/components/TimelineSpace/Contents/Lists/Index.vue index fa6dbf46..6ee3f0f2 100644 --- a/src/renderer/components/TimelineSpace/Contents/Lists/Index.vue +++ b/src/renderer/components/TimelineSpace/Contents/Lists/Index.vue @@ -53,7 +53,7 @@ export default { return this.$store.dispatch('TimelineSpace/Contents/Lists/Index/fetchLists') .catch(() => { this.$message({ - message: 'Failed to fetch lists', + message: this.$t('message.lists_fetch_error'), type: 'error' }) }) @@ -65,7 +65,7 @@ export default { await this.$store.dispatch('TimelineSpace/Contents/Lists/Index/fetchLists') } catch (err) { this.$message({ - message: 'Failed to create a list', + message: this.$t('message.list_create_error'), type: 'error' }) } finally { diff --git a/src/renderer/components/TimelineSpace/Contents/Lists/Show.vue b/src/renderer/components/TimelineSpace/Contents/Lists/Show.vue index a97b5835..8fe5dd6e 100644 --- a/src/renderer/components/TimelineSpace/Contents/Lists/Show.vue +++ b/src/renderer/components/TimelineSpace/Contents/Lists/Show.vue @@ -81,14 +81,14 @@ export default { await this.$store.dispatch('TimelineSpace/Contents/Lists/Show/fetchTimeline', this.list_id) } catch (err) { this.$message({ - message: 'Failed to get timeline', + message: this.$t('message.timeline_fetch_error'), type: 'error' }) } this.$store.dispatch('TimelineSpace/Contents/Lists/Show/startStreaming', this.list_id) .catch(() => { this.$message({ - message: 'Failed to start streaming', + message: this.$t('message.start_streaming_error'), type: 'error' }) }) @@ -120,7 +120,7 @@ export default { try { const account = await this.$store.dispatch('TimelineSpace/localAccount', this.$route.params.id).catch((err) => { this.$message({ - message: 'Could not find account', + message: this.$t('message.account_load_error'), type: 'error' }) throw err @@ -135,7 +135,7 @@ export default { await this.$store.dispatch('TimelineSpace/Contents/Lists/Show/fetchTimeline', this.list_id) .catch(() => { this.$message({ - message: 'Could not fetch timeline', + message: this.$t('message.timeline_fetch_error'), type: 'error' }) }) @@ -145,7 +145,7 @@ export default { this.$store.dispatch('TimelineSpace/Contents/Lists/Show/startStreaming', this.list_id) .catch(() => { this.$message({ - message: 'Failed to restart streaming', + message: this.$t('message.start_streaming_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace/Contents/Local.vue b/src/renderer/components/TimelineSpace/Contents/Local.vue index 7afcfd88..db984312 100644 --- a/src/renderer/components/TimelineSpace/Contents/Local.vue +++ b/src/renderer/components/TimelineSpace/Contents/Local.vue @@ -76,7 +76,7 @@ export default { this.$store.dispatch('TimelineSpace/Contents/Local/lazyFetchTimeline', this.timeline[this.timeline.length - 1]) .catch(() => { this.$message({ - message: 'Could not fetch timeline', + message: this.$t('message.timeline_fetch_error'), type: 'error' }) }) @@ -94,7 +94,7 @@ export default { try { const account = await this.$store.dispatch('TimelineSpace/localAccount', this.$route.params.id).catch((err) => { this.$message({ - message: 'Could not find account', + message: this.$t('message.account_load_error'), type: 'error' }) throw err @@ -106,7 +106,7 @@ export default { await this.$store.dispatch('TimelineSpace/Contents/Local/fetchLocalTimeline', account) .catch(() => { this.$message({ - message: 'Could not fetch local timeline', + message: this.$t('message.timeline_fetch_error'), type: 'error' }) }) @@ -115,7 +115,7 @@ export default { this.$store.dispatch('TimelineSpace/startLocalStreaming', account) .catch(() => { this.$message({ - message: 'Failed to restart streaming', + message: this.$t('message.start_streaming_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace/Contents/Notifications.vue b/src/renderer/components/TimelineSpace/Contents/Notifications.vue index a3cfa636..d2435257 100644 --- a/src/renderer/components/TimelineSpace/Contents/Notifications.vue +++ b/src/renderer/components/TimelineSpace/Contents/Notifications.vue @@ -71,7 +71,7 @@ export default { this.$store.dispatch('TimelineSpace/Contents/Notifications/lazyFetchNotifications', this.notifications[this.notifications.length - 1]) .catch(() => { this.$message({ - message: 'Could not fetch notification', + message: this.$t('message.notification_fetch_error'), type: 'error' }) }) @@ -89,7 +89,7 @@ export default { try { const account = await this.$store.dispatch('TimelineSpace/localAccount', this.$route.params.id).catch((err) => { this.$message({ - message: 'Could not find account', + message: this.$t('message.account_load_error'), type: 'error' }) throw err @@ -102,7 +102,7 @@ export default { await this.$store.dispatch('TimelineSpace/Contents/Notifications/fetchNotifications', account) .catch(() => { this.$message({ - message: 'Could not fetch notifications', + message: this.$t('message.notification_fetch_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace/Contents/Public.vue b/src/renderer/components/TimelineSpace/Contents/Public.vue index 75344906..861abdd9 100644 --- a/src/renderer/components/TimelineSpace/Contents/Public.vue +++ b/src/renderer/components/TimelineSpace/Contents/Public.vue @@ -73,14 +73,14 @@ export default { await this.$store.dispatch('TimelineSpace/Contents/Public/fetchPublicTimeline') } catch (err) { this.$message({ - message: 'Could not fetch timeline', + message: this.$t('message.timeline_fetch_error'), type: 'error' }) } this.$store.dispatch('TimelineSpace/Contents/Public/startPublicStreaming') .catch(() => { this.$message({ - message: 'Failed to start streaming', + message: this.$t('message.start_streaming_error'), type: 'error' }) }) @@ -96,7 +96,7 @@ export default { this.$store.dispatch('TimelineSpace/Contents/Public/lazyFetchTimeline', this.timeline[this.timeline.length - 1]) .catch(() => { this.$message({ - message: 'Could not fetch timeline', + message: this.$t('message.timeline_fetch_error'), type: 'error' }) }) @@ -114,7 +114,7 @@ export default { try { const account = await this.$store.dispatch('TimelineSpace/localAccount', this.$route.params.id).catch((err) => { this.$message({ - message: 'Could not find account', + message: this.$t('message.account_load_error'), type: 'error' }) throw err @@ -128,7 +128,7 @@ export default { await this.$store.dispatch('TimelineSpace/Contents/Public/fetchPublicTimeline') .catch(() => { this.$message({ - message: 'Could not fetch public timeline', + message: this.$t('message.timeline_fetch_error'), type: 'error' }) }) @@ -138,7 +138,7 @@ export default { this.$store.dispatch('TimelineSpace/Contents/Public/startPublicStreaming') .catch(() => { this.$message({ - message: 'Failed to restart streaming', + message: this.$t('message.start_streaming_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace/Contents/Search.vue b/src/renderer/components/TimelineSpace/Contents/Search.vue index c65ea061..2ec3267c 100644 --- a/src/renderer/components/TimelineSpace/Contents/Search.vue +++ b/src/renderer/components/TimelineSpace/Contents/Search.vue @@ -56,7 +56,7 @@ export default { this.$store.dispatch('TimelineSpace/Contents/Search/Account/search', this.query) .catch(() => { this.$message({ - message: 'Could not search', + message: this.$t('message.search_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile.vue b/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile.vue index bb4b5e6c..baabd141 100644 --- a/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile.vue +++ b/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile.vue @@ -141,7 +141,7 @@ export default { this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/follow', account) .catch(() => { this.$message({ - message: 'Could not follow this user', + message: this.$t('message.follow_error'), type: 'error' }) }) @@ -150,7 +150,7 @@ export default { this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/unfollow', account) .catch(() => { this.$message({ - message: 'Could not unfollow this user', + message: this.$t('message.unfollow_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile/Followers.vue b/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile/Followers.vue index 51b13b97..624d295e 100644 --- a/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile/Followers.vue +++ b/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile/Followers.vue @@ -32,7 +32,7 @@ export default { this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/Followers/fetchFollowers', this.account) .catch(() => { this.$message({ - message: 'Could not get followers', + message: this.$t('message.followers_fetch_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile/Follows.vue b/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile/Follows.vue index a6ef5343..ae72aba1 100644 --- a/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile/Follows.vue +++ b/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile/Follows.vue @@ -32,7 +32,7 @@ export default { this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/Follows/fetchFollows', this.account) .catch(() => { this.$message({ - message: 'Could not get follows', + message: this.$t('message.follows_fetch_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile/Timeline.vue b/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile/Timeline.vue index bbbe7125..180ed326 100644 --- a/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile/Timeline.vue +++ b/src/renderer/components/TimelineSpace/Contents/SideBar/AccountProfile/Timeline.vue @@ -44,7 +44,7 @@ export default { this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/Timeline/fetchTimeline', this.account) .catch(() => { this.message({ - message: 'Could not get timeline', + message: this.$t('message.timeline_fetch_error'), type: 'error' }) }) @@ -60,7 +60,7 @@ export default { }) .catch(() => { this.$message({ - message: 'Could not fetch account timeline', + message: this.$t('message.timeline_fetch_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace/Contents/SideBar/TootDetail.vue b/src/renderer/components/TimelineSpace/Contents/SideBar/TootDetail.vue index 7ecf1e63..16bb54a1 100644 --- a/src/renderer/components/TimelineSpace/Contents/SideBar/TootDetail.vue +++ b/src/renderer/components/TimelineSpace/Contents/SideBar/TootDetail.vue @@ -43,7 +43,7 @@ export default { }) .catch(() => { this.$message({ - message: 'Could not fetch toot detail', + message: this.$t('message.toot_fetch_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace/Modals/AddListMember.vue b/src/renderer/components/TimelineSpace/Modals/AddListMember.vue index 59486a99..1b71803e 100644 --- a/src/renderer/components/TimelineSpace/Modals/AddListMember.vue +++ b/src/renderer/components/TimelineSpace/Modals/AddListMember.vue @@ -81,7 +81,7 @@ export default { }) .catch(() => { this.$message({ - message: 'Failed to add user', + message: this.$t('message.add_user_error'), type: 'error' }) }) diff --git a/src/renderer/components/TimelineSpace/Modals/ListMembership.vue b/src/renderer/components/TimelineSpace/Modals/ListMembership.vue index e8033563..559c218f 100644 --- a/src/renderer/components/TimelineSpace/Modals/ListMembership.vue +++ b/src/renderer/components/TimelineSpace/Modals/ListMembership.vue @@ -50,7 +50,7 @@ export default { return this.$store.dispatch('TimelineSpace/Modals/ListMembership/changeBelongToLists', value) .catch(() => { this.$message({ - message: 'Failed to update list memberships', + message: this.$t('message.update_list_memberships_error'), type: 'error' }) }) @@ -72,7 +72,7 @@ export default { await this.$store.dispatch('TimelineSpace/Modals/ListMembership/fetchLists') } catch (err) { this.$message({ - message: 'Failed to fetch list', + message: this.$t('message.lists_fetch_error'), type: 'error' }) } finally { diff --git a/src/renderer/components/TimelineSpace/Modals/NewToot.vue b/src/renderer/components/TimelineSpace/Modals/NewToot.vue index ff58ecf0..ec2e937f 100644 --- a/src/renderer/components/TimelineSpace/Modals/NewToot.vue +++ b/src/renderer/components/TimelineSpace/Modals/NewToot.vue @@ -160,7 +160,7 @@ export default { } if (this.status.length <= 0 || this.status.length >= 500) { return this.$message({ - message: 'Toot length should be 1 to 500', + message: this.$t('validation.new_toot.toot_length', {min: 1, max: 500}), type: 'error' }) } @@ -181,7 +181,7 @@ export default { if (this.attachedMedias.length > 0) { if (this.attachedMedias.length > 4) { return this.$message({ - message: 'You can only attach up to 4 images', + message: this.$t('validation.new_toot.attach_length', {max: 4}), type: 'error' }) } @@ -193,7 +193,7 @@ export default { this.$store.dispatch('TimelineSpace/Modals/NewToot/postToot', form) .catch(() => { this.$message({ - message: 'Could not toot', + message: this.$t('message.toot_error'), type: 'error' }) }) @@ -209,7 +209,7 @@ export default { const file = e.target.files.item(0) if (!file.type.includes('image') && !file.type.includes('video')) { this.$message({ - message: 'You can only attach images or videos', + message: this.$t('validation.new_toot.attach_image'), type: 'error' }) return @@ -221,7 +221,7 @@ export default { this.$store.dispatch('TimelineSpace/Modals/NewToot/uploadImage', file) .catch(() => { this.$message({ - message: 'Could not attach the file', + message: this.$t('message.attach_error'), type: 'error' }) })