kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
				
				
				
			Allow translating more strings
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>datepicker-css
							rodzic
							
								
									afaedd622a
								
							
						
					
					
						commit
						2df8b927ea
					
				| 
						 | 
				
			
			@ -1,3 +1,4 @@
 | 
			
		|||
import { defineMessages } from 'react-intl';
 | 
			
		||||
import api, { baseClient } from '../api';
 | 
			
		||||
import { importFetchedAccount } from './importer';
 | 
			
		||||
import snackbar from 'soapbox/actions/snackbar';
 | 
			
		||||
| 
						 | 
				
			
			@ -39,6 +40,11 @@ export const REVOKE_TOKEN_REQUEST = 'REVOKE_TOKEN_REQUEST';
 | 
			
		|||
export const REVOKE_TOKEN_SUCCESS = 'REVOKE_TOKEN_SUCCESS';
 | 
			
		||||
export const REVOKE_TOKEN_FAIL    = 'REVOKE_TOKEN_FAIL';
 | 
			
		||||
 | 
			
		||||
const messages = defineMessages({
 | 
			
		||||
  loggedOut: { id: 'auth.logged_out', defaultMessage: 'Logged out.' },
 | 
			
		||||
  invalidCredentials: { id: 'auth.invalid_credentials', defaultMessage: 'Wrong username or password' },
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const noOp = () => () => new Promise(f => f());
 | 
			
		||||
 | 
			
		||||
function createAppAndToken() {
 | 
			
		||||
| 
						 | 
				
			
			@ -150,7 +156,7 @@ export function verifyCredentials(token) {
 | 
			
		|||
  };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function logIn(username, password) {
 | 
			
		||||
export function logIn(intl, username, password) {
 | 
			
		||||
  return (dispatch, getState) => {
 | 
			
		||||
    return dispatch(createAppAndToken()).then(() => {
 | 
			
		||||
      return dispatch(createUserToken(username, password));
 | 
			
		||||
| 
						 | 
				
			
			@ -160,14 +166,14 @@ export function logIn(username, password) {
 | 
			
		|||
      } else if(error.response.data.error) {
 | 
			
		||||
        dispatch(snackbar.error(error.response.data.error));
 | 
			
		||||
      } else {
 | 
			
		||||
        dispatch(snackbar.error('Wrong username or password'));
 | 
			
		||||
        dispatch(snackbar.error(intl.formatMessage(messages.invalidCredentials)));
 | 
			
		||||
      }
 | 
			
		||||
      throw error;
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function logOut() {
 | 
			
		||||
export function logOut(intl) {
 | 
			
		||||
  return (dispatch, getState) => {
 | 
			
		||||
    const state = getState();
 | 
			
		||||
    const me = state.get('me');
 | 
			
		||||
| 
						 | 
				
			
			@ -178,7 +184,7 @@ export function logOut() {
 | 
			
		|||
      token: state.getIn(['auth', 'users', me, 'access_token']),
 | 
			
		||||
    }).finally(() => {
 | 
			
		||||
      dispatch({ type: AUTH_LOGGED_OUT, accountId: me });
 | 
			
		||||
      dispatch(snackbar.success('Logged out.'));
 | 
			
		||||
      dispatch(snackbar.success(intl.formatMessage(messages.loggedOut)));
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -250,7 +256,7 @@ export function changeEmail(email, password) {
 | 
			
		|||
  };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function deleteAccount(password) {
 | 
			
		||||
export function deleteAccount(intl, password) {
 | 
			
		||||
  return (dispatch, getState) => {
 | 
			
		||||
    dispatch({ type: DELETE_ACCOUNT_REQUEST });
 | 
			
		||||
    return api(getState).post('/api/pleroma/delete_account', {
 | 
			
		||||
| 
						 | 
				
			
			@ -259,7 +265,7 @@ export function deleteAccount(password) {
 | 
			
		|||
      if (response.data.error) throw response.data.error; // This endpoint returns HTTP 200 even on failure
 | 
			
		||||
      dispatch({ type: DELETE_ACCOUNT_SUCCESS, response });
 | 
			
		||||
      dispatch({ type: AUTH_LOGGED_OUT });
 | 
			
		||||
      dispatch(snackbar.success('Logged out.'));
 | 
			
		||||
      dispatch(snackbar.success(intl.formatMessage(messages.loggedOut)));
 | 
			
		||||
    }).catch(error => {
 | 
			
		||||
      dispatch({ type: DELETE_ACCOUNT_FAIL, error, skipAlert: true });
 | 
			
		||||
      throw error;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,4 @@
 | 
			
		|||
import { defineMessages } from 'react-intl';
 | 
			
		||||
import api from '../api';
 | 
			
		||||
import snackbar from 'soapbox/actions/snackbar';
 | 
			
		||||
import { isLoggedIn } from 'soapbox/utils/auth';
 | 
			
		||||
| 
						 | 
				
			
			@ -14,6 +15,11 @@ export const FILTERS_DELETE_REQUEST = 'FILTERS_DELETE_REQUEST';
 | 
			
		|||
export const FILTERS_DELETE_SUCCESS = 'FILTERS_DELETE_SUCCESS';
 | 
			
		||||
export const FILTERS_DELETE_FAIL    = 'FILTERS_DELETE_FAIL';
 | 
			
		||||
 | 
			
		||||
const messages = defineMessages({
 | 
			
		||||
  added: { id: 'filters.added', defaultMessage: 'Filter added.' },
 | 
			
		||||
  removed: { id: 'filters.removed', defaultMessage: 'Filter deleted.' },
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export const fetchFilters = () => (dispatch, getState) => {
 | 
			
		||||
  if (!isLoggedIn(getState)) return;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -37,7 +43,7 @@ export const fetchFilters = () => (dispatch, getState) => {
 | 
			
		|||
    }));
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export function createFilter(phrase, expires_at, context, whole_word, irreversible) {
 | 
			
		||||
export function createFilter(intl, phrase, expires_at, context, whole_word, irreversible) {
 | 
			
		||||
  return (dispatch, getState) => {
 | 
			
		||||
    dispatch({ type: FILTERS_CREATE_REQUEST });
 | 
			
		||||
    return api(getState).post('/api/v1/filters', {
 | 
			
		||||
| 
						 | 
				
			
			@ -48,7 +54,7 @@ export function createFilter(phrase, expires_at, context, whole_word, irreversib
 | 
			
		|||
      expires_at,
 | 
			
		||||
    }).then(response => {
 | 
			
		||||
      dispatch({ type: FILTERS_CREATE_SUCCESS, filter: response.data });
 | 
			
		||||
      dispatch(snackbar.success('Filter added.'));
 | 
			
		||||
      dispatch(snackbar.success(intl.formatMessage(messages.added)));
 | 
			
		||||
    }).catch(error => {
 | 
			
		||||
      dispatch({ type: FILTERS_CREATE_FAIL, error });
 | 
			
		||||
    });
 | 
			
		||||
| 
						 | 
				
			
			@ -56,12 +62,12 @@ export function createFilter(phrase, expires_at, context, whole_word, irreversib
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export function deleteFilter(id) {
 | 
			
		||||
export function deleteFilter(intl, id) {
 | 
			
		||||
  return (dispatch, getState) => {
 | 
			
		||||
    dispatch({ type: FILTERS_DELETE_REQUEST });
 | 
			
		||||
    return api(getState).delete('/api/v1/filters/'+id).then(response => {
 | 
			
		||||
      dispatch({ type: FILTERS_DELETE_SUCCESS, filter: response.data });
 | 
			
		||||
      dispatch(snackbar.success('Filter deleted.'));
 | 
			
		||||
      dispatch(snackbar.success(intl.formatMessage(messages.removed)));
 | 
			
		||||
    }).catch(error => {
 | 
			
		||||
      dispatch({ type: FILTERS_DELETE_FAIL, error });
 | 
			
		||||
    });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,4 @@
 | 
			
		|||
import { defineMessages } from 'react-intl';
 | 
			
		||||
import api from '../api';
 | 
			
		||||
import snackbar from 'soapbox/actions/snackbar';
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -13,13 +14,19 @@ export const IMPORT_MUTES_REQUEST = 'IMPORT_MUTES_REQUEST';
 | 
			
		|||
export const IMPORT_MUTES_SUCCESS = 'IMPORT_MUTES_SUCCESS';
 | 
			
		||||
export const IMPORT_MUTES_FAIL    = 'IMPORT_MUTES_FAIL';
 | 
			
		||||
 | 
			
		||||
export function importFollows(params) {
 | 
			
		||||
const messages = defineMessages({
 | 
			
		||||
  blocksSuccess: { id: 'import_data.success.blocks', defaultMessage: 'Blocks imported successfully' },
 | 
			
		||||
  followersSuccess: { id: 'import_data.success.followers', defaultMessage: 'Followers imported successfully' },
 | 
			
		||||
  mutesSuccess: { id: 'import_data.success.mutes', defaultMessage: 'Mutes imported successfully' },
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export function importFollows(intl, params) {
 | 
			
		||||
  return (dispatch, getState) => {
 | 
			
		||||
    dispatch({ type: IMPORT_FOLLOWS_REQUEST });
 | 
			
		||||
    return api(getState)
 | 
			
		||||
      .post('/api/pleroma/follow_import', params)
 | 
			
		||||
      .then(response => {
 | 
			
		||||
        dispatch(snackbar.success('Followers imported successfully'));
 | 
			
		||||
        dispatch(snackbar.success(intl.formatMessage(messages.followersSuccess)));
 | 
			
		||||
        dispatch({ type: IMPORT_FOLLOWS_SUCCESS, config: response.data });
 | 
			
		||||
      }).catch(error => {
 | 
			
		||||
        dispatch({ type: IMPORT_FOLLOWS_FAIL, error });
 | 
			
		||||
| 
						 | 
				
			
			@ -27,13 +34,13 @@ export function importFollows(params) {
 | 
			
		|||
  };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function importBlocks(params) {
 | 
			
		||||
export function importBlocks(intl, params) {
 | 
			
		||||
  return (dispatch, getState) => {
 | 
			
		||||
    dispatch({ type: IMPORT_BLOCKS_REQUEST });
 | 
			
		||||
    return api(getState)
 | 
			
		||||
      .post('/api/pleroma/blocks_import', params)
 | 
			
		||||
      .then(response => {
 | 
			
		||||
        dispatch(snackbar.success('Blocks imported successfully'));
 | 
			
		||||
        dispatch(snackbar.success(intl.formatMessage(messages.blocksSuccess)));
 | 
			
		||||
        dispatch({ type: IMPORT_BLOCKS_SUCCESS, config: response.data });
 | 
			
		||||
      }).catch(error => {
 | 
			
		||||
        dispatch({ type: IMPORT_BLOCKS_FAIL, error });
 | 
			
		||||
| 
						 | 
				
			
			@ -41,13 +48,13 @@ export function importBlocks(params) {
 | 
			
		|||
  };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function importMutes(params) {
 | 
			
		||||
export function importMutes(intl, params) {
 | 
			
		||||
  return (dispatch, getState) => {
 | 
			
		||||
    dispatch({ type: IMPORT_MUTES_REQUEST });
 | 
			
		||||
    return api(getState)
 | 
			
		||||
      .post('/api/pleroma/mutes_import', params)
 | 
			
		||||
      .then(response => {
 | 
			
		||||
        dispatch(snackbar.success('Mutes imported successfully'));
 | 
			
		||||
        dispatch(snackbar.success(intl.formatMessage(messages.mutesSuccess)));
 | 
			
		||||
        dispatch({ type: IMPORT_MUTES_SUCCESS, config: response.data });
 | 
			
		||||
      }).catch(error => {
 | 
			
		||||
        dispatch({ type: IMPORT_MUTES_FAIL, error });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,4 @@
 | 
			
		|||
import { defineMessages } from 'react-intl';
 | 
			
		||||
import api from '../api';
 | 
			
		||||
import { importFetchedAccounts, importFetchedStatus } from './importer';
 | 
			
		||||
import snackbar from 'soapbox/actions/snackbar';
 | 
			
		||||
| 
						 | 
				
			
			@ -43,6 +44,11 @@ export const UNBOOKMARK_REQUEST = 'UNBOOKMARKED_REQUEST';
 | 
			
		|||
export const UNBOOKMARK_SUCCESS = 'UNBOOKMARKED_SUCCESS';
 | 
			
		||||
export const UNBOOKMARK_FAIL    = 'UNBOOKMARKED_FAIL';
 | 
			
		||||
 | 
			
		||||
const messages = defineMessages({
 | 
			
		||||
  bookmarkAdded: { id: 'status.bookmarked', defaultMessage: 'Bookmark added.' },
 | 
			
		||||
  bookmarkRemoved: { id: 'status.unbookmarked', defaultMessage: 'Bookmark removed.' },
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export function reblog(status) {
 | 
			
		||||
  return function(dispatch, getState) {
 | 
			
		||||
    if (!isLoggedIn(getState)) return;
 | 
			
		||||
| 
						 | 
				
			
			@ -205,28 +211,28 @@ export function unfavouriteFail(status, error) {
 | 
			
		|||
  };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export function bookmark(status) {
 | 
			
		||||
export function bookmark(intl, status) {
 | 
			
		||||
  return function(dispatch, getState) {
 | 
			
		||||
    dispatch(bookmarkRequest(status));
 | 
			
		||||
 | 
			
		||||
    api(getState).post(`/api/v1/statuses/${status.get('id')}/bookmark`).then(function(response) {
 | 
			
		||||
      dispatch(importFetchedStatus(response.data));
 | 
			
		||||
      dispatch(bookmarkSuccess(status, response.data));
 | 
			
		||||
      dispatch(snackbar.success('Bookmark added'));
 | 
			
		||||
      dispatch(snackbar.success(intl.formatMessage(messages.bookmarkAdded)));
 | 
			
		||||
    }).catch(function(error) {
 | 
			
		||||
      dispatch(bookmarkFail(status, error));
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export function unbookmark(status) {
 | 
			
		||||
export function unbookmark(intl, status) {
 | 
			
		||||
  return (dispatch, getState) => {
 | 
			
		||||
    dispatch(unbookmarkRequest(status));
 | 
			
		||||
 | 
			
		||||
    api(getState).post(`/api/v1/statuses/${status.get('id')}/unbookmark`).then(response => {
 | 
			
		||||
      dispatch(importFetchedStatus(response.data));
 | 
			
		||||
      dispatch(unbookmarkSuccess(status, response.data));
 | 
			
		||||
      dispatch(snackbar.success('Bookmark removed'));
 | 
			
		||||
      dispatch(snackbar.success(intl.formatMessage(messages.bookmarkRemoved)));
 | 
			
		||||
    }).catch(error => {
 | 
			
		||||
      dispatch(unbookmarkFail(status, error));
 | 
			
		||||
    });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -70,12 +70,12 @@ const mapStateToProps = state => {
 | 
			
		|||
  };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const mapDispatchToProps = (dispatch) => ({
 | 
			
		||||
const mapDispatchToProps = (dispatch, { intl }) => ({
 | 
			
		||||
  onClose() {
 | 
			
		||||
    dispatch(closeSidebar());
 | 
			
		||||
  },
 | 
			
		||||
  onClickLogOut(e) {
 | 
			
		||||
    dispatch(logOut());
 | 
			
		||||
    dispatch(logOut(intl));
 | 
			
		||||
    e.preventDefault();
 | 
			
		||||
  },
 | 
			
		||||
  fetchOwnAccounts() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -107,9 +107,9 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
 | 
			
		|||
 | 
			
		||||
  onBookmark(status) {
 | 
			
		||||
    if (status.get('bookmarked')) {
 | 
			
		||||
      dispatch(unbookmark(status));
 | 
			
		||||
      dispatch(unbookmark(intl, status));
 | 
			
		||||
    } else {
 | 
			
		||||
      dispatch(bookmark(status));
 | 
			
		||||
      dispatch(bookmark(intl, status));
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,6 +2,7 @@ import React from 'react';
 | 
			
		|||
import { connect } from 'react-redux';
 | 
			
		||||
import { Redirect } from 'react-router-dom';
 | 
			
		||||
import ImmutablePureComponent from 'react-immutable-pure-component';
 | 
			
		||||
import { injectIntl } from 'react-intl';
 | 
			
		||||
import LoginForm from './login_form';
 | 
			
		||||
import OtpAuthForm from './otp_auth_form';
 | 
			
		||||
import { logIn, verifyCredentials, switchAccount } from 'soapbox/actions/auth';
 | 
			
		||||
| 
						 | 
				
			
			@ -12,6 +13,7 @@ const mapStateToProps = state => ({
 | 
			
		|||
});
 | 
			
		||||
 | 
			
		||||
export default @connect(mapStateToProps)
 | 
			
		||||
@injectIntl
 | 
			
		||||
class LoginPage extends ImmutablePureComponent {
 | 
			
		||||
 | 
			
		||||
  constructor(props) {
 | 
			
		||||
| 
						 | 
				
			
			@ -33,9 +35,9 @@ class LoginPage extends ImmutablePureComponent {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  handleSubmit = (event) => {
 | 
			
		||||
    const { dispatch, me } = this.props;
 | 
			
		||||
    const { dispatch, intl, me } = this.props;
 | 
			
		||||
    const { username, password } = this.getFormData(event.target);
 | 
			
		||||
    dispatch(logIn(username, password)).then(({ access_token }) => {
 | 
			
		||||
    dispatch(logIn(intl, username, password)).then(({ access_token }) => {
 | 
			
		||||
      return dispatch(verifyCredentials(access_token));
 | 
			
		||||
    }).then(account => {
 | 
			
		||||
      this.setState({ shouldRedirect: true });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,12 +1,19 @@
 | 
			
		|||
import React from 'react';
 | 
			
		||||
import { connect } from 'react-redux';
 | 
			
		||||
import ImmutablePureComponent from 'react-immutable-pure-component';
 | 
			
		||||
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
 | 
			
		||||
import { resetPassword } from 'soapbox/actions/auth';
 | 
			
		||||
import { SimpleForm, FieldsGroup, TextInput } from 'soapbox/features/forms';
 | 
			
		||||
import { Redirect } from 'react-router-dom';
 | 
			
		||||
import snackbar from 'soapbox/actions/snackbar';
 | 
			
		||||
 | 
			
		||||
const messages = defineMessages({
 | 
			
		||||
  nicknameOrEmail: { id: 'password_reset.fields.username_placeholder', defaultMessage: 'Email or username' },
 | 
			
		||||
  confirmation: { id: 'password_reset.confirmation', defaultMessage: 'Check your email for confirmation.' },
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export default @connect()
 | 
			
		||||
@injectIntl
 | 
			
		||||
class PasswordReset extends ImmutablePureComponent {
 | 
			
		||||
 | 
			
		||||
  state = {
 | 
			
		||||
| 
						 | 
				
			
			@ -15,18 +22,20 @@ class PasswordReset extends ImmutablePureComponent {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  handleSubmit = e => {
 | 
			
		||||
    const { dispatch } = this.props;
 | 
			
		||||
    const { dispatch, intl } = this.props;
 | 
			
		||||
    const nicknameOrEmail = e.target.nickname_or_email.value;
 | 
			
		||||
    this.setState({ isLoading: true });
 | 
			
		||||
    dispatch(resetPassword(nicknameOrEmail)).then(() => {
 | 
			
		||||
      this.setState({ isLoading: false, success: true });
 | 
			
		||||
      dispatch(snackbar.info('Check your email for confirmation.'));
 | 
			
		||||
      dispatch(snackbar.info(intl.formatMessage(messages.confirmation)));
 | 
			
		||||
    }).catch(error => {
 | 
			
		||||
      this.setState({ isLoading: false });
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  render() {
 | 
			
		||||
    const { intl } = this.props;
 | 
			
		||||
 | 
			
		||||
    if (this.state.success) return <Redirect to='/' />;
 | 
			
		||||
 | 
			
		||||
    return (
 | 
			
		||||
| 
						 | 
				
			
			@ -35,14 +44,16 @@ class PasswordReset extends ImmutablePureComponent {
 | 
			
		|||
          <FieldsGroup>
 | 
			
		||||
            <TextInput
 | 
			
		||||
              name='nickname_or_email'
 | 
			
		||||
              label='Email or username'
 | 
			
		||||
              label={intl.formatMessage(messages.nicknameOrEmail)}
 | 
			
		||||
              placeholder='me@example.com'
 | 
			
		||||
              required
 | 
			
		||||
            />
 | 
			
		||||
          </FieldsGroup>
 | 
			
		||||
        </fieldset>
 | 
			
		||||
        <div className='actions'>
 | 
			
		||||
          <button name='button' type='submit' className='btn button button-primary'>Reset password</button>
 | 
			
		||||
          <button name='button' type='submit' className='btn button button-primary'>
 | 
			
		||||
            <FormattedMessage id='password_reset.reset' defaultMessage='Reset password' />
 | 
			
		||||
          </button>
 | 
			
		||||
        </div>
 | 
			
		||||
      </SimpleForm>
 | 
			
		||||
    );
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,12 +34,12 @@ const mapStateToProps = state => {
 | 
			
		|||
  };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const mapDispatchToProps = (dispatch) => ({
 | 
			
		||||
const mapDispatchToProps = (dispatch, { intl }) => ({
 | 
			
		||||
  onOpenHotkeys() {
 | 
			
		||||
    dispatch(openModal('HOTKEYS'));
 | 
			
		||||
  },
 | 
			
		||||
  onClickLogOut(e) {
 | 
			
		||||
    dispatch(logOut());
 | 
			
		||||
    dispatch(logOut(intl));
 | 
			
		||||
    e.preventDefault();
 | 
			
		||||
  },
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -39,6 +39,7 @@ const messages = defineMessages({
 | 
			
		|||
  metaFieldLabel: { id: 'edit_profile.fields.meta_fields.label_placeholder', defaultMessage: 'Label' },
 | 
			
		||||
  metaFieldContent: { id: 'edit_profile.fields.meta_fields.content_placeholder', defaultMessage: 'Content' },
 | 
			
		||||
  verified: { id: 'edit_profile.fields.verified_display_name', defaultMessage: 'Verified users may not update their display name' },
 | 
			
		||||
  success: { id: 'edit_profile.success', defaultMessage: 'Profile saved!' },
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const mapStateToProps = state => {
 | 
			
		||||
| 
						 | 
				
			
			@ -150,7 +151,7 @@ class EditProfile extends ImmutablePureComponent {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  handleSubmit = (event) => {
 | 
			
		||||
    const { dispatch } = this.props;
 | 
			
		||||
    const { dispatch, intl } = this.props;
 | 
			
		||||
 | 
			
		||||
    const credentials = dispatch(patchMe(this.getFormdata()));
 | 
			
		||||
    const notifications = dispatch(updateNotificationSettings({
 | 
			
		||||
| 
						 | 
				
			
			@ -161,7 +162,7 @@ class EditProfile extends ImmutablePureComponent {
 | 
			
		|||
 | 
			
		||||
    Promise.all([credentials, notifications]).then(() => {
 | 
			
		||||
      this.setState({ isLoading: false });
 | 
			
		||||
      dispatch(snackbar.success('Profile saved!'));
 | 
			
		||||
      dispatch(snackbar.success(intl.formatMessage(messages.success)));
 | 
			
		||||
    }).catch((error) => {
 | 
			
		||||
      this.setState({ isLoading: false });
 | 
			
		||||
    });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -111,7 +111,7 @@ class Filters extends ImmutablePureComponent {
 | 
			
		|||
      context.push('thread');
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    dispatch(createFilter(phrase, expires_at, context, whole_word, irreversible)).then(response => {
 | 
			
		||||
    dispatch(createFilter(intl, phrase, expires_at, context, whole_word, irreversible)).then(response => {
 | 
			
		||||
      return dispatch(fetchFilters());
 | 
			
		||||
    }).catch(error => {
 | 
			
		||||
      dispatch(snackbar.error(intl.formatMessage(messages.create_error)));
 | 
			
		||||
| 
						 | 
				
			
			@ -120,7 +120,7 @@ class Filters extends ImmutablePureComponent {
 | 
			
		|||
 | 
			
		||||
  handleFilterDelete = e => {
 | 
			
		||||
    const { intl, dispatch } = this.props;
 | 
			
		||||
    dispatch(deleteFilter(e.currentTarget.dataset.value)).then(response => {
 | 
			
		||||
    dispatch(deleteFilter(intl, e.currentTarget.dataset.value)).then(response => {
 | 
			
		||||
      return dispatch(fetchFilters());
 | 
			
		||||
    }).catch(error => {
 | 
			
		||||
      dispatch(snackbar.error(intl.formatMessage(messages.delete_error)));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -26,13 +26,13 @@ class CSVImporter extends ImmutablePureComponent {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  handleSubmit = (event) => {
 | 
			
		||||
    const { dispatch, action } = this.props;
 | 
			
		||||
    const { dispatch, action, intl } = this.props;
 | 
			
		||||
 | 
			
		||||
    let params = new FormData();
 | 
			
		||||
    params.append('list', this.state.file);
 | 
			
		||||
 | 
			
		||||
    this.setState({ isLoading: true });
 | 
			
		||||
    dispatch(action(params)).then(() => {
 | 
			
		||||
    dispatch(action(intl, params)).then(() => {
 | 
			
		||||
      this.setState({ isLoading: false });
 | 
			
		||||
    }).catch((error) => {
 | 
			
		||||
      this.setState({ isLoading: false });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -52,9 +52,9 @@ class Header extends ImmutablePureComponent {
 | 
			
		|||
  };
 | 
			
		||||
 | 
			
		||||
  handleSubmit = (event) => {
 | 
			
		||||
    const { dispatch } = this.props;
 | 
			
		||||
    const { dispatch, intl } = this.props;
 | 
			
		||||
    const { username, password } = this.getFormData(event.target);
 | 
			
		||||
    dispatch(logIn(username, password)).then(({ access_token }) => {
 | 
			
		||||
    dispatch(logIn(intl, username, password)).then(({ access_token }) => {
 | 
			
		||||
      return dispatch(verifyCredentials(access_token));
 | 
			
		||||
    }).catch(error => {
 | 
			
		||||
      if (error.response.data.error === 'mfa_required') {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -371,7 +371,7 @@ class DeactivateAccount extends ImmutablePureComponent {
 | 
			
		|||
    const { password } = this.state;
 | 
			
		||||
    const { dispatch, intl } = this.props;
 | 
			
		||||
    this.setState({ isLoading: true });
 | 
			
		||||
    return dispatch(deleteAccount(password)).then(() => {
 | 
			
		||||
    return dispatch(deleteAccount(intl, password)).then(() => {
 | 
			
		||||
      //this.setState({ email: '', password: '' }); // TODO: Maybe redirect user
 | 
			
		||||
      dispatch(snackbar.success(intl.formatMessage(messages.deleteAccountSuccess)));
 | 
			
		||||
    }).catch(error => {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -93,9 +93,9 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
 | 
			
		|||
 | 
			
		||||
  onBookmark(status) {
 | 
			
		||||
    if (status.get('bookmarked')) {
 | 
			
		||||
      dispatch(unbookmark(status));
 | 
			
		||||
      dispatch(unbookmark(intl, status));
 | 
			
		||||
    } else {
 | 
			
		||||
      dispatch(bookmark(status));
 | 
			
		||||
      dispatch(bookmark(intl, status));
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -177,9 +177,9 @@ class Status extends ImmutablePureComponent {
 | 
			
		|||
 | 
			
		||||
  handleBookmark = (status) => {
 | 
			
		||||
    if (status.get('bookmarked')) {
 | 
			
		||||
      this.props.dispatch(unbookmark(status));
 | 
			
		||||
      this.props.dispatch(unbookmark(this.props.intl, status));
 | 
			
		||||
    } else {
 | 
			
		||||
      this.props.dispatch(bookmark(status));
 | 
			
		||||
      this.props.dispatch(bookmark(this.props.intl, status));
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,12 +16,12 @@ const mapStateToProps = state => {
 | 
			
		|||
  };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const mapDispatchToProps = (dispatch) => ({
 | 
			
		||||
const mapDispatchToProps = (dispatch, { intl }) => ({
 | 
			
		||||
  onOpenHotkeys() {
 | 
			
		||||
    dispatch(openModal('HOTKEYS'));
 | 
			
		||||
  },
 | 
			
		||||
  onClickLogOut(e) {
 | 
			
		||||
    dispatch(logOut());
 | 
			
		||||
    dispatch(logOut(intl));
 | 
			
		||||
    e.preventDefault();
 | 
			
		||||
  },
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -53,7 +53,7 @@ class ProfileDropdown extends React.PureComponent {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  handleLogOut = e => {
 | 
			
		||||
    this.props.dispatch(logOut());
 | 
			
		||||
    this.props.dispatch(logOut(this.props.intl));
 | 
			
		||||
    e.preventDefault();
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -49,6 +49,8 @@
 | 
			
		|||
  "account.unmute_notifications": "Cofnij wyciszenie powiadomień od @{name}",
 | 
			
		||||
  "account.unsubscribe": "Przestań subskrybować wpisy @{name}",
 | 
			
		||||
  "account_gallery.none": "Brak zawartości multimedialnej do wyświetlenia.",
 | 
			
		||||
  "auth.invalid_credentials": "Nieprawidłowa nazwa użytkownika lub hasło",
 | 
			
		||||
  "auth.logged_out": "Wylogowano.",
 | 
			
		||||
  "admin.awaiting_approval.approved_message": "Przyjęto {acct}!",
 | 
			
		||||
  "admin.awaiting_approval.empty_message": "Nikt nie oczekuje przyjęcia. Gdy zarejestruje się nowy użytkownik, możesz zatwierdzić go tutaj.",
 | 
			
		||||
  "admin.awaiting_approval.rejected_message": "Odrzucono {acct}!",
 | 
			
		||||
| 
						 | 
				
			
			@ -257,6 +259,7 @@
 | 
			
		|||
  "edit_profile.hints.meta_fields": "Możesz mieć maksymalnie {count, plural, one {# element} few {# elemeny} many {# elementów} other {# elementy}} wyświetlane w formie tabeli na swoim profilu",
 | 
			
		||||
  "edit_profile.hints.stranger_notifications": "Wyświetlaj tylko powiadomienia od osób, które obserwujesz",
 | 
			
		||||
  "edit_profile.save": "Zapisz",
 | 
			
		||||
  "edit_profile.success": "Zapisano profil!",
 | 
			
		||||
  "embed.instructions": "Osadź ten wpis na swojej stronie wklejając poniższy kod.",
 | 
			
		||||
  "embed.preview": "Tak będzie to wyglądać:",
 | 
			
		||||
  "emoji_button.activity": "Aktywność",
 | 
			
		||||
| 
						 | 
				
			
			@ -306,6 +309,8 @@
 | 
			
		|||
  "filters.filters_list_hide": "Ukrywaj",
 | 
			
		||||
  "filters.filters_list_phrase_label": "Słowo kluczowe lub fraza:",
 | 
			
		||||
  "filters.filters_list_whole-word": "Całe słowo",
 | 
			
		||||
  "filters.added": "Dodano filtr.",
 | 
			
		||||
  "filters.deleted": "Usunięto filtr.",
 | 
			
		||||
  "follow_request.authorize": "Autoryzuj",
 | 
			
		||||
  "follow_request.reject": "Odrzuć",
 | 
			
		||||
  "forms.copy": "Kopiuj",
 | 
			
		||||
| 
						 | 
				
			
			@ -354,6 +359,9 @@
 | 
			
		|||
  "import_data.hints.follows": "Plik CSV zawierający listę obserwowanych kont",
 | 
			
		||||
  "import_data.hints.mutes": "Plik CSV zawierający listę wyciszonych kont",
 | 
			
		||||
  "import_data.mutes_label": "Wyciszenia",
 | 
			
		||||
  "import_data.success.blocks": "Pomyślnie zaimportowano zablokowane konta",
 | 
			
		||||
  "import_data.success.followers": "Pomyślnie zaimportowano obserwowane konta",
 | 
			
		||||
  "import_data.success.mutes": "Pomyślnie zaimportowano wyciszone konta",
 | 
			
		||||
  "intervals.full.days": "{number, plural, one {# dzień} few {# dni} many {# dni} other {# dni}}",
 | 
			
		||||
  "intervals.full.hours": "{number, plural, one {# godzina} few {# godziny} many {# godzin} other {# godzin}}",
 | 
			
		||||
  "intervals.full.minutes": "{number, plural, one {# minuta} few {# minuty} many {# minut} other {# minut}}",
 | 
			
		||||
| 
						 | 
				
			
			@ -487,6 +495,9 @@
 | 
			
		|||
  "notifications.filter.polls": "Wyniki głosowania",
 | 
			
		||||
  "notifications.group": "{count, number} {count, plural, one {powiadomienie} few {powiadomienia} many {powiadomień} more {powiadomień}}",
 | 
			
		||||
  "notifications.queue_label": "Naciśnij aby zobaczyć {count} {count, plural, one {nowe powiadomienie} few {nowe powiadomienia} many {nowych powiadomień} other {nowe powiadomienia}}",
 | 
			
		||||
  "password_reset.confirmation": "Sprawdź swoją pocztę e-mail, aby potwierdzić.",
 | 
			
		||||
  "password_reset.fields.username_placeholder": "Adres e-mail lub nazwa użytkownika",
 | 
			
		||||
  "password_reset.reset": "Resetuj hasło",
 | 
			
		||||
  "pinned_statuses.none": "Brak przypięć do pokazania.",
 | 
			
		||||
  "poll.closed": "Zamknięte",
 | 
			
		||||
  "poll.refresh": "Odśwież",
 | 
			
		||||
| 
						 | 
				
			
			@ -646,6 +657,7 @@
 | 
			
		|||
  "status.admin_status": "Otwórz ten wpis w interfejsie moderacyjnym",
 | 
			
		||||
  "status.block": "Zablokuj @{name}",
 | 
			
		||||
  "status.bookmark": "Dodaj do zakładek",
 | 
			
		||||
  "status.bookmarked": "Dodano do zakładek.",
 | 
			
		||||
  "status.cancel_reblog_private": "Cofnij podbicie",
 | 
			
		||||
  "status.cannot_reblog": "Ten wpis nie może zostać podbity",
 | 
			
		||||
  "status.copy": "Skopiuj odnośnik do wpisu",
 | 
			
		||||
| 
						 | 
				
			
			@ -683,6 +695,7 @@
 | 
			
		|||
  "status.show_more_all": "Rozwiń wszystkie",
 | 
			
		||||
  "status.show_thread": "Pokaż wątek",
 | 
			
		||||
  "status.unbookmark": "Usuń z zakładek",
 | 
			
		||||
  "status.unbookmarked": "Usunięto z zakładek.",
 | 
			
		||||
  "status.unmute_conversation": "Cofnij wyciszenie konwersacji",
 | 
			
		||||
  "status.unpin": "Odepnij z profilu",
 | 
			
		||||
  "status_list.queue_label": "Naciśnij aby zobaczyć {count} {count, plural, one {nowy wpis} few {nowe wpisy} many {nowych wpisów} other {nowe wpisy}}",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue