Skip to content

Commit

Permalink
Merge pull request #430 from opentripplanner/react-intl-ramp-up-pr1
Browse files Browse the repository at this point in the history
React Intl Ramp Up PR #1
  • Loading branch information
binh-dam-ibigroup authored Sep 10, 2021
2 parents bdd8951 + 88c7e2b commit b1d6b92
Show file tree
Hide file tree
Showing 55 changed files with 618 additions and 346 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
- uses: codespell-project/actions-codespell@master
with:
check_filenames: true
# The a11y test file has a false positive and the ignore list does not work
# skip git, yarn, and i18n non-english resources.
# Also, the a11y test file has a false positive and the ignore list does not work
# see https://github.com/opentripplanner/otp-react-redux/pull/436/checks?check_run_id=3369380014
skip: ./.git,yarn.lock,./a11y/a11y.test.js
skip: ./.git,yarn.lock,./a11y/a11y.test.js,./i18n/fr*
74 changes: 5 additions & 69 deletions __tests__/components/viewers/__snapshots__/stop-viewer.js.snap

Large diffs are not rendered by default.

101 changes: 93 additions & 8 deletions i18n/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,88 @@ _name: English
components:
DefaultItinerary:
clickDetails: Click to view details
# Use ordered placeholders for the departure-arrival string
# (this will accommodate right-to-left languages by swapping the order in this string).
departureArrivalTimes: "{startTime}—{endTime}"
# Use ordered placeholders when multiple modes are involved
# (this will accommodate right-to-left languages by swapping the order/separator in this string).
multiModeSummary: "{accessMode} to {transitMode}"
# If trip is less than one hour only display the minutes.
tripDurationFormatZeroHours: "{minutes, number} min"
# TODO: Distinguish between one hour (singular) and 2 hours or more?
tripDurationFormat: "{hours, number} hr {minutes, number} min"
ItinerarySummary:
fareCost: "{useMaxFare, select,
true {{minTotalFare} - {maxTotalFare}}
other {{minTotalFare}}
}"
NarrativeItinerariesHeader:
numIssues: "{issueNum, number} issues"
resultText: "{pending, select,
true {Finding your options...}
other {
{itineraryNum, number} {itineraryNum, plural,
one {itinerary found}
other {itineraries found}
}
}
}"
selectArrivalTime: Arrival time
selectBest: Best option
selectCost: Cost
selectDepartureTime: Departure time
selectDuration: Duration
selectWalkTime: Walk time
titleText: "{pending, select,
true {Finding your options...}
other {
{itineraryNum, number} {itineraryNum, plural,
one {itinerary}
other {itineraries}}
{issueNum, plural,
=0 {found}
one {(and {issueNum, number} issue) found}
other {(and {issueNum, number} issues) found}
}
}
}"
viewAll: View all options
PlanFirstLastButtons:
# Note to translator: these values are width-constrained.
first: First
last: Last
next: Next
previous: Previous
RealtimeAnnotation:
ignoreServiceDelays: Apply service delays
delaysNotShownInResults: "Your trip results are currently being affected by service delays.
These delays do not factor into travel times shown below."
delaysShownInResults: "Your trip results have been adjusted based on real-time
information. Under normal conditions, this trip would take {normalDuration}
using the following routes: {routes}."
ignoreServiceDelays: Ignore service delays
serviceUpdate: Service update
SaveTripButton:
cantSaveText: Cannot save
cantSaveTooltip: Only itineraries that include transit and no rentals or ride hailing can be monitored.
saveTripText: Save trip
signInText: Sign in to save trip
signInTooltip: Please sign in to save trip.
SimpleRealtimeAnnotation:
usingRealtimeInfo: This trip uses real-time traffic and delay information
TabbedItineraries:
optionNumber: "Option {optionNum, number}"
fareCost: "{hasMaxFare, select,
true {{minTotalFare}+}
other {{minTotalFare}}
}"
TripTools:
# Note to translator: copyLink, linkCopied, print, reportIssue,
# and startOver are width-constrained.
copyLink: Copy link
# Text that replaces the copyLink button text after user clicks it.
linkCopied: Copied
print: Print
reportIssue: Report Issue
reportEmailSubject: Reporting an Issue with OpenTripPlanner
reportEmailTemplate: " *** INSTRUCTIONS TO USER ***
This feature allows you to email a report to site administrators for review.
Please add any additional feedback for this trip under the 'Additional Comments'
section below and send using your regular email program."
startOver: Start Over # TODO: move to other category (common with hamburger 'Start Over' item)

# Common messages that appear in multiple components and modules
# are grouped below by topic.
Expand All @@ -49,7 +121,11 @@ common:
drive: Drive
micromobility: E-Scooter
micromobilityRent: Rental E-Scooter
walk: Walk
walk: Walk

itineraryDescriptions:
calories: "{calories, number} Cal"
transfers: "{transfers, plural, =0 {} one {{transfers} transfer} other {{transfers} transfers}}"

# OTP transit modes
# Note that identifiers are OTP modes converted to lowercase.
Expand All @@ -63,3 +139,12 @@ common:
cable_car: Cable Car
gondola: Gondola
funicular: Funicular

time:
# Use ordered placeholders for the departure-arrival string
# (this will accommodate right-to-left languages by swapping the order in this string).
departureArrivalTimes: "{startTime, time, short}—{endTime, time, short}"
tripDurationFormat: "{hours, plural,
=0 {{minutes, number} min}
other {{hours, number} hr {minutes, number} min}}"

94 changes: 90 additions & 4 deletions i18n/fr-FR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,85 @@ _name: Unofficial French Translations!
components:
DefaultItinerary:
clickDetails: Cliquez pour afficher les détails
departureArrivalTimes: "{startTime}—{endTime}"
multiModeSummary: "{accessMode} + {transitMode}"
tripDurationFormatZeroHours: "{minutes, number} mn"
tripDurationFormat: "{hours, number} h, {minutes, number} mn"
ItinerarySummary:
fareCost: "{useMaxFare, select,
true {{minTotalFare} - {maxTotalFare}}
other {{minTotalFare}}
}"
NarrativeItinerariesHeader:
numIssues: "{issueNum, number} problèmes"
resultText: "{pending, select,
true {Recherche de vos options en cours...}
other {
{itineraryNum, number} {itineraryNum, plural,
one {trajet trouvé}
other {trajets trouvés}
}
}
}"
selectArrivalTime: Heure d'arrivée
selectBest: Meilleure option
selectCost: Prix
selectDepartureTime: Heure de départ
selectDuration: Durée
selectWalkTime: Temps de marche
titleText: "{pending, select,
true {Recherche de vos options en cours...}
other {
{itineraryNum, number} {itineraryNum, plural,
one {trajet}
other {trajets}}
{issueNum, plural,
=0 {trouvé}
one {(et {issueNum, number} problème) trouvé}
other {(and {issueNum, number} problèmes) trouvés}
}
}
}"
viewAll: Voir toutes les options
PlanFirstLastButtons:
# Note to translator: these values are width-constrained.
first: Premier
last: Dernier
next: Suivant
previous: Précédent
RealtimeAnnotation:
ignoreServiceDelays: Appliquer les retards
delaysNotShownInResults: "Vos trajets recherchés sont perturbés par des retards.
Ces retards ne sont pas pris en compte dans les temps de trajet ci-dessous."
delaysShownInResults: "Vos trajets recherchés ont été mis à jour avec les conditions en temps réel.
En temps normal, ce trajet prendrait {normalDuration} en empruntant les lignes: {routes}."
ignoreServiceDelays: Ignorer les retards
serviceUpdate: Information sur le service
SaveTripButton:
cantSaveText: Impossible d'enregistrer
cantSaveTooltip: Seuls les trajets en transports en commun sans location de véhicules et sans course en voiture peuvent être suivis.
saveTripText: Enregistrer
signInText: Connectez-vous pour enregistrer
signInTooltip: Veuillez vous connecter pour enregistrer ce trajet.
SimpleRealtimeAnnotation:
usingRealtimeInfo: Ce trajet utilise les informations en temps réel sur le trafic et les retards
TabbedItineraries:
optionNumber: "Option {optionNum, number}"
fareCost: "{hasMaxFare, select,
true {À partir de {minTotalFare}}
other {{minTotalFare}}
}"
TripTools:
# Note to translator: copyLink, linkCopied, print, reportIssue,
# and startOver are width-constrained.
copyLink: Copier le lien
# Text that replaces the copyLink button text after user clicks it.
linkCopied: Copié
print: Imprimer
reportIssue: Un problème ? # "Signaler un problème" does not fit.
reportEmailSubject: Signaler un problème avec OpenTripPlanner
reportEmailTemplate: " *** A L'ATTENTION DE L'UTILISATEUR ***
Vous pouvez communiquer votre problème en détail aux administrateurs de ce site, par courriel.
Veuillez ajouter toute remarque sur cet itinéraire dans la section 'Additional Comments'
ci-dessous, puis envoyez depuis votre logiciel de messagerie usuel."
startOver: Recommencer

common:
accessModes:
Expand All @@ -16,7 +91,12 @@ common:
drive: Voiture
micromobility: Trottinette électrique
micromobilityRent: Trottinette électrique en libre-service
walk: Marche
walk: À pied

itineraryDescriptions:
calories: "{calories, number} kcal" # SI unit
transfers: "{transfers, plural, =0 {} one {{transfers} correspondance} other {{transfers} correspondances}}"


otpTransitModes:
tram: Tram
Expand All @@ -27,3 +107,9 @@ common:
cable_car: Tram tiré par câble
gondola: Téléphérique
funicular: Funiculaire

time:
departureArrivalTimes: "{startTime, time, short}—{endTime, time, short}"
tripDurationFormat: "{hours, plural,
=0 {{minutes, number} mn}
other {{hours, number} h {minutes, number} mn}}"
2 changes: 1 addition & 1 deletion lib/components/admin/call-history-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { connect } from 'react-redux'

import * as callTakerActions from '../../actions/call-taker'
import Icon from '../narrative/icon'
import Icon from '../util/icon'

import CallRecord from './call-record'
import DraggableWindow from './draggable-window'
Expand Down
2 changes: 1 addition & 1 deletion lib/components/admin/call-record.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import humanizeDuration from 'humanize-duration'
import moment from 'moment'
import React, { Component } from 'react'

import Icon from '../narrative/icon'
import {searchToQuery} from '../../util/call-taker'
import Icon from '../util/icon'

import CallTimeCounter from './call-time-counter'
import QueryRecord from './query-record'
Expand Down
2 changes: 1 addition & 1 deletion lib/components/admin/call-taker-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import * as apiActions from '../../actions/api'
import * as callTakerActions from '../../actions/call-taker'
import * as fieldTripActions from '../../actions/field-trip'
import * as uiActions from '../../actions/ui'
import Icon from '../narrative/icon'
import { isModuleEnabled, Modules } from '../../util/config'
import Icon from '../util/icon'

import {
CallHistoryButton,
Expand Down
2 changes: 1 addition & 1 deletion lib/components/admin/draggable-window.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react'
import Draggable from 'react-draggable'

import Icon from '../narrative/icon'
import Icon from '../util/icon'

const noop = () => {}

Expand Down
2 changes: 1 addition & 1 deletion lib/components/admin/field-trip-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import { connect } from 'react-redux'
import styled from 'styled-components'

import * as fieldTripActions from '../../actions/field-trip'
import Icon from '../narrative/icon'
import {
getActiveFieldTripRequest,
getGroupSize,
GROUP_FIELDS,
PAYMENT_FIELDS,
TICKET_TYPES
} from '../../util/call-taker'
import Icon from '../util/icon'

import DraggableWindow from './draggable-window'
import EditableSection from './editable-section'
Expand Down
2 changes: 1 addition & 1 deletion lib/components/admin/field-trip-itinerary-group-size.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { Badge } from 'react-bootstrap'

import Icon from '../narrative/icon'
import Icon from '../util/icon'

export default function FieldTripGroupSize ({ itinerary }) {
return itinerary.fieldTripGroupSize > 0 && (
Expand Down
2 changes: 1 addition & 1 deletion lib/components/admin/field-trip-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { Badge, Button } from 'react-bootstrap'
import { connect } from 'react-redux'

import * as fieldTripActions from '../../actions/field-trip'
import Icon from '../narrative/icon'
import Loading from '../narrative/loading'
import {getVisibleRequests, TABS} from '../../util/call-taker'
import {FETCH_STATUS} from '../../util/constants'
import Icon from '../util/icon'

import FieldTripStatusIcon from './field-trip-status-icon'
import {FieldTripRecordButton, WindowHeader} from './styled'
Expand Down
3 changes: 2 additions & 1 deletion lib/components/admin/field-trip-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React, { Component } from 'react'
import { Badge, Button as BsButton } from 'react-bootstrap'
import styled from 'styled-components'

import Icon from '../narrative/icon'
import Icon from '../util/icon'

import {
Button,
Full,
Expand Down
2 changes: 1 addition & 1 deletion lib/components/admin/field-trip-status-icon.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

import Icon from '../narrative/icon'
import Icon from '../util/icon'

const FieldTripStatusIcon = ({ ok }) => (
ok
Expand Down
2 changes: 1 addition & 1 deletion lib/components/admin/mailables-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {Badge, Button} from 'react-bootstrap'
import {connect} from 'react-redux'

import * as callTakerActions from '../../actions/call-taker'
import Icon from '../narrative/icon'
import {getModuleConfig, isModuleEnabled, Modules} from '../../util/config'
import Icon from '../util/icon'
import {createLetter, LETTER_FIELDS} from '../../util/mailables'

import {
Expand Down
2 changes: 1 addition & 1 deletion lib/components/admin/styled.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button as BsButton } from 'react-bootstrap'
import styled, {css} from 'styled-components'

import Icon from '../narrative/icon'
import Icon from '../util/icon'

import DefaultCounter from './call-time-counter'

Expand Down
2 changes: 1 addition & 1 deletion lib/components/app/app-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { connect } from 'react-redux'
import { DropdownButton, MenuItem } from 'react-bootstrap'
import { withRouter } from 'react-router'

import Icon from '../narrative/icon'
import * as callTakerActions from '../../actions/call-taker'
import * as fieldTripActions from '../../actions/field-trip'
import { MainPanelContent, setMainPanelContent } from '../../actions/ui'
import { isModuleEnabled, Modules } from '../../util/config'
import Icon from '../util/icon'

// TODO: make menu items configurable via props/config

Expand Down
2 changes: 1 addition & 1 deletion lib/components/form/batch-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled from 'styled-components'

import * as apiActions from '../../actions/api'
import * as formActions from '../../actions/form'
import Icon from '../narrative/icon'
import Icon from '../util/icon'
import { hasValidLocation, getActiveSearch, getShowUserSettings } from '../../util/state'

import BatchPreferences from './batch-preferences'
Expand Down
2 changes: 1 addition & 1 deletion lib/components/form/mode-buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { useContext } from 'react'
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
import styled from 'styled-components'

import Icon from '../narrative/icon'
import { ComponentContext } from '../../util/contexts'
import Icon from '../util/icon'

import {buttonCss} from './batch-styled'

Expand Down
Loading

0 comments on commit b1d6b92

Please sign in to comment.