aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcedricnjanga2018-04-12 06:33:32 -0700
committerJohan Van Ryseghem2018-04-24 11:08:36 +0200
commiteb51cf0aa62a96c552c1a32778aa84e64df458a6 (patch)
tree92cc8cf466007b2ec78f293a25508666e510fe92
parentd85ec520859aae6a5bdc25ac1f11e00ded5f6266 (diff)
downloadchouette-core-eb51cf0aa62a96c552c1a32778aa84e64df458a6.tar.bz2
Refs #6376 Add some english translations
-rw-r--r--app/javascript/routes/components/App.js9
-rw-r--r--app/javascript/routes/components/BSelect2.js12
-rw-r--r--app/javascript/routes/components/OlMap.js30
-rw-r--r--app/javascript/routes/components/StopPoint.js6
-rw-r--r--app/javascript/routes/components/StopPointList.js2
-rw-r--r--app/javascript/routes/containers/AddStopPoint.js2
-rw-r--r--app/javascript/vehicle_journeys/components/Filters.js1
-rw-r--r--app/javascript/vehicle_journeys/components/tools/NotesEditVehicleJourney.js4
-rw-r--r--app/javascript/vehicle_journeys/components/tools/PurchaseWindowsEditVehicleJourney.js3
-rw-r--r--app/javascript/vehicle_journeys/components/tools/TimetablesEditVehicleJourney.js1
-rw-r--r--app/javascript/vehicle_journeys/components/tools/select2s/TimetableSelect2.js2
-rw-r--r--config/locales/actions.en.yml3
-rw-r--r--config/locales/actions.fr.yml3
-rw-r--r--config/locales/routes.en.yml4
-rw-r--r--config/locales/stop_areas.en.yml4
-rw-r--r--config/locales/stop_points.en.yml6
-rw-r--r--config/locales/vehicle_journeys.en.yml2
-rw-r--r--config/locales/vehicle_journeys.fr.yml1
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 (
<div>
@@ -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{
<strong>{this.props.value.olMap.json.name}</strong>
</p>
<p>
- <strong>{this.context.I18n.t('routes.edit.map.stop_point_type')} : </strong>
+ <strong>{I18n.t('routes.edit.map.stop_point_type')} : </strong>
{this.props.value.olMap.json.area_type}
</p>
<p>
- <strong>{this.context.I18n.t('routes.edit.map.short_name')} : </strong>
+ <strong>{I18n.t('routes.edit.map.short_name')} : </strong>
{this.props.value.olMap.json.short_name}
</p>
<p>
- <strong>{this.context.I18n.t('id_reflex')} : </strong>
+ <strong>{I18n.t('id_reflex')} : </strong>
{this.props.value.olMap.json.user_objectid}
</p>
- <p><strong>{this.context.I18n.t('routes.edit.map.coordinates')} : </strong></p>
+ <p><strong>{I18n.t('routes.edit.map.coordinates')} : </strong></p>
<p style={{paddingLeft: 10, marginTop: 0}}>
- <em>{this.context.I18n.t('routes.edit.map.proj')}.: </em>WSG84<br/>
- <em>{this.context.I18n.t('routes.edit.map.lat')}.: </em>{this.props.value.olMap.json.latitude} <br/>
- <em>{this.context.I18n.t('routes.edit.map.lon')}.: </em>{this.props.value.olMap.json.longitude}
+ <em>{I18n.t('routes.edit.map.proj')}.: </em>WSG84<br/>
+ <em>{I18n.t('routes.edit.map.lat')}.: </em>{this.props.value.olMap.json.latitude} <br/>
+ <em>{I18n.t('routes.edit.map.lon')}.: </em>{this.props.value.olMap.json.longitude}
</p>
<p>
- <strong>{this.context.I18n.t('routes.edit.map.postal_code')} : </strong>
+ <strong>{I18n.t('routes.edit.map.postal_code')} : </strong>
{this.props.value.olMap.json.zip_code}
</p>
<p>
- <strong>{this.context.I18n.t('routes.edit.map.city')} : </strong>
+ <strong>{I18n.t('routes.edit.map.city')} : </strong>
{this.props.value.olMap.json.city_name}
</p>
<p>
- <strong>{this.context.I18n.t('routes.edit.map.comment')} : </strong>
+ <strong>{I18n.t('routes.edit.map.comment')} : </strong>
{this.props.value.olMap.json.comment}
</p>
{(this.props.value.stoparea_id != this.props.value.olMap.json.stoparea_id) &&(
<div className='btn btn-outline-primary btn-sm'
onClick= {() => {this.props.onUpdateViaOlMap(this.props.index, this.props.value.olMap.json)}}
- >{this.context.I18n.t('actions.select')}</div>
+ >{I18n.t('actions.select')}</div>
)}
</div>
<div className='map_content'>
@@ -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 (
<div className='nested-fields'>
<div className='wrapper'>
@@ -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 (
<div className='subform'>
<div className='nested-head'>
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())
}}>
<button type="submit" className="btn btn-outline-primary">
- Ajouter un arrêt
+ {I18n.t('stop_areas.actions.new')}
</button>
</form>
</div>
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 */}
<div className='form-group w33'>
<TimetableSelect2
+ placeholder={I18n.t('vehicle_journeys.vehicle_journeys_matrix.filters.timetable')}
onSelect2Timetable={onSelect2Timetable}
hasRoute={true}
chunkURL={("/autocomplete_time_tables.json?route_id=" + String(window.route_id))}
diff --git a/app/javascript/vehicle_journeys/components/tools/NotesEditVehicleJourney.js b/app/javascript/vehicle_journeys/components/tools/NotesEditVehicleJourney.js
index 5d300f70c..ef58916f4 100644
--- a/app/javascript/vehicle_journeys/components/tools/NotesEditVehicleJourney.js
+++ b/app/javascript/vehicle_journeys/components/tools/NotesEditVehicleJourney.js
@@ -31,13 +31,13 @@ export default class NotesEditVehicleJourney extends Component {
type='button'
className='btn btn-outline-danger btn-xs'
onClick={() => this.props.onToggleFootnoteModal(lf, false)}
- ><span className="fa fa-trash"></span> Retirer</button>
+ ><span className="fa fa-trash"></span>{I18n.t('actions.remove')}</button>
} else {
return <button
type='button'
className='btn btn-outline-primary btn-xs'
onClick={() => this.props.onToggleFootnoteModal(lf, true)}
- ><span className="fa fa-plus"></span> Ajouter</button>
+ ><span className="fa fa-plus"></span>{I18n.t('actions.add')}</button>
}
}
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 {
<div className='modal-dialog'>
<div className='modal-content'>
<div className='modal-header'>
- <h4 className='modal-title'>{I18n.t('vehicle_journeys.form.purchase_windows')}s</h4>
+ <h4 className='modal-title'>{I18n.t('vehicle_journeys.form.purchase_windows')}</h4>
<span type="button" className="close modal-close" data-dismiss="modal">&times;</span>
</div>
@@ -95,6 +95,7 @@ export default class PurchaseWindowsEditVehicleJourney extends Component {
<div className='wrapper'>
<div>
<TimetableSelect2
+ placeholder={I18n.t('vehicle_journeys.vehicle_journeys_matrix.filters.purchase_window')}
onSelect2Timetable={this.props.onSelect2Timetable}
chunkURL={'/autocomplete_purchase_windows.json'}
searchKey={"name_or_objectid_cont_any"}
diff --git a/app/javascript/vehicle_journeys/components/tools/TimetablesEditVehicleJourney.js b/app/javascript/vehicle_journeys/components/tools/TimetablesEditVehicleJourney.js
index 9ee2e1849..594140c76 100644
--- a/app/javascript/vehicle_journeys/components/tools/TimetablesEditVehicleJourney.js
+++ b/app/javascript/vehicle_journeys/components/tools/TimetablesEditVehicleJourney.js
@@ -97,6 +97,7 @@ export default class TimetablesEditVehicleJourney extends Component {
<div className='wrapper'>
<div>
<TimetableSelect2
+ placeholder={I18n.t('vehicle_journeys.vehicle_journeys_matrix.filters.timetable')}
onSelect2Timetable={this.props.onSelect2Timetable}
chunkURL={'/autocomplete_time_tables.json'}
searchKey={"unaccented_comment_or_objectid_cont_any"}
diff --git a/app/javascript/vehicle_journeys/components/tools/select2s/TimetableSelect2.js b/app/javascript/vehicle_journeys/components/tools/select2s/TimetableSelect2.js
index d5aad20d0..919853a71 100644
--- a/app/javascript/vehicle_journeys/components/tools/select2s/TimetableSelect2.js
+++ b/app/javascript/vehicle_journeys/components/tools/select2s/TimetableSelect2.js
@@ -26,7 +26,7 @@ export default class BSelect4 extends Component {
allowClear: false,
theme: 'bootstrap',
width: '100%',
- placeholder: I18n.t('vehicle_journeys.vehicle_journeys_matrix.filters.timetable'),
+ placeholder: this.props.placeholder,
language: require('./language'),
ajax: {
url: origin + path + this.props.chunkURL,
diff --git a/config/locales/actions.en.yml b/config/locales/actions.en.yml
index c349b709f..faf0dcec2 100644
--- a/config/locales/actions.en.yml
+++ b/config/locales/actions.en.yml
@@ -9,7 +9,8 @@ en:
search: "Search"
submit: "Submit"
processing: "Processing…"
- add: "Add new"
+ add: "Add"
+ remove: Remove
new: "Add new"
show: "See"
archive: "Archive"
diff --git a/config/locales/actions.fr.yml b/config/locales/actions.fr.yml
index 88e08aaef..ed1a86189 100644
--- a/config/locales/actions.fr.yml
+++ b/config/locales/actions.fr.yml
@@ -9,7 +9,8 @@ fr:
search: "Chercher"
submit: "Valider"
processing: "En cours…"
- add: 'Créer'
+ add: 'Ajouter'
+ remove: Retirer
new: 'Créer'
show: 'Consulter'
archive: 'Conserver'
diff --git a/config/locales/routes.en.yml b/config/locales/routes.en.yml
index 66805e050..c1bacf7f0 100644
--- a/config/locales/routes.en.yml
+++ b/config/locales/routes.en.yml
@@ -4,7 +4,7 @@ en:
placeholder: Search by name or ID
no_results: "No route matching your query"
actions:
- new: "Add a new route"
+ new: "Add a route"
edit: "Edit this route"
edit_boarding_alighting: "Stop alighting and boarding"
destroy: "Remove this route"
@@ -17,7 +17,7 @@ en:
new_stop_point: "Create new stop"
reversed_vehicle_journey: "Reversed vehicle journeys"
new:
- title: "Add a new route"
+ title: "Add a route"
edit:
title: "Update route %{name}"
select2:
diff --git a/config/locales/stop_areas.en.yml b/config/locales/stop_areas.en.yml
index 1da4b58b4..4d19a77e9 100644
--- a/config/locales/stop_areas.en.yml
+++ b/config/locales/stop_areas.en.yml
@@ -20,8 +20,8 @@ en:
accessibility: "Accessibility"
custom_fields: "Custom fields"
actions:
- new: "Add a new stop area"
- create: "Add a new stop area"
+ new: "Add a stop area"
+ create: "Add a stop area"
edit: "Edit stop area"
update: "Edit stop area"
destroy: "Delete stop area"
diff --git a/config/locales/stop_points.en.yml b/config/locales/stop_points.en.yml
index 76e142ba1..bcdb56de8 100644
--- a/config/locales/stop_points.en.yml
+++ b/config/locales/stop_points.en.yml
@@ -52,7 +52,7 @@ en:
simple_form:
labels:
stop_point:
- name: Stop Point
- for_boarding: "Pickup"
- for_alighting: "Drop off"
+ name: Stop Area
+ for_boarding: Boarding
+ for_alighting: Alighting
reflex_id: ID
diff --git a/config/locales/vehicle_journeys.en.yml b/config/locales/vehicle_journeys.en.yml
index 8bc268197..c0d6f74d4 100644
--- a/config/locales/vehicle_journeys.en.yml
+++ b/config/locales/vehicle_journeys.en.yml
@@ -5,6 +5,8 @@ en:
id: Filter by ID...
journey_pattern: Filter by journey pattern...
timetable: Filter by timetable...
+
+ purchase_window: Filter by purchase window
cancel_selection: "Cancel Selection"
fetching_error: "There has been a problem fetching the data. Please reload the page to try again."
line_routes: "Line's routes"
diff --git a/config/locales/vehicle_journeys.fr.yml b/config/locales/vehicle_journeys.fr.yml
index 18703be9b..b17e102a8 100644
--- a/config/locales/vehicle_journeys.fr.yml
+++ b/config/locales/vehicle_journeys.fr.yml
@@ -5,6 +5,7 @@ fr:
id: Filtrer par ID course...
journey_pattern: 'Filtrer par code, nom ou OID de mission...'
timetable: Filtrer par calendrier...
+ purchase_windows: Filtrer par calendrier commercial...
cancel_selection: "Annuler la sélection"
fetching_error: "La récupération des missions a rencontré un problème. Rechargez la page pour tenter de corriger le problème."
line_routes: "Séquences d'arrêts de la ligne"