<commit_before>import React, {Component} from 'react';
import { injectIntl, defineMessages } from 'react-intl';
import { NonIdealState } from '@blueprintjs/core';

import Screen from 'src/components/common/Screen';
import DualPane from 'src/components/common/DualPane';

import './ErrorScreen.css';

const messages = defineMessages({
  no_path: {
    id: 'error.screen.no_path',
    defaultMessage: 'This path is not valid!'
  }
});

class EmptyList extends Component {
  render() {
    const {title, intl} = this.props;
    let visual = this.props.visual !== undefined ? this.props.visual : 'error';
    let description = this.props.description !== undefined ? this.props.description
      : {id: 'error_desc', defaultMessage: ' '};

    return (
      <div className='outer-div'>
        <div className='inner-div'>
          <NonIdealState
            visual={visual}
            title={intl.formatMessage(title)}
            description={intl.formatMessage(description)}
          />
        </div>
      </div>
    )
  }
}

class PageNotFound extends Component {
  render() {
    const {intl, title} = this.props;
    let visual = this.props.visual !== undefined ? this.props.visual : 'error';
    let description = this.props.description !== undefined ? this.props.description
      : {id: 'error_desc', defaultMessage: ' '};
    return (
      <Screen>
        <DualPane>
          <DualPane.ContentPane>
            <NonIdealState
              visual={visual}
              title={title !== undefined ? intl.formatMessage(title) : intl.formatMessage(messages.no_path)}
              description={intl.formatMessage(description)}
            />
          </DualPane.ContentPane>
        </DualPane>
      </Screen>
    )
  }
}

class ErrorScreenNoTranslation extends Component {
    render() {
        const {title} = this.props;

        return (
            <Screen>
                <DualPane>
                    <DualPane.ContentPane>
                        <NonIdealState visual='error'
                                       title={title}
                        />
                    </DualPane.ContentPane>
                </DualPane>
            </Screen>
        )
    }
}

class ErrorScreen extends Component {
  static PageNotFound = injectIntl(PageNotFound);
  static EmptyList = injectIntl(EmptyList);
  static NoTranslation = ErrorScreenNoTranslation;
}

export default ErrorScreen;<commit_msg>Remove redundant localisation from error messages, fixes #398.<commit_after>import React, {Component} from 'react';
import { injectIntl, defineMessages } from 'react-intl';
import { NonIdealState } from '@blueprintjs/core';

import Screen from 'src/components/common/Screen';
import DualPane from 'src/components/common/DualPane';

import './ErrorScreen.css';

const messages = defineMessages({
  no_path: {
    id: 'error.screen.no_path',
    defaultMessage: 'The requested page could not be found.'
  }
});

class EmptyList extends Component {
  render() {
    const { title, description = '', visual = 'error' } = this.props;
    
    return (
      <div className='outer-div'>
        <div className='inner-div'>
          <NonIdealState visual={visual} title={title} description={description} />
        </div>
      </div>
    )
  }
}

class PageNotFound extends Component {
  render() {
    const {intl, title, description = '', visual = 'error' } = this.props;
    const message = title !== undefined ? title : intl.formatMessage(messages.no_path);
    
    return (
      <Screen>
        <DualPane>
          <DualPane.ContentPane>
            <NonIdealState visual={visual} title={message} description={description} />
          </DualPane.ContentPane>
        </DualPane>
      </Screen>
    )
  }
}

class ErrorScreenNoTranslation extends Component {
    render() {
        const { title } = this.props;

        return (
            <Screen>
                <DualPane>
                    <DualPane.ContentPane>
                        <NonIdealState visual='error' title={title} />
                    </DualPane.ContentPane>
                </DualPane>
            </Screen>
        )
    }
}

class ErrorScreen extends Component {
  static PageNotFound = injectIntl(PageNotFound);
  static EmptyList = injectIntl(EmptyList);
  static NoTranslation = ErrorScreenNoTranslation;
}

export default ErrorScreen;
{'fraction_non_alphanumeric': 0.11837862736066329, 'fraction_numerical': 0.0006909258406264394, 'mean_word_length': 2.3459167950693374, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '818147', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1187, 'n_words': 270}