Skip to content

Commit

Permalink
Add spanish language to admin dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Jan 14, 2025
1 parent 0d7a61e commit 23c9090
Show file tree
Hide file tree
Showing 45 changed files with 429 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/**/*.pem
/**/*.pem-chain
/**/*.ca.pem
/**/.DS_Store
4 changes: 2 additions & 2 deletions backend/src/components/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns'
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'
import { DatePicker as MuiDatePicker } from '@mui/x-date-pickers/DatePicker'
import { fr, enUS } from 'date-fns/locale'
import { fr, enUS, es } from 'date-fns/locale'
import { TextFieldVariants } from '@mui/material'
import { DateValidationError } from '@mui/x-date-pickers'

Expand Down Expand Up @@ -49,7 +49,7 @@ const DatePicker = ({
}, [minDateValue])

return (
<LocalizationProvider adapterLocale={language === 'fr' ? fr : enUS} dateAdapter={AdapterDateFns}>
<LocalizationProvider adapterLocale={language === 'fr' ? fr : language === 'es' ? es : enUS} dateAdapter={AdapterDateFns}>
<MuiDatePicker
label={label}
views={['year', 'month', 'day']}
Expand Down
4 changes: 2 additions & 2 deletions backend/src/components/DateTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns'
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'
import { DateTimePicker as MuiDateTimePicker } from '@mui/x-date-pickers/DateTimePicker'
import { fr, enUS } from 'date-fns/locale'
import { fr, enUS, es } from 'date-fns/locale'
import { TextFieldVariants } from '@mui/material'
import { DateTimeValidationError, PickersActionBarAction } from '@mui/x-date-pickers'

Expand Down Expand Up @@ -46,7 +46,7 @@ const DateTimePicker = ({
}

return (
<LocalizationProvider adapterLocale={language === 'fr' ? fr : enUS} dateAdapter={AdapterDateFns}>
<LocalizationProvider adapterLocale={language === 'fr' ? fr : language === 'es' ? es : enUS} dateAdapter={AdapterDateFns}>
<MuiDateTimePicker
label={label}
value={value}
Expand Down
2 changes: 1 addition & 1 deletion backend/src/components/MultimediaList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const MultimediaList = ({
}}
/>
)}
label={strings.TOUCHSCEEN}
label={strings.TOUCHSCREEN}
/>
</div>
</div>
Expand Down
5 changes: 5 additions & 0 deletions backend/src/lang/activate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const strings = new LocalizedStrings({
TOKEN_EXPIRED: 'Your account activation link expired.',
ACTIVATE: 'Activate',
},
es: {
ACTIVATE_HEADING: 'Activación de cuenta',
TOKEN_EXPIRED: 'Su enlace de activación de cuenta ha expirado.',
ACTIVATE: 'Activar',
},
})

langHelper.setLanguage(strings)
Expand Down
4 changes: 4 additions & 0 deletions backend/src/lang/booking-car-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const strings = new LocalizedStrings({
REQUIRED_FIELD: 'Please fill in the field: ',
REQUIRED_FIELDS: 'Please fill in the fields: ',
},
es: {
REQUIRED_FIELD: 'Por favor, complete el campo: ',
REQUIRED_FIELDS: 'Por favor, complete los campos: ',
},
})

langHelper.setLanguage(strings)
Expand Down
4 changes: 4 additions & 0 deletions backend/src/lang/booking-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const strings = new LocalizedStrings({
PICK_UP_LOCATION: 'Pick-up location',
DROP_OFF_LOCATION: 'Drop-off location',
},
es: {
PICK_UP_LOCATION: 'Lugar de recogida',
DROP_OFF_LOCATION: 'Lugar de entrega',
},
})

langHelper.setLanguage(strings)
Expand Down
16 changes: 16 additions & 0 deletions backend/src/lang/booking-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ const strings = new LocalizedStrings({
DAYS: 'Days',
COST: 'COST',
},
es: {
CAR: 'Coche',
SUPPLIER: 'Proveedor',
DRIVER: 'Conductor',
PRICE: 'Precio',
STATUS: 'Estado',
UPDATE_SELECTION: 'Modificar selección',
DELETE_SELECTION: 'Eliminar selección',
UPDATE_STATUS: 'Modificación del estado',
NEW_STATUS: 'Nuevo estado',
DELETE_BOOKING: '¿Estás seguro de que quieres eliminar esta reserva?',
DELETE_BOOKINGS: '¿Estás seguro de que quieres eliminar las reservas seleccionadas?',
EMPTY_LIST: 'Sin reservas.',
DAYS: 'Días',
COST: 'Coste',
},
})

langHelper.setLanguage(strings)
Expand Down
4 changes: 4 additions & 0 deletions backend/src/lang/booking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const strings = new LocalizedStrings({
TOTAL: 'Total:',
DELETE_BOOKING: 'Are you sure you want to delete this booking?',
},
es: {
TOTAL: 'Total:',
DELETE_BOOKING: '¿Estás seguro de que quieres eliminar esta reserva?',
},
})

langHelper.setLanguage(strings)
Expand Down
3 changes: 3 additions & 0 deletions backend/src/lang/bookings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ const strings = new LocalizedStrings({
en: {
NEW_BOOKING: 'New Booking',
},
es: {
NEW_BOOKING: 'Nueva reserva',
},
})

langHelper.setLanguage(strings)
Expand Down
7 changes: 7 additions & 0 deletions backend/src/lang/car-multimedia-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ const strings = new LocalizedStrings({
ANDROID_AUTO: 'Android Auto',
APPLE_CAR_PLAY: 'Apple Car Play',
},
es: {
MULTIMEDIA: 'Multimedia',
TOUCHSCREEN: 'Pantalla táctil',
BLUETOOTH: 'Bluetooth',
ANDROID_AUTO: 'Android Auto',
APPLE_CAR_PLAY: 'Apple Car Play',
},
})

langHelper.setLanguage(strings)
Expand Down
7 changes: 7 additions & 0 deletions backend/src/lang/car-range-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ const strings = new LocalizedStrings({
MAXI: 'Maxi',
SCOOTER: 'Scooter',
},
es: {
RANGE: 'Gama',
MINI: 'Mini',
MIDI: 'Midi',
MAXI: 'Maxi',
SCOOTER: 'Scooter',
},
})

langHelper.setLanguage(strings)
Expand Down
7 changes: 7 additions & 0 deletions backend/src/lang/car-rating-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ const strings = new LocalizedStrings({
RATING_3: '(3 and up)',
RATING_4: '(4 and up)',
},
es: {
RATING: 'Clasificación',
RATING_1: '(1 y más)',
RATING_2: '(2 y más)',
RATING_3: '(3 y más)',
RATING_4: '(4 y más)',
},
})

langHelper.setLanguage(strings)
Expand Down
7 changes: 7 additions & 0 deletions backend/src/lang/car-seats-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ const strings = new LocalizedStrings({
FIVE: '5 seats',
FIVE_PLUS: '5+ seats',
},
es: {
SEATS: 'Asientos',
TWO: '2 asientos',
FOUR: '4 asientos',
FIVE: '5 asientos',
FIVE_PLUS: '5+ asientos',
},
})

langHelper.setLanguage(strings)
Expand Down
6 changes: 6 additions & 0 deletions backend/src/lang/car-specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ const strings = new LocalizedStrings({
MORE_THAN_FOOR_DOORS: '4+ doors',
MORE_THAN_FIVE_SEATS: '5+ seats',
},
es: {
CAR_SPECS: 'Especificaciones del coche',
AIRCON: 'Aire acondicionado',
MORE_THAN_FOOR_DOORS: '4+ puertas',
MORE_THAN_FIVE_SEATS: '5+ asientos',
},
})

langHelper.setLanguage(strings)
Expand Down
74 changes: 74 additions & 0 deletions backend/src/lang/cars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,80 @@ const strings = new LocalizedStrings({
TRIPS: 'trips',
CO2: 'CO2 effect',
},
es: {
NEW_CAR: 'Nuevo coche',
DELETE_CAR: '¿Estás seguro de que quieres eliminar este coche?',
CAR_CURRENCY: `${commonStrings.CURRENCY}/día`,
FUEL_POLICY: 'Política de combustible',
DIESEL: 'Diésel',
GASOLINE: 'Gasolina',
ELECTRIC: 'Eléctrico',
HYBRID: 'Híbrido',
PLUG_IN_HYBRID: 'Híbrido enchufable',
UNKNOWN: 'No especificado',
DIESEL_SHORT: 'D',
GASOLINE_SHORT: 'G',
ELECTRIC_SHORT: 'ELEC',
HYBRID_SHORT: 'H',
PLUG_IN_HYBRID_SHORT: 'HE',
GEARBOX_MANUAL: 'Manual',
GEARBOX_AUTOMATIC: 'Automático',
GEARBOX_MANUAL_SHORT: 'M',
GEARBOX_AUTOMATIC_SHORT: 'A',
FUEL_POLICY_LIKE_FOR_LIKE: 'Igual que',
FUEL_POLICY_FREE_TANK: 'Tanque gratis',
DIESEL_TOOLTIP: 'Este coche tiene un motor diésel',
GASOLINE_TOOLTIP: 'Este coche tiene un motor de gasolina',
ELECTRIC_TOOLTIP: 'Este coche es eléctrico',
HYBRID_TOOLTIP: 'Este coche es híbrido',
PLUG_IN_HYBRID_TOOLTIP: 'Este coche es híbrido enchufable',
GEARBOX_MANUAL_TOOLTIP: 'Este coche tiene una caja de cambios manual',
GEARBOX_AUTOMATIC_TOOLTIP: 'Este coche tiene una caja de cambios automática',
SEATS_TOOLTIP_1: 'Este coche tiene ',
SEATS_TOOLTIP_2: 'asientos',
DOORS_TOOLTIP_1: 'Este coche tiene ',
DOORS_TOOLTIP_2: 'puertas',
AIRCON_TOOLTIP: 'Este coche tiene aire acondicionado',
FUEL_POLICY_LIKE_FOR_LIKE_TOOLTIP: 'Este coche se suministra con combustible y debe devolverse con la misma cantidad de combustible.',
FUEL_POLICY_FREE_TANK_TOOLTIP: 'El precio incluye un tanque lleno de combustible.',
MILEAGE: 'Kilometraje',
MILEAGE_UNIT: 'KM/día',
UNLIMITED: 'Ilimitado',
LIMITED: 'Limitado',
CANCELLATION: 'Cancelación',
CANCELLATION_TOOLTIP: 'La reserva se puede cancelar antes de la fecha de inicio del alquiler.',
AMENDMENTS: 'Modificaciones',
AMENDMENTS_TOOLTIP: 'La reserva se puede modificar antes de la fecha de inicio del alquiler.',
THEFT_PROTECTION: 'Protección contra robo',
THEFT_PROTECTION_TOOLTIP: 'El alquiler puede incluir protección contra robo.',
COLLISION_DAMAGE_WAVER: 'Exención de daños por colisión',
COLLISION_DAMAGE_WAVER_TOOLTIP: 'El alquiler puede incluir una exención de daños por colisión.',
FULL_INSURANCE: 'Seguro completo',
FULL_INSURANCE_TOOLTIP: 'El alquiler puede incluir una exención de daños por colisión y protección contra robo del vehículo.',
ADDITIONAL_DRIVER: 'Conductor adicional',
INCLUDED: 'Incluido',
AVAILABLE: 'Disponible',
UNAVAILABLE: 'No disponible',
CAR_AVAILABLE: 'Disponible para alquiler',
CAR_AVAILABLE_TOOLTIP: 'Este coche está disponible para alquilar.',
CAR_UNAVAILABLE: 'No disponible para alquiler',
CAR_UNAVAILABLE_TOOLTIP: 'Este coche no está disponible para alquilar.',
VIEW_CAR: 'Ver este coche',
EMPTY_LIST: 'No hay coches.',
CANNOT_DELETE_CAR: 'Este coche no se puede eliminar porque está vinculado a reservas. Sin embargo, puede hacerlo no disponible para alquilar modificándolo.',
GEARBOX: 'Caja de cambios',
ENGINE: 'Motor',
DEPOSIT: 'Depósito',
LESS_THAN_VALUE_1: `Menos de ${isUS ? env.CURRENCY : ''}${env.DEPOSIT_FILTER_VALUE_1}${!isUS ? (` ${env.CURRENCY}`) : ''}`,
LESS_THAN_VALUE_2: `Menos de ${isUS ? env.CURRENCY : ''}${env.DEPOSIT_FILTER_VALUE_2}${!isUS ? (` ${env.CURRENCY}`) : ''}`,
LESS_THAN_VALUE_3: `Menos de ${isUS ? env.CURRENCY : ''}${env.DEPOSIT_FILTER_VALUE_3}${!isUS ? (` ${env.CURRENCY}`) : ''}`,
AVAILABILITY: 'Disponibilidad',
PRICE_DAYS_PART_1: 'Precio para',
PRICE_DAYS_PART_2: 'día',
PRICE_PER_DAY: 'Precio por día:',
TRIPS: 'alquileres',
CO2: 'Efecto CO2',
},
})

langHelper.setLanguage(strings)
Expand Down
10 changes: 10 additions & 0 deletions backend/src/lang/change-password.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ const strings = new LocalizedStrings({
PASSWORD_UPDATE_ERROR: 'An error occurred while updating password.',
PASSWORD_UPDATE: 'Password changed successfully.',
},
es: {
CHANGE_PASSWORD_HEADING: 'Modificación de contraseña',
CURRENT_PASSWORD: 'Contraseña actual',
YOUR_PASSWORD: 'Tu contraseña',
CURRENT_PASSWORD_ERROR: 'Contraseña incorrecta',
NEW_PASSWORD: 'Nueva contraseña',
NEW_PASSWORD_ERROR: 'Por favor elija una nueva contraseña',
PASSWORD_UPDATE_ERROR: 'Se produjo un error al actualizar la contraseña.',
PASSWORD_UPDATE: 'Contraseña cambiada con éxito.',
},
})

langHelper.setLanguage(strings)
Expand Down
85 changes: 85 additions & 0 deletions backend/src/lang/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,91 @@ const strings = new LocalizedStrings({
DRIVER_LICENSE: "Driver's License",
UPLOAD_DRIVER_LICENSE: "Upload driver's license...",
},
es: {
GENERIC_ERROR: 'Se ha producido un error no controlado.',
CHANGE_LANGUAGE_ERROR: 'Se ha producido un error al cambiar el idioma.',
UPDATED: 'Cambios realizados con éxito.',
GO_TO_HOME: 'Ir a la página de inicio',
FULL_NAME: 'Nombre completo',
EMAIL: 'Correo electrónico',
PASSWORD: 'Contraseña',
EMAIL_ALREADY_REGISTERED: 'Esta dirección de correo electrónico ya está registrada.',
CONFIRM_PASSWORD: 'Confirmar contraseña',
PHONE: 'Teléfono',
LOCATION: 'Ubicación',
BIO: 'Biografía',
IMAGE_REQUIRED: 'Por favor, añada una imagen.',
LOADING: 'Cargando...',
PLEASE_WAIT: 'Por favor, espere...',
SEARCH: 'Buscar',
SEARCH_PLACEHOLDER: 'Buscar...',
CONFIRM_TITLE: 'Confirmación',
PASSWORD_ERROR: 'La contraseña debe tener al menos 6 caracteres.',
PASSWORDS_DONT_MATCH: 'Las contraseñas no coinciden.',
CREATE: 'Crear',
UPDATE: 'Editar',
DELETE: 'Eliminar',
SAVE: 'Guardar',
CANCEL: 'Cancelar',
RESET_PASSWORD: 'Cambiar contraseña',
CURRENCY: env.CURRENCY,
DAILY: '/día',
DELETE_AVATAR_CONFIRM: '¿Está seguro de que desea eliminar la imagen?',
UPLOAD_IMAGE: 'Subir imagen',
DELETE_IMAGE: 'Eliminar imagen',
UNCHECK_ALL: 'Desmarcar todo',
CHECK_ALL: 'Marcar todo',
CLOSE: 'Cerrar',
BOOKING_STATUS_VOID: 'Vacío',
BOOKING_STATUS_PENDING: 'Pendiente',
BOOKING_STATUS_DEPOSIT: 'Depósito',
BOOKING_STATUS_PAID: 'Pagado',
BOOKING_STATUS_RESERVED: 'Reservado',
BOOKING_STATUS_CANCELLED: 'Cancelado',
FROM: 'Desde',
TO: 'Hasta',
OPTIONAL: 'Parámetros opcionales',
AND: 'y',
RECORD_TYPE_ADMIN: 'Administrador',
RECORD_TYPE_SUPPLIER: 'Proveedor',
RECORD_TYPE_USER: 'Conductor',
TYPE: 'Tipo',
CONFIRM: 'Confirmar',
USER: 'Usuario',
INFO: 'Información',
USER_TYPE_REQUIRED: 'Por favor, rellene el campo: Tipo',
FIX_ERRORS: 'Por favor, corrija los errores.',
SEND_MESSAGE: 'Enviar un mensaje',
VERIFIED: 'Cuenta verificada',
CAR: 'coche',
CARS: 'coches',
RESEND_ACTIVATION_LINK: 'Reenviar enlace de activación de cuenta',
ACTIVATION_EMAIL_SENT: 'Correo electrónico de activación enviado.',
EMAIL_NOT_VALID: 'Dirección de correo electrónico no válida',
PHONE_NOT_VALID: 'Número de teléfono no válido',
BIRTH_DATE_NOT_VALID: `El conductor debe tener al menos ${env.MINIMUM_AGE} años.`,
FORM_ERROR: 'Por favor, corrija los errores.',
ALL: 'Todos',
SUPPLIER: 'Proveedor',
STATUS: 'Estado',
PICK_UP_LOCATION: 'Lugar de recogida',
DROP_OFF_LOCATION: 'Lugar de entrega',
OPTIONS: 'Opciones',
OF: 'de',
BIRTH_DATE: 'Fecha de nacimiento',
BIRTH_DATE_NOT_VALID_PART1: 'El conductor debe tener al menos',
BIRTH_DATE_NOT_VALID_PART2: 'años.',
PAY_LATER: 'Autorizar pago posterior',
ANY: 'Cualquiera',
NAME: 'Nombre',
LONGITUDE: 'Longitud',
LATITUDE: 'Latitud',
LICENSE_REQUIRED: 'Se requiere licencia de conducir',
LICENSE: 'Licencia de conducir',
MIN_RENTAL_DAYS: 'Días mínimos de alquiler',
DRIVER_LICENSE: 'Licencia de conducir',
UPLOAD_DRIVER_LICENSE: 'Subir licencia de conducir...',
},
})

langHelper.setLanguage(strings)
Expand Down
Loading

0 comments on commit 23c9090

Please sign in to comment.