From eb51cf0aa62a96c552c1a32778aa84e64df458a6 Mon Sep 17 00:00:00 2001
From: cedricnjanga
Date: Thu, 12 Apr 2018 06:33:32 -0700
Subject: Refs #6376 Add some english translations
---
app/javascript/routes/components/App.js | 9 -------
app/javascript/routes/components/BSelect2.js | 12 +++------
app/javascript/routes/components/OlMap.js | 30 ++++++++++------------
app/javascript/routes/components/StopPoint.js | 6 +----
app/javascript/routes/components/StopPointList.js | 2 +-
app/javascript/routes/containers/AddStopPoint.js | 2 +-
.../vehicle_journeys/components/Filters.js | 1 +
.../components/tools/NotesEditVehicleJourney.js | 4 +--
.../tools/PurchaseWindowsEditVehicleJourney.js | 3 ++-
.../tools/TimetablesEditVehicleJourney.js | 1 +
.../components/tools/select2s/TimetableSelect2.js | 2 +-
config/locales/actions.en.yml | 3 ++-
config/locales/actions.fr.yml | 3 ++-
config/locales/routes.en.yml | 4 +--
config/locales/stop_areas.en.yml | 4 +--
config/locales/stop_points.en.yml | 6 ++---
config/locales/vehicle_journeys.en.yml | 2 ++
config/locales/vehicle_journeys.fr.yml | 1 +
18 files changed, 41 insertions(+), 54 deletions(-)
diff --git a/app/javascript/routes/components/App.js b/app/javascript/routes/components/App.js
index 26e69bf53..6f8cdf749 100644
--- a/app/javascript/routes/components/App.js
+++ b/app/javascript/routes/components/App.js
@@ -3,14 +3,9 @@ import PropTypes from 'prop-types'
import AddStopPoint from '../containers/AddStopPoint'
import VisibleStopPoints from'../containers/VisibleStopPoints'
import clone from '../../helpers/clone'
-const I18n = clone(window , "I18n", true)
export default class App extends Component {
- getChildContext() {
- return { I18n }
- }
-
render() {
return (
@@ -20,7 +15,3 @@ export default class App extends Component {
)
}
}
-
-App.childContextTypes = {
- I18n: PropTypes.object
-}
diff --git a/app/javascript/routes/components/BSelect2.js b/app/javascript/routes/components/BSelect2.js
index 89e1b6cfa..90f288944 100644
--- a/app/javascript/routes/components/BSelect2.js
+++ b/app/javascript/routes/components/BSelect2.js
@@ -10,8 +10,8 @@ var path = window.location.pathname.split('/', 3).join('/')
export default class BSelect3 extends Component {
- constructor(props, context) {
- super(props, context)
+ constructor(props) {
+ super(props)
}
onChange(e) {
this.props.onChange(this.props.index, {
@@ -86,7 +86,7 @@ class BSelect2 extends Component{
onSelect={ this.props.onSelect }
ref='newSelect'
options={{
- placeholder: this.context.I18n.t("routes.edit.select2.placeholder"),
+ placeholder: I18n.t("routes.edit.select2.placeholder"),
allowClear: true,
language: 'fr', /* Doesn't seem to work... :( */
theme: 'bootstrap',
@@ -129,8 +129,4 @@ class BSelect2 extends Component{
/>
)
}
-}
-
-BSelect2.contextTypes = {
- I18n: PropTypes.object
-}
+}
\ No newline at end of file
diff --git a/app/javascript/routes/components/OlMap.js b/app/javascript/routes/components/OlMap.js
index 4beb02872..16fec0e87 100644
--- a/app/javascript/routes/components/OlMap.js
+++ b/app/javascript/routes/components/OlMap.js
@@ -3,8 +3,8 @@ import React, { Component } from 'react'
import PropTypes from 'prop-types'
export default class OlMap extends Component{
- constructor(props, context){
- super(props, context)
+ constructor(props){
+ super(props)
}
fetchApiURL(id){
@@ -115,40 +115,40 @@ export default class OlMap extends Component{
{this.props.value.olMap.json.name}
- {this.context.I18n.t('routes.edit.map.stop_point_type')} :
+ {I18n.t('routes.edit.map.stop_point_type')} :
{this.props.value.olMap.json.area_type}
- {this.context.I18n.t('routes.edit.map.short_name')} :
+ {I18n.t('routes.edit.map.short_name')} :
{this.props.value.olMap.json.short_name}
- {this.context.I18n.t('id_reflex')} :
+ {I18n.t('id_reflex')} :
{this.props.value.olMap.json.user_objectid}
-
{this.context.I18n.t('routes.edit.map.coordinates')} :
+
{I18n.t('routes.edit.map.coordinates')} :
- {this.context.I18n.t('routes.edit.map.proj')}.: WSG84
- {this.context.I18n.t('routes.edit.map.lat')}.: {this.props.value.olMap.json.latitude}
- {this.context.I18n.t('routes.edit.map.lon')}.: {this.props.value.olMap.json.longitude}
+ {I18n.t('routes.edit.map.proj')}.: WSG84
+ {I18n.t('routes.edit.map.lat')}.: {this.props.value.olMap.json.latitude}
+ {I18n.t('routes.edit.map.lon')}.: {this.props.value.olMap.json.longitude}
- {this.context.I18n.t('routes.edit.map.postal_code')} :
+ {I18n.t('routes.edit.map.postal_code')} :
{this.props.value.olMap.json.zip_code}
- {this.context.I18n.t('routes.edit.map.city')} :
+ {I18n.t('routes.edit.map.city')} :
{this.props.value.olMap.json.city_name}
- {this.context.I18n.t('routes.edit.map.comment')} :
+ {I18n.t('routes.edit.map.comment')} :
{this.props.value.olMap.json.comment}
{(this.props.value.stoparea_id != this.props.value.olMap.json.stoparea_id) &&(
{this.props.onUpdateViaOlMap(this.props.index, this.props.value.olMap.json)}}
- >{this.context.I18n.t('actions.select')}
+ >{I18n.t('actions.select')}
)}
@@ -164,7 +164,3 @@ export default class OlMap extends Component{
OlMap.propTypes = {
}
-
-OlMap.contextTypes = {
- I18n: PropTypes.object
-}
diff --git a/app/javascript/routes/components/StopPoint.js b/app/javascript/routes/components/StopPoint.js
index 908e97263..916052b42 100644
--- a/app/javascript/routes/components/StopPoint.js
+++ b/app/javascript/routes/components/StopPoint.js
@@ -6,7 +6,7 @@ import OlMap from './OlMap'
import { defaultAttribute } from '../actions'
-export default function StopPoint(props, {I18n}) {
+export default function StopPoint(props) {
return (
@@ -92,7 +92,3 @@ StopPoint.propTypes = {
index: PropTypes.number,
value: PropTypes.object
}
-
-StopPoint.contextTypes = {
- I18n: PropTypes.object
-}
diff --git a/app/javascript/routes/components/StopPointList.js b/app/javascript/routes/components/StopPointList.js
index b227abdea..9bc5e02d1 100644
--- a/app/javascript/routes/components/StopPointList.js
+++ b/app/javascript/routes/components/StopPointList.js
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
import StopPoint from './StopPoint'
-export default function StopPointList({ stopPoints, onDeleteClick, onMoveUpClick, onMoveDownClick, onChange, onSelectChange, onToggleMap, onToggleEdit, onSelectMarker, onUnselectMarker, onUpdateViaOlMap }, {I18n}) {
+export default function StopPointList({ stopPoints, onDeleteClick, onMoveUpClick, onMoveDownClick, onChange, onSelectChange, onToggleMap, onToggleEdit, onSelectMarker, onUnselectMarker, onUpdateViaOlMap }) {
return (
diff --git a/app/javascript/routes/containers/AddStopPoint.js b/app/javascript/routes/containers/AddStopPoint.js
index fd9227ff3..4b169807d 100644
--- a/app/javascript/routes/containers/AddStopPoint.js
+++ b/app/javascript/routes/containers/AddStopPoint.js
@@ -11,7 +11,7 @@ let AddStopPoint = ({ dispatch }) => {
dispatch(actions.addStop())
}}>
diff --git a/app/javascript/vehicle_journeys/components/Filters.js b/app/javascript/vehicle_journeys/components/Filters.js
index 93fe015a8..1e43a490e 100644
--- a/app/javascript/vehicle_journeys/components/Filters.js
+++ b/app/javascript/vehicle_journeys/components/Filters.js
@@ -33,6 +33,7 @@ export default function Filters({filters, pagination, missions, onFilter, onRese
{/* Calendriers */}
this.props.onToggleFootnoteModal(lf, false)}
- > Retirer
+ >{I18n.t('actions.remove')}
} else {
return
+ >{I18n.t('actions.add')}
}
}
diff --git a/app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js b/app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js
index 30c511302..5fc925f4c 100644
--- a/app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js
+++ b/app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js
@@ -44,7 +44,7 @@ export default class PurchaseWindowsEditVehicleJourney extends Component {
-
{I18n.t('vehicle_journeys.form.purchase_windows')}s
+ {I18n.t('vehicle_journeys.form.purchase_windows')}
×
@@ -95,6 +95,7 @@ export default class PurchaseWindowsEditVehicleJourney extends Component {