From 0cbf06884dd2b82319044ac4ad9e792401111eca Mon Sep 17 00:00:00 2001 From: cedricnjanga Date: Thu, 5 Apr 2018 06:18:57 -0700 Subject: Refs #6424 Clean timetable i18n --- app/javascript/time_tables/components/ConfirmModal.js | 8 ++------ app/javascript/time_tables/components/ErrorModal.js | 8 ++------ app/javascript/time_tables/components/Metas.js | 8 ++------ app/javascript/time_tables/components/PeriodForm.js | 8 ++------ app/javascript/time_tables/components/PeriodManager.js | 8 ++------ app/javascript/time_tables/components/TagsSelect2.js | 6 +----- app/javascript/time_tables/components/Timetable.js | 14 +++++--------- 7 files changed, 16 insertions(+), 44 deletions(-) (limited to 'app/javascript/time_tables') diff --git a/app/javascript/time_tables/components/ConfirmModal.js b/app/javascript/time_tables/components/ConfirmModal.js index 4e8583bc0..e4219348d 100644 --- a/app/javascript/time_tables/components/ConfirmModal.js +++ b/app/javascript/time_tables/components/ConfirmModal.js @@ -2,7 +2,7 @@ import React from 'react' import PropTypes from 'prop-types' -export default function ConfirmModal({dispatch, modal, onModalAccept, onModalCancel, timetable, metas}, {I18n}) { +export default function ConfirmModal({dispatch, modal, onModalAccept, onModalCancel, timetable, metas}) { return (
@@ -45,8 +45,4 @@ ConfirmModal.propTypes = { modal: PropTypes.object.isRequired, onModalAccept: PropTypes.func.isRequired, onModalCancel: PropTypes.func.isRequired -} - -ConfirmModal.contextTypes = { - I18n: PropTypes.object -} +} \ No newline at end of file diff --git a/app/javascript/time_tables/components/ErrorModal.js b/app/javascript/time_tables/components/ErrorModal.js index 8af12f1d1..a512d28fd 100644 --- a/app/javascript/time_tables/components/ErrorModal.js +++ b/app/javascript/time_tables/components/ErrorModal.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import actions from '../actions' -export default function ErrorModal({dispatch, modal, onModalClose}, {I18n}) { +export default function ErrorModal({dispatch, modal, onModalClose}) { return (
@@ -37,8 +37,4 @@ export default function ErrorModal({dispatch, modal, onModalClose}, {I18n}) { ErrorModal.propTypes = { modal: PropTypes.object.isRequired, onModalClose: PropTypes.func.isRequired -} - -ErrorModal.contextTypes = { - I18n: PropTypes.object -} +} \ No newline at end of file diff --git a/app/javascript/time_tables/components/Metas.js b/app/javascript/time_tables/components/Metas.js index 08a6e26fe..d9746a379 100644 --- a/app/javascript/time_tables/components/Metas.js +++ b/app/javascript/time_tables/components/Metas.js @@ -4,7 +4,7 @@ import PropTypes from 'prop-types' import actions from '../actions' import TagsSelect2 from './TagsSelect2' -export default function Metas({metas, onUpdateDayTypes, onUpdateComment, onUpdateColor, onSelect2Tags, onUnselect2Tags}, {I18n}) { +export default function Metas({metas, onUpdateDayTypes, onUpdateComment, onUpdateColor, onSelect2Tags, onUnselect2Tags}) { let colorList = ["", "#9B9B9B", "#FFA070", "#C67300", "#7F551B", "#41CCE3", "#09B09C", "#3655D7", "#6321A0", "#E796C6", "#DD2DAA"] return (
@@ -134,8 +134,4 @@ Metas.propTypes = { onUpdateColor: PropTypes.func.isRequired, onSelect2Tags: PropTypes.func.isRequired, onUnselect2Tags: PropTypes.func.isRequired -} - -Metas.contextTypes = { - I18n: PropTypes.object -} +} \ No newline at end of file diff --git a/app/javascript/time_tables/components/PeriodForm.js b/app/javascript/time_tables/components/PeriodForm.js index d17a246f7..36ed6cfdf 100644 --- a/app/javascript/time_tables/components/PeriodForm.js +++ b/app/javascript/time_tables/components/PeriodForm.js @@ -33,7 +33,7 @@ const makeYearsOptions = (yearSelected) => { return arr } -export default function PeriodForm({modal, timetable, metas, onOpenAddPeriodForm, onClosePeriodForm, onUpdatePeriodForm, onValidatePeriodForm}, {I18n}) { +export default function PeriodForm({modal, timetable, metas, onOpenAddPeriodForm, onClosePeriodForm, onUpdatePeriodForm, onValidatePeriodForm}) { return (
@@ -143,8 +143,4 @@ PeriodForm.propTypes = { onUpdatePeriodForm: PropTypes.func.isRequired, onValidatePeriodForm: PropTypes.func.isRequired, timetable: PropTypes.object.isRequired -} - -PeriodForm.contextTypes = { - I18n: PropTypes.object -} +} \ No newline at end of file diff --git a/app/javascript/time_tables/components/PeriodManager.js b/app/javascript/time_tables/components/PeriodManager.js index 6b817fe73..6871d0b9b 100644 --- a/app/javascript/time_tables/components/PeriodManager.js +++ b/app/javascript/time_tables/components/PeriodManager.js @@ -55,7 +55,7 @@ export default class PeriodManager extends Component { type='button' onClick={() => this.props.onOpenEditPeriodForm(this.props.value, this.props.index)} > - Modifier + {I18n.t('actions.edit')}
  • @@ -64,7 +64,7 @@ export default class PeriodManager extends Component { onClick={() => this.props.onDeletePeriod(this.props.index, this.props.metas.day_types)} > - Supprimer + {I18n.t('actions.destroy')}
  • @@ -79,8 +79,4 @@ PeriodManager.propTypes = { currentDate: PropTypes.object.isRequired, onDeletePeriod: PropTypes.func.isRequired, onOpenEditPeriodForm: PropTypes.func.isRequired -} - -PeriodManager.contextTypes = { - I18n: PropTypes.object } \ No newline at end of file diff --git a/app/javascript/time_tables/components/TagsSelect2.js b/app/javascript/time_tables/components/TagsSelect2.js index 43cf59fdf..dd8d6e9c0 100644 --- a/app/javascript/time_tables/components/TagsSelect2.js +++ b/app/javascript/time_tables/components/TagsSelect2.js @@ -40,7 +40,7 @@ export default class TagsSelect2 extends Component { allowClear: true, theme: 'bootstrap', width: '100%', - placeholder: this.context.I18n.t('time_tables.edit.select2.tag.placeholder'), + placeholder: I18n.t('time_tables.edit.select2.tag.placeholder'), ajax: { url: origin + path + '/tags.json', dataType: 'json', @@ -74,8 +74,4 @@ export default class TagsSelect2 extends Component { const formatRepo = (props) => { if(props.name) return props.name -} - -TagsSelect2.contextTypes = { - I18n: PropTypes.object } \ No newline at end of file diff --git a/app/javascript/time_tables/components/Timetable.js b/app/javascript/time_tables/components/Timetable.js index 991f31435..3779fa2d0 100644 --- a/app/javascript/time_tables/components/Timetable.js +++ b/app/javascript/time_tables/components/Timetable.js @@ -31,11 +31,11 @@ export default class Timetable extends Component {
    -
    {this.context.I18n.t('time_tables.edit.synthesis')}
    +
    {I18n.t('time_tables.edit.synthesis')}
    -
    {this.context.I18n.t('time_tables.edit.day_types')}
    -
    {this.context.I18n.t('time_tables.edit.periods')}
    -
    {this.context.I18n.t('time_tables.edit.exceptions')}
    +
    {I18n.t('time_tables.edit.day_types')}
    +
    {I18n.t('time_tables.edit.periods')}
    +
    {I18n.t('time_tables.edit.exceptions')}
    @@ -109,8 +109,4 @@ Timetable.propTypes = { onDeletePeriod: PropTypes.func.isRequired, onExcludeDateFromPeriod: PropTypes.func.isRequired, onIncludeDateInPeriod: PropTypes.func.isRequired -} - -Timetable.contextTypes = { - I18n: PropTypes.object -} +} \ No newline at end of file -- cgit v1.2.3