From eece6ebdecc64a7560bec87a4bb62ab2980b9c60 Mon Sep 17 00:00:00 2001 From: Nicolas Derive Date: Thu, 21 Nov 2024 11:20:12 +0100 Subject: [PATCH 1/2] Add French translation. --- ui/src/lib/i18n/fr.ts | 33 +++++++++++++++++++++++++++++++++ ui/src/lib/i18n/translation.ts | 4 +++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 ui/src/lib/i18n/fr.ts diff --git a/ui/src/lib/i18n/fr.ts b/ui/src/lib/i18n/fr.ts new file mode 100644 index 000000000..775756ea5 --- /dev/null +++ b/ui/src/lib/i18n/fr.ts @@ -0,0 +1,33 @@ +import type { Translations } from './translation'; + +const translations: Translations = { + walk: 'Walk', + bike: 'Bike', + car: 'Car', + from: 'From', + to: 'To', + arrival: 'Arrival', + departure: 'Departure', + duration: 'Duration', + arrivals: 'Arrivals', + later: 'later', + earlier: 'earlier', + departures: 'Departures', + switchToArrivals: 'Wechsel zu Ankünften', + switchToDepartures: 'Wechsel zu Abfahrten', + track: 'Track', + arrivalOnTrack: 'Arrival on track', + tripIntermediateStops: (n: number) => { + switch (n) { + case 0: + return 'No intermediate stops'; + case 1: + return '1 intermediate stop'; + default: + return `${n} intermediate stops`; + } + }, + sharingProvider: 'Provider' +}; + +export default translations; diff --git a/ui/src/lib/i18n/translation.ts b/ui/src/lib/i18n/translation.ts index 3a262fe1f..229ff4799 100644 --- a/ui/src/lib/i18n/translation.ts +++ b/ui/src/lib/i18n/translation.ts @@ -1,6 +1,7 @@ import { browser } from '$app/environment'; import en from './en'; import de from './de'; +import fr from './fr'; export type Translations = { walk: string; @@ -26,7 +27,8 @@ export type Translations = { const translations: Map = new Map( Object.entries({ en, - de + de, + fr }) ); From 4a65cd3fd244e65105289511100f4883ee4593cf Mon Sep 17 00:00:00 2001 From: Nicolas Derive Date: Thu, 21 Nov 2024 15:17:12 +0100 Subject: [PATCH 2/2] Commit properly translated file. --- ui/src/lib/i18n/fr.ts | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/ui/src/lib/i18n/fr.ts b/ui/src/lib/i18n/fr.ts index 775756ea5..bcbf08e0d 100644 --- a/ui/src/lib/i18n/fr.ts +++ b/ui/src/lib/i18n/fr.ts @@ -1,33 +1,33 @@ import type { Translations } from './translation'; const translations: Translations = { - walk: 'Walk', - bike: 'Bike', - car: 'Car', - from: 'From', - to: 'To', - arrival: 'Arrival', - departure: 'Departure', - duration: 'Duration', - arrivals: 'Arrivals', - later: 'later', - earlier: 'earlier', - departures: 'Departures', - switchToArrivals: 'Wechsel zu Ankünften', - switchToDepartures: 'Wechsel zu Abfahrten', - track: 'Track', - arrivalOnTrack: 'Arrival on track', + walk: 'Marche', + bike: 'Vélo', + car: 'Voiture', + from: 'De', + to: 'À', + arrival: 'Arrivée', + departure: 'Départ', + duration: 'Durée', + arrivals: 'Arrivées', + later: 'plus tard', + earlier: 'plus tôt', + departures: 'Départ', + switchToArrivals: 'Basculer vers les arrivées', + switchToDepartures: 'Basculer vers les départs', + track: 'Voie', + arrivalOnTrack: 'Arrivée sur la voie', tripIntermediateStops: (n: number) => { switch (n) { case 0: - return 'No intermediate stops'; + return 'Aucun arrêt intermédiaire'; case 1: - return '1 intermediate stop'; + return '1 arrêt intermédiaire'; default: - return `${n} intermediate stops`; + return `${n} arrêts intermédiaires`; } }, - sharingProvider: 'Provider' + sharingProvider: 'Fournisseur' }; export default translations;