Feat/lokalise rebuild * chore(lokalise): update translation ids * chore(lokalise): easier to switch between projects * chore(lokalise): update translation ids * . * . * . * . * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * . * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * chore(lokalise): new translations * merge * switch to errors for missing id's * merge * sync translations Approved-by: Linus Flood
31 lines
909 B
TypeScript
31 lines
909 B
TypeScript
import { ParkingPricePeriods } from '../parkingInformationTypes'
|
|
|
|
import type { IntlShape } from 'react-intl'
|
|
|
|
export function getPeriod(intl: IntlShape, period?: string) {
|
|
switch (period) {
|
|
case ParkingPricePeriods.hour:
|
|
return intl.formatMessage({
|
|
id: 'parkingInformation.pricePerHour',
|
|
defaultMessage: 'Price per hour',
|
|
})
|
|
case ParkingPricePeriods.day:
|
|
return intl.formatMessage({
|
|
id: 'parkingInformation.pricePerDay',
|
|
defaultMessage: 'Price per day',
|
|
})
|
|
case ParkingPricePeriods.night:
|
|
return intl.formatMessage({
|
|
id: 'parkingInformation.pricePerNight',
|
|
defaultMessage: 'Price per night',
|
|
})
|
|
case ParkingPricePeriods.allDay:
|
|
return intl.formatMessage({
|
|
id: 'parkingInformation.pricePer24Hours',
|
|
defaultMessage: 'Price per 24 hours',
|
|
})
|
|
default:
|
|
return period
|
|
}
|
|
}
|