From abdf225353dfb9791933b5d2dbcd038dcdb656df Mon Sep 17 00:00:00 2001 From: mayaeh Date: Mon, 1 Apr 2019 12:50:05 +0900 Subject: i18n: Update Japanese translations (#10427) * Update Japanese translations. run yarn manage:translations && i18n-tasks add-missing * Update Japanese translations. * Fix mistake * Change to be concise. --- .../mastodon/locales/defaultMessages.json | 12 +++++++ app/javascript/mastodon/locales/en.json | 1 + app/javascript/mastodon/locales/ja.json | 41 +++++++++++----------- 3 files changed, 34 insertions(+), 20 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/locales/defaultMessages.json b/app/javascript/mastodon/locales/defaultMessages.json index cf0da6e47..5d1367020 100644 --- a/app/javascript/mastodon/locales/defaultMessages.json +++ b/app/javascript/mastodon/locales/defaultMessages.json @@ -551,6 +551,10 @@ }, { "descriptors": [ + { + "defaultMessage": "You are blocked", + "id": "empty_column.account_timeline_blocked" + }, { "defaultMessage": "No toots here!", "id": "empty_column.account_timeline" @@ -1251,6 +1255,10 @@ }, { "descriptors": [ + { + "defaultMessage": "You are blocked", + "id": "empty_column.account_timeline_blocked" + }, { "defaultMessage": "No one follows this user yet.", "id": "account.followers.empty" @@ -1260,6 +1268,10 @@ }, { "descriptors": [ + { + "defaultMessage": "You are blocked", + "id": "empty_column.account_timeline_blocked" + }, { "defaultMessage": "This user doesn't follow anyone yet.", "id": "account.follows.empty" diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index bf0c1bfab..45548eb55 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -117,6 +117,7 @@ "emoji_button.symbols": "Symbols", "emoji_button.travel": "Travel & Places", "empty_column.account_timeline": "No toots here!", + "empty_column.account_timeline_blocked": "You are blocked", "empty_column.blocks": "You haven't blocked any users yet.", "empty_column.community": "The local timeline is empty. Write something publicly to get the ball rolling!", "empty_column.direct": "You don't have any direct messages yet. When you send or receive one, it will show up here.", diff --git a/app/javascript/mastodon/locales/ja.json b/app/javascript/mastodon/locales/ja.json index 766ae0ec5..9f00332fc 100644 --- a/app/javascript/mastodon/locales/ja.json +++ b/app/javascript/mastodon/locales/ja.json @@ -1,12 +1,12 @@ { - "account.add_or_remove_from_list": "リストに追加または外す", + "account.add_or_remove_from_list": "リストから追加または外す", "account.badges.bot": "Bot", "account.block": "@{name}さんをブロック", "account.block_domain": "{domain}全体を非表示", "account.blocked": "ブロック済み", "account.direct": "@{name}さんにダイレクトメッセージ", "account.domain_blocked": "ドメイン非表示中", - "account.edit_profile": "プロフィールを編集", + "account.edit_profile": "プロフィール編集", "account.endorse": "プロフィールで紹介する", "account.follow": "フォロー", "account.followers": "フォロワー", @@ -16,7 +16,7 @@ "account.follows_you": "フォローされています", "account.hide_reblogs": "@{name}さんからのブーストを非表示", "account.link_verified_on": "このリンクの所有権は{date}に確認されました", - "account.locked_info": "このアカウントは承認制アカウントです。相手が確認するまでフォローは完了しません。", + "account.locked_info": "このアカウントは承認制アカウントです。相手が承認するまでフォローは完了しません。", "account.media": "メディア", "account.mention": "@{name}さんにトゥート", "account.moved_to": "{name}さんは引っ越しました:", @@ -30,7 +30,7 @@ "account.share": "@{name}さんのプロフィールを共有する", "account.show_reblogs": "@{name}さんからのブーストを表示", "account.unblock": "@{name}さんのブロックを解除", - "account.unblock_domain": "{domain}を表示", + "account.unblock_domain": "{domain}の非表示を解除", "account.unendorse": "プロフィールから外す", "account.unfollow": "フォロー解除", "account.unmute": "@{name}さんのミュートを解除", @@ -67,14 +67,14 @@ "community.column_settings.media_only": "メディアのみ表示", "compose_form.direct_message_warning": "このトゥートはメンションされた人にのみ送信されます。", "compose_form.direct_message_warning_learn_more": "もっと詳しく", - "compose_form.hashtag_warning": "このトゥートは未収載なのでハッシュタグの一覧に表示されません。公開トゥートだけがハッシュタグで検索できます。", + "compose_form.hashtag_warning": "このトゥートは公開設定ではないのでハッシュタグの一覧に表示されません。公開トゥートだけがハッシュタグで検索できます。", "compose_form.lock_disclaimer": "あなたのアカウントは{locked}になっていません。誰でもあなたをフォローすることができ、フォロワー限定の投稿を見ることができます。", "compose_form.lock_disclaimer.lock": "承認制", "compose_form.placeholder": "今なにしてる?", - "compose_form.poll.add_option": "Add a choice", - "compose_form.poll.duration": "投票期間", - "compose_form.poll.option_placeholder": "Choice {number}", - "compose_form.poll.remove_option": "Remove this choice", + "compose_form.poll.add_option": "追加", + "compose_form.poll.duration": "アンケート期間", + "compose_form.poll.option_placeholder": "選択肢 {number}", + "compose_form.poll.remove_option": "この選択肢を削除", "compose_form.publish": "トゥート", "compose_form.publish_loud": "{publish}!", "compose_form.sensitive.marked": "メディアに閲覧注意が設定されています", @@ -83,7 +83,7 @@ "compose_form.spoiler.unmarked": "閲覧注意が設定されていません", "compose_form.spoiler_placeholder": "ここに警告を書いてください", "confirmation_modal.cancel": "キャンセル", - "confirmations.block.block_and_report": "Block & Report", + "confirmations.block.block_and_report": "ブロックし通報", "confirmations.block.confirm": "ブロック", "confirmations.block.message": "本当に{name}さんをブロックしますか?", "confirmations.delete.confirm": "削除", @@ -117,6 +117,7 @@ "emoji_button.symbols": "記号", "emoji_button.travel": "旅行と場所", "empty_column.account_timeline": "トゥートがありません!", + "empty_column.account_timeline_blocked": "ブロックされています", "empty_column.blocks": "まだ誰もブロックしていません。", "empty_column.community": "ローカルタイムラインはまだ使われていません。何か書いてみましょう!", "empty_column.direct": "ダイレクトメッセージはまだありません。ダイレクトメッセージをやりとりすると、ここに表示されます。", @@ -154,8 +155,8 @@ "home.column_settings.basic": "基本設定", "home.column_settings.show_reblogs": "ブースト表示", "home.column_settings.show_replies": "返信表示", - "intervals.full.days": "{number, plural, one {# day} other {# days}}", - "intervals.full.hours": "{number, plural, one {# hour} other {# hours}}", + "intervals.full.days": "{number}日", + "intervals.full.hours": "{number}時間", "intervals.full.minutes": "{number}分", "introduction.federation.action": "次へ", "introduction.federation.federated.headline": "連合タイムライン", @@ -173,7 +174,7 @@ "introduction.interactions.reply.text": "自身や人々のトゥートに返信することで、一連の会話に繋げることができます。", "introduction.welcome.action": "はじめる!", "introduction.welcome.headline": "はじめに", - "introduction.welcome.text": "Fediverseの世界へようこそ!あと少しでメッセージを配信したり、さまざまなサーバーを越えた友達と話せるようになります。ところでここ{domain}は特別なサーバーです…あなたのプロフィールを持つ主体のサーバーですので、名前を覚えておきましょう。", + "introduction.welcome.text": "Fediverseの世界へようこそ!あと少しでメッセージを配信したり、さまざまなサーバーを越えた友達と話せるようになります。ところで、ここ{domain}は特別なサーバーです…あなたのプロフィールを持つ主体のサーバーですので、名前を覚えておきましょう。", "keyboard_shortcuts.back": "戻る", "keyboard_shortcuts.blocked": "ブロックしたユーザーのリストを開く", "keyboard_shortcuts.boost": "ブースト", @@ -246,7 +247,7 @@ "notification.favourite": "{name}さんがあなたのトゥートをお気に入りに登録しました", "notification.follow": "{name}さんにフォローされました", "notification.mention": "{name}さんがあなたに返信しました", - "notification.poll": "A poll you have voted in has ended", + "notification.poll": "アンケートが終了しました", "notification.reblog": "{name}さんがあなたのトゥートをブーストしました", "notifications.clear": "通知を消去", "notifications.clear_confirmation": "本当に通知を消去しますか?", @@ -257,7 +258,7 @@ "notifications.column_settings.filter_bar.show": "表示", "notifications.column_settings.follow": "新しいフォロワー:", "notifications.column_settings.mention": "返信:", - "notifications.column_settings.poll": "Poll results:", + "notifications.column_settings.poll": "アンケート結果:", "notifications.column_settings.push": "プッシュ通知", "notifications.column_settings.reblog": "ブースト:", "notifications.column_settings.show": "カラムに表示", @@ -267,14 +268,14 @@ "notifications.filter.favourites": "お気に入り", "notifications.filter.follows": "フォロー", "notifications.filter.mentions": "返信", - "notifications.filter.polls": "Poll results", + "notifications.filter.polls": "アンケート結果", "notifications.group": "{count} 件の通知", "poll.closed": "終了", "poll.refresh": "更新", "poll.total_votes": "{count}票", - "poll.vote": "Vote", - "poll_button.add_poll": "Add a poll", - "poll_button.remove_poll": "投票を削除", + "poll.vote": "投票", + "poll_button.add_poll": "アンケートを追加", + "poll_button.remove_poll": "アンケートを削除", "privacy.change": "公開範囲を変更", "privacy.direct.long": "メンションしたユーザーだけに公開", "privacy.direct.short": "ダイレクト", @@ -366,7 +367,7 @@ "upload_area.title": "ドラッグ&ドロップでアップロード", "upload_button.label": "メディアを追加 (JPEG, PNG, GIF, WebM, MP4, MOV)", "upload_error.limit": "アップロードできる上限を超えています。", - "upload_error.poll": "File upload not allowed with polls.", + "upload_error.poll": "アンケートではファイルをアップロードできません。", "upload_form.description": "視覚障害者のための説明", "upload_form.focus": "プレビューを変更", "upload_form.undo": "削除", -- cgit From 62bafa20a112ccdddaedb25723fc819dbbcd8e9a Mon Sep 17 00:00:00 2001 From: ThibG Date: Mon, 1 Apr 2019 20:06:13 +0200 Subject: Hide blocking accounts from blocked users (#10442) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "Add indication that you have been blocked in web UI (#10420)" This reverts commit bd02ec6daa974dcd3231e73826a56e08dbeedadc. * Revert "Add `blocked_by` relationship to the REST API (#10373)" This reverts commit 9745de883b198375ba23f7fde879f6d75ce2df0f. * Hide blocking accounts from search results * Filter blocking accouts from account followers * Filter blocking accouts from account's following accounts * Filter blocking accounts from “reblogged by” and “favourited by” lists * Remove blocking account from URL search * Return 410 on trying to fetch user data from a user who blocked us * Return 410 in /api/v1/account/statuses for suspended or blocking accounts * Fix status filtering when performing URL search * Restore some React improvements Restore some cleanup from bd02ec6daa974dcd3231e73826a56e08dbeedadc * Refactor by adding `without_blocking` scope --- .../v1/accounts/follower_accounts_controller.rb | 2 +- .../v1/accounts/following_accounts_controller.rb | 2 +- .../api/v1/accounts/statuses_controller.rb | 10 ++++++++ app/controllers/api/v1/accounts_controller.rb | 5 ++++ .../statuses/favourited_by_accounts_controller.rb | 1 + .../statuses/reblogged_by_accounts_controller.rb | 2 +- .../mastodon/features/account/components/header.js | 2 +- .../mastodon/features/account_timeline/index.js | 22 +++++----------- .../mastodon/features/followers/index.js | 8 +++--- .../mastodon/features/following/index.js | 8 +++--- app/javascript/styles/mastodon/stream_entries.scss | 6 ++--- app/models/account.rb | 1 + app/presenters/account_relationships_presenter.rb | 6 +---- app/serializers/rest/relationship_serializer.rb | 6 +---- app/services/account_search_service.rb | 10 +++++++- app/services/search_service.rb | 2 ++ .../accounts/follower_accounts_controller_spec.rb | 29 +++++++++++++++++++-- .../accounts/following_accounts_controller_spec.rb | 29 +++++++++++++++++++-- spec/services/account_search_service_spec.rb | 17 ++++++++++++ spec/services/search_service_spec.rb | 30 ++++++++++++---------- 20 files changed, 136 insertions(+), 62 deletions(-) (limited to 'app/javascript') diff --git a/app/controllers/api/v1/accounts/follower_accounts_controller.rb b/app/controllers/api/v1/accounts/follower_accounts_controller.rb index ec15debb0..7a45e6dd2 100644 --- a/app/controllers/api/v1/accounts/follower_accounts_controller.rb +++ b/app/controllers/api/v1/accounts/follower_accounts_controller.rb @@ -25,7 +25,7 @@ class Api::V1::Accounts::FollowerAccountsController < Api::BaseController end def default_accounts - Account.includes(:active_relationships, :account_stat).references(:active_relationships) + Account.without_blocking(current_account).includes(:active_relationships, :account_stat).references(:active_relationships) end def paginated_follows diff --git a/app/controllers/api/v1/accounts/following_accounts_controller.rb b/app/controllers/api/v1/accounts/following_accounts_controller.rb index f3e112f2c..0369cb25e 100644 --- a/app/controllers/api/v1/accounts/following_accounts_controller.rb +++ b/app/controllers/api/v1/accounts/following_accounts_controller.rb @@ -25,7 +25,7 @@ class Api::V1::Accounts::FollowingAccountsController < Api::BaseController end def default_accounts - Account.includes(:passive_relationships, :account_stat).references(:passive_relationships) + Account.without_blocking(current_account).includes(:passive_relationships, :account_stat).references(:passive_relationships) end def paginated_follows diff --git a/app/controllers/api/v1/accounts/statuses_controller.rb b/app/controllers/api/v1/accounts/statuses_controller.rb index 8cd8f8e79..7aba2d0bd 100644 --- a/app/controllers/api/v1/accounts/statuses_controller.rb +++ b/app/controllers/api/v1/accounts/statuses_controller.rb @@ -3,6 +3,8 @@ class Api::V1::Accounts::StatusesController < Api::BaseController before_action -> { authorize_if_got_token! :read, :'read:statuses' } before_action :set_account + before_action :check_account_suspension + before_action :check_account_block after_action :insert_pagination_headers respond_to :json @@ -18,6 +20,14 @@ class Api::V1::Accounts::StatusesController < Api::BaseController @account = Account.find(params[:account_id]) end + def check_account_suspension + gone if @account.suspended? + end + + def check_account_block + gone if current_account.present? && @account.blocking?(current_account) + end + def load_statuses cached_account_statuses end diff --git a/app/controllers/api/v1/accounts_controller.rb b/app/controllers/api/v1/accounts_controller.rb index b0c62778e..685e044c3 100644 --- a/app/controllers/api/v1/accounts_controller.rb +++ b/app/controllers/api/v1/accounts_controller.rb @@ -10,6 +10,7 @@ class Api::V1::AccountsController < Api::BaseController before_action :require_user!, except: [:show, :create] before_action :set_account, except: [:create] before_action :check_account_suspension, only: [:show] + before_action :check_account_block, only: [:show] before_action :check_enabled_registrations, only: [:create] respond_to :json @@ -75,6 +76,10 @@ class Api::V1::AccountsController < Api::BaseController gone if @account.suspended? end + def check_account_block + gone if current_account.present? && @account.blocking?(current_account) + end + def account_params params.permit(:username, :email, :password, :agreement, :locale) end diff --git a/app/controllers/api/v1/statuses/favourited_by_accounts_controller.rb b/app/controllers/api/v1/statuses/favourited_by_accounts_controller.rb index 657e57831..e00c4d708 100644 --- a/app/controllers/api/v1/statuses/favourited_by_accounts_controller.rb +++ b/app/controllers/api/v1/statuses/favourited_by_accounts_controller.rb @@ -22,6 +22,7 @@ class Api::V1::Statuses::FavouritedByAccountsController < Api::BaseController def default_accounts Account + .without_blocking(current_account) .includes(:favourites, :account_stat) .references(:favourites) .where(favourites: { status_id: @status.id }) diff --git a/app/controllers/api/v1/statuses/reblogged_by_accounts_controller.rb b/app/controllers/api/v1/statuses/reblogged_by_accounts_controller.rb index 6851099f6..9b2d0e59e 100644 --- a/app/controllers/api/v1/statuses/reblogged_by_accounts_controller.rb +++ b/app/controllers/api/v1/statuses/reblogged_by_accounts_controller.rb @@ -21,7 +21,7 @@ class Api::V1::Statuses::RebloggedByAccountsController < Api::BaseController end def default_accounts - Account.includes(:statuses, :account_stat).references(:statuses) + Account.without_blocking(current_account).includes(:statuses, :account_stat).references(:statuses) end def paginated_statuses diff --git a/app/javascript/mastodon/features/account/components/header.js b/app/javascript/mastodon/features/account/components/header.js index f21ba8a9c..9d15bc28f 100644 --- a/app/javascript/mastodon/features/account/components/header.js +++ b/app/javascript/mastodon/features/account/components/header.js @@ -111,7 +111,7 @@ class Header extends ImmutablePureComponent { } else if (account.getIn(['relationship', 'requested'])) { actionBtn =