diff --git a/app/soapbox/actions/favourites.js b/app/soapbox/actions/favourites.js index ee884ad17..dfc1ee9ba 100644 --- a/app/soapbox/actions/favourites.js +++ b/app/soapbox/actions/favourites.js @@ -10,13 +10,13 @@ export const FAVOURITED_STATUSES_EXPAND_REQUEST = 'FAVOURITED_STATUSES_EXPAND_RE export const FAVOURITED_STATUSES_EXPAND_SUCCESS = 'FAVOURITED_STATUSES_EXPAND_SUCCESS'; export const FAVOURITED_STATUSES_EXPAND_FAIL = 'FAVOURITED_STATUSES_EXPAND_FAIL'; -export const USER_FAVOURITED_STATUSES_FETCH_REQUEST = 'USER_FAVOURITED_STATUSES_FETCH_REQUEST'; -export const USER_FAVOURITED_STATUSES_FETCH_SUCCESS = 'USER_FAVOURITED_STATUSES_FETCH_SUCCESS'; -export const USER_FAVOURITED_STATUSES_FETCH_FAIL = 'USER_FAVOURITED_STATUSES_FETCH_FAIL'; +export const ACCOUNT_FAVOURITED_STATUSES_FETCH_REQUEST = 'ACCOUNT_FAVOURITED_STATUSES_FETCH_REQUEST'; +export const ACCOUNT_FAVOURITED_STATUSES_FETCH_SUCCESS = 'ACCOUNT_FAVOURITED_STATUSES_FETCH_SUCCESS'; +export const ACCOUNT_FAVOURITED_STATUSES_FETCH_FAIL = 'ACCOUNT_FAVOURITED_STATUSES_FETCH_FAIL'; -export const USER_FAVOURITED_STATUSES_EXPAND_REQUEST = 'USER_FAVOURITED_STATUSES_EXPAND_REQUEST'; -export const USER_FAVOURITED_STATUSES_EXPAND_SUCCESS = 'USER_FAVOURITED_STATUSES_EXPAND_SUCCESS'; -export const USER_FAVOURITED_STATUSES_EXPAND_FAIL = 'USER_FAVOURITED_STATUSES_EXPAND_FAIL'; +export const ACCOUNT_FAVOURITED_STATUSES_EXPAND_REQUEST = 'ACCOUNT_FAVOURITED_STATUSES_EXPAND_REQUEST'; +export const ACCOUNT_FAVOURITED_STATUSES_EXPAND_SUCCESS = 'ACCOUNT_FAVOURITED_STATUSES_EXPAND_SUCCESS'; +export const ACCOUNT_FAVOURITED_STATUSES_EXPAND_FAIL = 'ACCOUNT_FAVOURITED_STATUSES_EXPAND_FAIL'; export function fetchFavouritedStatuses() { return (dispatch, getState) => { @@ -105,7 +105,7 @@ export function expandFavouritedStatusesFail(error) { }; } -export function fetchUserFavouritedStatuses(accountId) { +export function fetchAccountFavouritedStatuses(accountId) { return (dispatch, getState) => { if (!isLoggedIn(getState)) return; @@ -113,29 +113,29 @@ export function fetchUserFavouritedStatuses(accountId) { return; } - dispatch(fetchUserFavouritedStatusesRequest(accountId)); + dispatch(fetchAccountFavouritedStatusesRequest(accountId)); api(getState).get(`/api/v1/pleroma/accounts/${accountId}/favourites`).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedStatuses(response.data)); - dispatch(fetchUserFavouritedStatusesSuccess(accountId, response.data, next ? next.uri : null)); + dispatch(fetchAccountFavouritedStatusesSuccess(accountId, response.data, next ? next.uri : null)); }).catch(error => { - dispatch(fetchUserFavouritedStatusesFail(accountId, error)); + dispatch(fetchAccountFavouritedStatusesFail(accountId, error)); }); }; } -export function fetchUserFavouritedStatusesRequest(accountId) { +export function fetchAccountFavouritedStatusesRequest(accountId) { return { - type: USER_FAVOURITED_STATUSES_FETCH_REQUEST, + type: ACCOUNT_FAVOURITED_STATUSES_FETCH_REQUEST, accountId, skipLoading: true, }; } -export function fetchUserFavouritedStatusesSuccess(accountId, statuses, next) { +export function fetchAccountFavouritedStatusesSuccess(accountId, statuses, next) { return { - type: USER_FAVOURITED_STATUSES_FETCH_SUCCESS, + type: ACCOUNT_FAVOURITED_STATUSES_FETCH_SUCCESS, accountId, statuses, next, @@ -143,16 +143,16 @@ export function fetchUserFavouritedStatusesSuccess(accountId, statuses, next) { }; } -export function fetchUserFavouritedStatusesFail(accountId, error) { +export function fetchAccountFavouritedStatusesFail(accountId, error) { return { - type: USER_FAVOURITED_STATUSES_FETCH_FAIL, + type: ACCOUNT_FAVOURITED_STATUSES_FETCH_FAIL, accountId, error, skipLoading: true, }; } -export function expandUserFavouritedStatuses(accountId) { +export function expandAccountFavouritedStatuses(accountId) { return (dispatch, getState) => { if (!isLoggedIn(getState)) return; @@ -162,37 +162,37 @@ export function expandUserFavouritedStatuses(accountId) { return; } - dispatch(expandUserFavouritedStatusesRequest(accountId)); + dispatch(expandAccountFavouritedStatusesRequest(accountId)); api(getState).get(url).then(response => { const next = getLinks(response).refs.find(link => link.rel === 'next'); dispatch(importFetchedStatuses(response.data)); - dispatch(expandUserFavouritedStatusesSuccess(accountId, response.data, next ? next.uri : null)); + dispatch(expandAccountFavouritedStatusesSuccess(accountId, response.data, next ? next.uri : null)); }).catch(error => { - dispatch(expandUserFavouritedStatusesFail(accountId, error)); + dispatch(expandAccountFavouritedStatusesFail(accountId, error)); }); }; } -export function expandUserFavouritedStatusesRequest(accountId) { +export function expandAccountFavouritedStatusesRequest(accountId) { return { - type: USER_FAVOURITED_STATUSES_EXPAND_REQUEST, + type: ACCOUNT_FAVOURITED_STATUSES_EXPAND_REQUEST, accountId, }; } -export function expandUserFavouritedStatusesSuccess(accountId, statuses, next) { +export function expandAccountFavouritedStatusesSuccess(accountId, statuses, next) { return { - type: USER_FAVOURITED_STATUSES_EXPAND_SUCCESS, + type: ACCOUNT_FAVOURITED_STATUSES_EXPAND_SUCCESS, accountId, statuses, next, }; } -export function expandUserFavouritedStatusesFail(accountId, error) { +export function expandAccountFavouritedStatusesFail(accountId, error) { return { - type: USER_FAVOURITED_STATUSES_EXPAND_FAIL, + type: ACCOUNT_FAVOURITED_STATUSES_EXPAND_FAIL, accountId, error, }; diff --git a/app/soapbox/features/favourited_statuses/index.js b/app/soapbox/features/favourited_statuses/index.js index 7324a853a..09907434d 100644 --- a/app/soapbox/features/favourited_statuses/index.js +++ b/app/soapbox/features/favourited_statuses/index.js @@ -2,7 +2,7 @@ import React from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import { fetchFavouritedStatuses, expandFavouritedStatuses, fetchUserFavouritedStatuses, expandUserFavouritedStatuses } from '../../actions/favourites'; +import { fetchFavouritedStatuses, expandFavouritedStatuses, fetchAccountFavouritedStatuses, expandAccountFavouritedStatuses } from '../../actions/favourites'; import Column from '../ui/components/column'; import StatusList from '../../components/status_list'; import { injectIntl, FormattedMessage } from 'react-intl'; @@ -75,7 +75,7 @@ class Favourites extends ImmutablePureComponent { else { if (accountId && accountId !== -1) { this.props.dispatch(fetchAccount(accountId)); - this.props.dispatch(fetchUserFavouritedStatuses(accountId)); + this.props.dispatch(fetchAccountFavouritedStatuses(accountId)); } else { this.props.dispatch(fetchAccountByUsername(username)); } @@ -87,7 +87,7 @@ class Favourites extends ImmutablePureComponent { if (!isMyAccount && accountId && accountId !== -1 && (accountId !== prevProps.accountId && accountId)) { this.props.dispatch(fetchAccount(accountId)); - this.props.dispatch(fetchUserFavouritedStatuses(accountId)); + this.props.dispatch(fetchAccountFavouritedStatuses(accountId)); } } @@ -97,7 +97,7 @@ class Favourites extends ImmutablePureComponent { if (isMyAccount) { this.props.dispatch(expandFavouritedStatuses()); } else { - this.props.dispatch(expandUserFavouritedStatuses(accountId)); + this.props.dispatch(expandAccountFavouritedStatuses(accountId)); } }, 300, { leading: true }) diff --git a/app/soapbox/locales/pl.json b/app/soapbox/locales/pl.json index 5ae873e7d..997828ce5 100644 --- a/app/soapbox/locales/pl.json +++ b/app/soapbox/locales/pl.json @@ -312,6 +312,7 @@ "emoji_button.search_results": "Wyniki wyszukiwania", "emoji_button.symbols": "Symbole", "emoji_button.travel": "Podróże i miejsca", + "empty_column.account_favourited_statuses": "Ten użytkownik nie polubił jeszcze żadnego wpisu.", "empty_column.account_timeline": "Brak wpisów tutaj!", "empty_column.account_unavailable": "Profil niedostępny", "empty_column.aliases": "Nie utworzyłeś(-aś) jeszcze żadnego aliasu konta.", @@ -321,7 +322,7 @@ "empty_column.community": "Lokalna oś czasu jest pusta. Napisz coś publicznie, aby zagaić!", "empty_column.direct": "Nie masz żadnych wiadomości bezpośrednich. Kiedy dostaniesz lub wyślesz jakąś, pojawi się ona tutaj.", "empty_column.domain_blocks": "Brak ukrytych domen.", - "empty_column.favourited_statuses": "Nie dodałeś(-aś) żadnego wpisu do ulubionych. Kiedy to zrobisz, pojawi się on tutaj.", + "empty_column.favourited_statuses": "Nie polubiłeś(-aś) żadnego wpisu. Kiedy to zrobisz, pojawi się on tutaj.", "empty_column.favourites": "Nikt nie dodał tego wpisu do ulubionych. Gdy ktoś to zrobi, pojawi się tutaj.", "empty_column.filters": "Nie wyciszyłeś(-aś) jeszcze żadnego słowa.", "empty_column.follow_requests": "Nie masz żadnych próśb o możliwość śledzenia. Kiedy ktoś utworzy ją, pojawi się tutaj.", diff --git a/app/soapbox/reducers/status_lists.js b/app/soapbox/reducers/status_lists.js index 8a7ba60dc..1953e636c 100644 --- a/app/soapbox/reducers/status_lists.js +++ b/app/soapbox/reducers/status_lists.js @@ -5,12 +5,12 @@ import { FAVOURITED_STATUSES_EXPAND_REQUEST, FAVOURITED_STATUSES_EXPAND_SUCCESS, FAVOURITED_STATUSES_EXPAND_FAIL, - USER_FAVOURITED_STATUSES_FETCH_REQUEST, - USER_FAVOURITED_STATUSES_FETCH_SUCCESS, - USER_FAVOURITED_STATUSES_FETCH_FAIL, - USER_FAVOURITED_STATUSES_EXPAND_REQUEST, - USER_FAVOURITED_STATUSES_EXPAND_SUCCESS, - USER_FAVOURITED_STATUSES_EXPAND_FAIL, + ACCOUNT_FAVOURITED_STATUSES_FETCH_REQUEST, + ACCOUNT_FAVOURITED_STATUSES_FETCH_SUCCESS, + ACCOUNT_FAVOURITED_STATUSES_FETCH_FAIL, + ACCOUNT_FAVOURITED_STATUSES_EXPAND_REQUEST, + ACCOUNT_FAVOURITED_STATUSES_EXPAND_SUCCESS, + ACCOUNT_FAVOURITED_STATUSES_EXPAND_FAIL, } from '../actions/favourites'; import { BOOKMARKED_STATUSES_FETCH_REQUEST, @@ -107,15 +107,15 @@ export default function statusLists(state = initialState, action) { return normalizeList(state, 'favourites', action.statuses, action.next); case FAVOURITED_STATUSES_EXPAND_SUCCESS: return appendToList(state, 'favourites', action.statuses, action.next); - case USER_FAVOURITED_STATUSES_FETCH_REQUEST: - case USER_FAVOURITED_STATUSES_EXPAND_REQUEST: + case ACCOUNT_FAVOURITED_STATUSES_FETCH_REQUEST: + case ACCOUNT_FAVOURITED_STATUSES_EXPAND_REQUEST: return setLoading(state, `favourites:${action.accountId}`, true); - case USER_FAVOURITED_STATUSES_FETCH_FAIL: - case USER_FAVOURITED_STATUSES_EXPAND_FAIL: + case ACCOUNT_FAVOURITED_STATUSES_FETCH_FAIL: + case ACCOUNT_FAVOURITED_STATUSES_EXPAND_FAIL: return setLoading(state, `favourites:${action.accountId}`, false); - case USER_FAVOURITED_STATUSES_FETCH_SUCCESS: + case ACCOUNT_FAVOURITED_STATUSES_FETCH_SUCCESS: return normalizeList(state, `favourites:${action.accountId}`, action.statuses, action.next); - case USER_FAVOURITED_STATUSES_EXPAND_SUCCESS: + case ACCOUNT_FAVOURITED_STATUSES_EXPAND_SUCCESS: return appendToList(state, `favourites:${action.accountId}`, action.statuses, action.next); case BOOKMARKED_STATUSES_FETCH_REQUEST: case BOOKMARKED_STATUSES_EXPAND_REQUEST: