Skip to content

Commit

Permalink
Merge pull request #417 from azavea/kob/fix/translations-and-grammar
Browse files Browse the repository at this point in the history
Add final translations and replace sentences with bullets
  • Loading branch information
ktohalloran authored Mar 17, 2022
2 parents f11785a + 50d0712 commit 0bedcc4
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 80 deletions.
4 changes: 2 additions & 2 deletions taui/src/components/dock.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@ class Dock extends PureComponent<Props> {
{showFavorites && <>
{t('Dock.Favorites')}
&nbsp;
{endingOffset > 0 && `(${startingOffset + 1}${endingOffset} of ${totalNeighborhoodCount})`}
{endingOffset > 0 && `(${startingOffset + 1}${endingOffset} / ${totalNeighborhoodCount})`}
</>}
{!showFavorites && <>
{t('Dock.Recommendations')}
&nbsp;
{endingOffset > 0 && `(${startingOffset + 1}${endingOffset} of ${totalNeighborhoodCount})`}
{endingOffset > 0 && `(${startingOffset + 1}${endingOffset} / ${totalNeighborhoodCount})`}
</>}
</h2>
<div className='map-sidebar__neighborhoods-actions'>
Expand Down
22 changes: 10 additions & 12 deletions taui/src/components/neighborhood-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Icon from '@conveyal/woonerf/components/icon'
import uniq from 'lodash/uniq'
import {PureComponent} from 'react'

import {ROUND_TRIP_MINUTES} from '../constants'
import type {AccountProfile, ActiveListingDetail, NeighborhoodImageMetadata} from '../types'
import getCraigslistSearchLink from '../utils/craigslist-search-link'
import getGoogleDirectionsLink from '../utils/google-directions-link'
Expand Down Expand Up @@ -62,7 +61,7 @@ class NeighborhoodDetails extends PureComponent<Props> {
) : (
neighborhood.segments && neighborhood.segments.length ? neighborhood.segments[0] : null
)
const roundedTripTime = Math.round((listing ? listing.time : neighborhood.time) / ROUND_TRIP_MINUTES) * ROUND_TRIP_MINUTES
const tripTime = listing ? listing.time : neighborhood.time

// lat,lon strings for Google Directions link from neighborhood to current destination
const destinationCoordinateString = origin.position.lat + ',' + origin.position.lon
Expand All @@ -72,13 +71,13 @@ class NeighborhoodDetails extends PureComponent<Props> {

return (
<div className='neighborhood-details__trip'>
{bestJourney && <span className='neighborhood-details__route'>{t('Units.About')}&nbsp;
{roundedTripTime}&nbsp;
{t('Units.Mins')}&nbsp;
<ModesList segments={bestJourney} />&nbsp;
{t('NeighborhoodDetails.FromOrigin')}&nbsp;
{currentDestination && t('TripPurpose.' + currentDestination.purpose).toLowerCase()}
</span>}
{bestJourney && <span className='neighborhood-details__route'>
<strong>{t('NeighborhoodDetails.TravelTime')}: </strong>
{tripTime} {t('Units.Mins')}<br />
<strong>{t('NeighborhoodDetails.FromOrigin')}: </strong>
{currentDestination && t('TripPurpose.' + currentDestination.purpose).toLowerCase()}<br />
<strong>{t('NeighborhoodDetails.ModeSummary')}: </strong>
<ModesList segments={bestJourney} /></span>}
{!bestJourney && !hasVehicle && <span className='neighborhood-details__route'>{t('Systems.TripsEmpty')}</span>}
<a
className='neighborhood-details__directions'
Expand Down Expand Up @@ -164,7 +163,7 @@ class NeighborhoodDetails extends PureComponent<Props> {
return (
<>
<h6 className='neighborhood-details__link-heading'>
{t('NeighborhoodDetails.MainSearchToolsLinksHeading', {rooms: rooms, maxSubsidy: estMaxRent.toLocaleString(i18n.language)})}
{t('NeighborhoodDetails.MainSearchToolsSearch')}: {rooms} {t('NeighborhoodDetails.BedroomAbbr')} (${estMaxRent.toLocaleString(i18n.language)} {t('NeighborhoodDetails.MaxRentSearch')})
</h6>
<div className='neighborhood-details__links'>
<a
Expand Down Expand Up @@ -361,8 +360,7 @@ const ModesList = ({segments}) => {

return segments && segments.length ? (
<>
{t('NeighborhoodDetails.ModeSummary')}&nbsp;
{uniq(segments.map(s => s.type)).join('/')}
{uniq(segments.map(s => t(`TransportationMethod.${s.type}`))).join('/')}
</>
) : t('NeighborhoodDetails.DriveMode')
}
9 changes: 3 additions & 6 deletions taui/src/components/route-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,9 @@ class RouteCard extends React.PureComponent<Props> {
</div>
<div className='neighborhood-summary__trajectory'>
<span className='neighborhood-summary__mode'>
{t(modeKey)}
&nbsp;
{t('NeighborhoodDetails.FromOrigin')}
</span>
{' '}
<span className='neighborhood-summary__location'>
<strong>{t('NeighborhoodDetails.ModeSummary').toLowerCase()}: </strong>
{t(modeKey)}<br />
<strong>{t('NeighborhoodDetails.FromOrigin').toLowerCase()}: </strong>
{currentDestination && t('TripPurpose.' + currentDestination.purpose).toLowerCase()}
</span>
</div>
Expand Down
13 changes: 3 additions & 10 deletions taui/src/components/route-segments.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,20 @@ export default function RouteSegments ({hasVehicle, routeSegments, travelTime})
return (
<div className='route-segments'>
<div className='route-segments__best-trip'>
{t('Systems.Take')}&nbsp;
<strong>{t('Systems.Route')}: </strong>
{bestJourney.map((segment, index) => (
<Segment key={index} segment={segment} />
))}
{travelTime > 120 ? (
<span className='decrease'>
{t('System.InaccessibleWithin')} 120 {t('Units.Mins')}
</span>
) : (
<span>{t('Units.In')} <strong>{travelTime}</strong> {t('Units.Mins')}</span>
)}
</div>
{routeSegments.length > 1 &&
<div className='route-segments__alt-trips'>
{t('Systems.AlternateTripsTitle')}&nbsp;
<strong>{t('Systems.AlternateTripsTitle')}: </strong>
{alternateJourneys.map((segments, jindex) => (
<span key={jindex}>
{segments.map((segment, index) => (
<Segment key={index} segment={segment} />
))}
{jindex < alternateJourneys.length - 1 && 'or '}
{jindex < alternateJourneys.length - 1 && `${t('NeighborhoodDetails.Or')} `}
</span>
))}
</div>
Expand Down
26 changes: 17 additions & 9 deletions taui/src/locales/en/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export default {
TripsTitle: 'Example trips',
TripsEmpty: 'No routes found to that destination',
BestTripTitle: 'Fastest trip',
AlternateTripsTitle: 'Alternatively use',
AlternateTripsTitle: 'Alternative',
Waiting: 'waiting included',
NoAccess: 'No data from this point...',
Take: 'Take',
Route: 'Route',
InaccessibleWithin: 'inaccessible within'
},
Faster: 'faster',
Expand Down Expand Up @@ -56,6 +56,7 @@ export default {
FeedbackLink: 'ECHO needs your feedback',
GoBackToRecommendations: 'Back to your recommendations',
GoBackToFavorites: 'Back to saved recommendations',
RecommendationsCount: 'of',
GoPreviousPage: 'Go back',
GoNextPage: 'Show more',
NoResults: 'No results',
Expand All @@ -73,18 +74,21 @@ export default {
ChildCareSearchLink: 'Child Care Search',
CraigslistSearchLink: 'Craigslist',
DirectionsLink: 'Directions',
DriveMode: 'drive',
FromOrigin: 'from',
DriveMode: 'car',
FromOrigin: 'Origin',
TravelTime: 'Travel Time',
GoogleSearchLink: 'Google',
GoogleMapsLink: 'Google Maps',
GoSection8SearchLink: 'GoSection8',
HotpadsSearchLink: 'Hotpads',
ListingsFetchError: 'Could not fetch listings',
MetroHousingLink: 'Metro Housing',
MaxRent: 'Est. max rent',
MaxRentSearch: 'max rent',
BedroomAbbr: 'br',
ModeSummary: 'via',
MainSearchToolsLinksHeading: 'Search for {{rooms}}br with max rent ${{maxSubsidy}}',
ModeSummary: 'Mode',
Or: 'or',
MainSearchToolsSearch: 'Search for apartments',
MoreSearchToolsLinksHeading: 'More search tools',
RealtorApartmentsToggle: 'Realtor.com',
RentEstimatorLink: 'Rent Estimator',
Expand Down Expand Up @@ -120,8 +124,7 @@ export default {
Units: {
About: 'About',
Minutes: 'minutes',
Mins: 'min',
In: 'in'
Mins: 'min'
},
Agency: 'Boston Housing Authority',
SignIn: {
Expand Down Expand Up @@ -237,5 +240,10 @@ export default {
Yes: 'Yes',
No: 'No'
},
UnknownValue: 'Unknown'
UnknownValue: 'Unknown',
TransportationMethod: {
subway: 'subway',
bus: 'bus',
train: 'train'
}
}
41 changes: 25 additions & 16 deletions taui/src/locales/es/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export default {
BaseTitle: 'Proposed Transit',
ComparisonTitle: 'Current Transit',
TripsTitle: 'Example trips',
TripsEmpty: 'No routes found to that destination',
TripsEmpty: 'No se han encontrado rutas hacia ese destino',
BestTripTitle: 'Fastest trip',
AlternateTripsTitle: 'Alternativamente use',
AlternateTripsTitle: 'Alternativa',
Waiting: 'waiting included',
NoAccess: 'No data from this point...',
Take: 'Tome',
Route: 'Ruta',
InaccessibleWithin: 'inaccessible within'
},
Faster: 'faster',
Expand All @@ -33,10 +33,10 @@ export default {
Map: {
SelectNetwork: 'Set time of day',
NetworkOptions: {
Peak: 'Peak',
OffPeak: 'Off Peak',
PeakNoExpress: 'Peak No Express',
OffPeakNoExpress: 'Off Peak No Express'
Peak: 'Hora con tráfico',
OffPeak: 'Hora con poco tráfico',
PeakNoExpress: 'Hora con tráfico que no es express',
OffPeakNoExpress: 'Hora de poco tráfico que no es express'
},
SetLocationPopup: {
SetStart: 'Set start',
Expand All @@ -57,35 +57,40 @@ export default {
FeedbackLink: 'ECHO necesita su opinion',
GoBackToRecommendations: 'Regresar a sus recomendaciones',
GoBackToFavorites: 'Back to saved recommendations',
RecommendationsCount: 'de',
GoPreviousPage: 'Regresar',
GoNextPage: 'Muestra mas',
NoResults: 'Ningun resultado',
Recommendations: 'Sus recomendaciones',
ShowAllButton: 'Todo',
ShowSavedButton: 'Guardado',
SiteBy: 'site by Azavea'
SiteBy: 'Página Web hecha por de Azavea'
},
NeighborhoodDetails: {
AboutNeighborhoodLinksHeading: 'Aprenda sobre este vecindario',
ApartmentsDotComLink: 'Apartments.com',
ApartmentsToggles: 'Apartamentos',
ApartmentsToggles: 'Mostrar apartamentos desde',
BHAApartmentsLink: 'Boston Housing Authority',
BHAApartmentsToggle: 'BHA',
ChildCareSearchLink: 'Child Care Search',
CraigslistSearchLink: 'Craigslist',
DirectionsLink: 'Direcciones',
DriveMode: 'en coche',
FromOrigin: 'de',
FromOrigin: 'Origen',
TravelTime: 'Tiempo de Viaje',
GoogleSearchLink: 'Google',
GoogleMapsLink: 'Google Maps',
GoSection8SearchLink: 'GoSection8',
HotpadsSearchLink: 'Hotpads',
ListingsFetchError: 'Could not fetch listings',
ListingsFetchError: 'No se han podido descargar los listados',
MetroHousingLink: 'Metro Housing',
MaxRent: 'El alquiler estimado máximo',
MaxRentSearch: 'el alquiler máximo',
BedroomAbbr: 'dor.',
ModeSummary: 'via',
MainSearchToolsLinksHeading: 'Busque por {{rooms}}dor. con alquiler máximo ${{maxSubsidy}}',
ModeSummary: 'Modo',
Or: 'o',
MainSearchToolsLinksHeading: 'Búsqueda de una unidad de {{rooms}}dor. con un alquiler máximo de ${{maxSubsidy}}',
MainSearchToolsSearch: 'Búsqueda de apartmentos',
MoreSearchToolsLinksHeading: 'Más herramientas de búsqueda',
ReadLessLink: 'Read Less',
ReadMoreLink: 'Read More',
Expand Down Expand Up @@ -124,8 +129,7 @@ export default {
Units: {
About: 'Sobre',
Minutes: 'minutes',
Mins: 'min',
In: 'en'
Mins: 'min'
},
Agency: 'Autorida de Vivienda de Boston',
SignIn: {
Expand Down Expand Up @@ -245,5 +249,10 @@ export default {
Yes: 'Sí',
No: 'No'
},
UnknownValue: 'Unknown'
UnknownValue: 'Unknown',
TransportationMethod: {
subway: 'tren',
bus: 'autobús',
train: 'tren'
}
}
Loading

0 comments on commit 0bedcc4

Please sign in to comment.