diff options
| -rw-r--r-- | app/assets/javascripts/es6_browserified/time_tables/components/ErrorModal.js | 8 | ||||
| -rw-r--r-- | app/views/time_tables/edit.html.slim | 3 | ||||
| -rw-r--r-- | config/locales/time_tables.en.yml | 4 | ||||
| -rw-r--r-- | config/locales/time_tables.fr.yml | 4 | 
4 files changed, 12 insertions, 7 deletions
| diff --git a/app/assets/javascripts/es6_browserified/time_tables/components/ErrorModal.js b/app/assets/javascripts/es6_browserified/time_tables/components/ErrorModal.js index bc85d8cd6..5f178d3c2 100644 --- a/app/assets/javascripts/es6_browserified/time_tables/components/ErrorModal.js +++ b/app/assets/javascripts/es6_browserified/time_tables/components/ErrorModal.js @@ -2,21 +2,17 @@ var React = require('react')  var Component = require('react').Component  var PropTypes = require('react').PropTypes -const withoutPeriodsWithDaysTypes = "Un calendrier d'application ne peut pas avoir de journée(s) d'application sans période(s)." -const withPeriodsWithoutDayTypes = "Un calendrier d'application ne peut pas avoir de période(s) sans journée(s) d'application." - -  const ErrorModal = ({dispatch, modal, onModalClose}) => (    <div className={ 'modal fade ' + ((modal.type == 'error') ? 'in' : '') } id='ErrorModal'>      <div className='modal-container'>        <div className='modal-dialog'>          <div className='modal-content'>            <div className='modal-header'> -            <h4 className='modal-title'>Erreur</h4> +            <h4 className='modal-title'>{window.I18n.fr.time_tables.edit.error_modal.title}</h4>            </div>            <div className='modal-body'>              <div className='mt-md mb-md'> -              <p>{(modal.modalProps.error == "withoutPeriodsWithDaysTypes") ? withoutPeriodsWithDaysTypes : withPeriodsWithoutDayTypes}</p> +              <p>{(modal.modalProps.error == "withoutPeriodsWithDaysTypes") ? window.I18n.fr.time_tables.edit.error_modal.withoutPeriodsWithDaysTypes : window.I18n.fr.time_tables.edit.error_modal.withPeriodsWithoutDayTypes}</p>              </div>            </div>            <div className='modal-footer'> diff --git a/app/views/time_tables/edit.html.slim b/app/views/time_tables/edit.html.slim index f129cd63a..a2dfb90f9 100644 --- a/app/views/time_tables/edit.html.slim +++ b/app/views/time_tables/edit.html.slim @@ -10,6 +10,7 @@      #periods  = javascript_tag do -  | window.actionType = "#{raw params[:action]}" +  | window.actionType = "#{raw params[:action]}"; +  | window.I18n = #{(I18n.backend.send(:translations).to_json).html_safe};  = javascript_include_tag 'es6_browserified/time_tables/index.js' diff --git a/config/locales/time_tables.en.yml b/config/locales/time_tables.en.yml index ed2f9758e..d67e30edb 100644 --- a/config/locales/time_tables.en.yml +++ b/config/locales/time_tables.en.yml @@ -29,6 +29,10 @@ en:        title: "Duplicate timetable"      edit:        title: "Update timetable %{time_table}" +      error_modal: +        title: "Error" +        withoutPeriodsWithDaysTypes: "A timetable can't have day type(s) without period(s)." +        withPeriodsWithoutDayTypes: "A tiemetable can't have period(s) swithout day type(s)."        show:        title: "Timetable %{time_table}"        dates: "Application dates" diff --git a/config/locales/time_tables.fr.yml b/config/locales/time_tables.fr.yml index cf6888d0f..06d1d59e8 100644 --- a/config/locales/time_tables.fr.yml +++ b/config/locales/time_tables.fr.yml @@ -29,6 +29,10 @@ fr:        title: "Dupliquer un calendrier"      edit:        title: "Editer le calendrier %{time_table}" +      error_modal: +        title: "Erreur" +        withoutPeriodsWithDaysTypes: "Un calendrier d'application ne peut pas avoir de journée(s) d'application sans période(s)." +        withPeriodsWithoutDayTypes: "Un calendrier d'application ne peut pas avoir de période(s) sans journée(s) d'application."        show:        title: Calendrier %{time_table}        dates: "Dates d'application" | 
