From 2f895a1ee52922565b7ca1a0c00defe68f40aebd Mon Sep 17 00:00:00 2001 From: Zog Date: Mon, 12 Feb 2018 09:33:53 +0100 Subject: Refs #5888; Fix I18n in JS --- app/javascript/routes/components/BSelect2.js | 2 +- app/javascript/routes/components/OlMap.js | 24 +++++++++++------------ app/javascript/routes/components/StopPoint.js | 12 ++++++------ app/javascript/routes/components/StopPointList.js | 8 ++++---- 4 files changed, 23 insertions(+), 23 deletions(-) (limited to 'app/javascript/routes/components') diff --git a/app/javascript/routes/components/BSelect2.js b/app/javascript/routes/components/BSelect2.js index 158deaa17..035bce155 100644 --- a/app/javascript/routes/components/BSelect2.js +++ b/app/javascript/routes/components/BSelect2.js @@ -85,7 +85,7 @@ class BSelect2 extends Component{ onSelect={ this.props.onSelect } ref='newSelect' options={{ - placeholder: this.context.I18n.routes.edit.select2.placeholder, + placeholder: this.context.I18n.t("routes.edit.select2.placeholder"), allowClear: true, language: 'fr', /* Doesn't seem to work... :( */ theme: 'bootstrap', diff --git a/app/javascript/routes/components/OlMap.js b/app/javascript/routes/components/OlMap.js index 056bddbcb..4beb02872 100644 --- a/app/javascript/routes/components/OlMap.js +++ b/app/javascript/routes/components/OlMap.js @@ -115,40 +115,40 @@ export default class OlMap extends Component{ {this.props.value.olMap.json.name}

- {this.context.I18n.routes.edit.stop_point_type} : + {this.context.I18n.t('routes.edit.map.stop_point_type')} : {this.props.value.olMap.json.area_type}

- {this.context.I18n.routes.edit.short_name} : + {this.context.I18n.t('routes.edit.map.short_name')} : {this.props.value.olMap.json.short_name}

- {this.context.I18n.id_reflex} : + {this.context.I18n.t('id_reflex')} : {this.props.value.olMap.json.user_objectid}

-

{this.context.I18n.routes.edit.map.coordinates} :

+

{this.context.I18n.t('routes.edit.map.coordinates')} :

- {this.context.I18n.routes.edit.map.proj}.: WSG84
- {this.context.I18n.routes.edit.map.lat}.: {this.props.value.olMap.json.latitude}
- {this.context.I18n.routes.edit.map.lon}.: {this.props.value.olMap.json.longitude} + {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}

- {this.context.I18n.routes.edit.map.postal_code} : + {this.context.I18n.t('routes.edit.map.postal_code')} : {this.props.value.olMap.json.zip_code}

- {this.context.I18n.routes.edit.map.city} : + {this.context.I18n.t('routes.edit.map.city')} : {this.props.value.olMap.json.city_name}

- {this.context.I18n.routes.edit.map.comment} : + {this.context.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.actions.select}
+ >{this.context.I18n.t('actions.select')} )}
@@ -162,7 +162,7 @@ export default class OlMap extends Component{ } } -OlMap.PropTypes = { +OlMap.propTypes = { } OlMap.contextTypes = { diff --git a/app/javascript/routes/components/StopPoint.js b/app/javascript/routes/components/StopPoint.js index 2d47e802b..af51a6bb4 100644 --- a/app/javascript/routes/components/StopPoint.js +++ b/app/javascript/routes/components/StopPoint.js @@ -18,15 +18,15 @@ export default function StopPoint(props, {I18n}) {
@@ -77,7 +77,7 @@ export default function StopPoint(props, {I18n}) { ) } -StopPoint.PropTypes = { +StopPoint.propTypes = { onToggleMap: PropTypes.func.isRequired, onToggleEdit: PropTypes.func.isRequired, onDeleteClick: PropTypes.func.isRequired, @@ -93,4 +93,4 @@ StopPoint.PropTypes = { StopPoint.contextTypes = { I18n: PropTypes.object -} \ No newline at end of file +} diff --git a/app/javascript/routes/components/StopPointList.js b/app/javascript/routes/components/StopPointList.js index b39fa0c9c..b227abdea 100644 --- a/app/javascript/routes/components/StopPointList.js +++ b/app/javascript/routes/components/StopPointList.js @@ -10,22 +10,22 @@ export default function StopPointList({ stopPoints, onDeleteClick, onMoveUpClick
- +
- +
- +
- +
-- cgit v1.2.3