katja's git: oeffisearch

fast and simple tripplanner

commit 8a9aca75bcdce937d6ca6315fe56ef75e9d65013
parent f13c8940814da703d28a3f07f230214c12e8cafd
Author: Katja (ctucx) <git@ctu.cx>
Date: Sat, 19 Apr 2025 18:25:19 +0200

languages: cleanup
2 files changed, 234 insertions(+), 239 deletions(-)
M
src/app_functions.js
|
3
++-
M
src/languages.js
|
470
+++++++++++++++++++++++++++++++++++++++----------------------------------------
diff --git a/src/app_functions.js b/src/app_functions.js
@@ -3,6 +3,7 @@ import { settingsState } from './settings.js';
 import { getHafasClient, client } from './hafasClient.js';
 import { trainsearchToHafas, hafasToTrainsearch } from './refresh_token/index.js';
 import { CustomDate } from './helpers.js';
+import { t } from './translate.js';
 
 const loyaltyCards = {
 	NONE:              Symbol('no loyalty card'),

@@ -52,7 +53,7 @@ const journeySettings = () => {
 		stopovers: true,
 		polylines: false,
 		tickets:   true,
-		language:  settingsState.language,
+		language:  t('backendLang'),
 	};
 
 	if (settingsState.profile === 'db') {
diff --git a/src/languages.js b/src/languages.js
@@ -1,247 +1,241 @@
 export const languages = {
+	'en': {
+		'backendLang':             'en',
+		'en':                      'English',
+		'de':                      'German',
+		'nl':                      'Dutch',
+		'language':                'Language',
+		'accessibility':           'Accessibillity',
+		'accessibilityNone':       'none',
+		'accessibilityPartial':    'partial',
+		'accessibilityComplete':   'full',
+		'departure':               'Departure',
+		'arrival':                 'Arrival',
+		'cancelled':               'Cancelled!',
+		'changeinfo':              '{} change duration',
+		'changes':                 'Changes',
+		'clearstorage':            'Remove local data',
+		'datasource':              'Data source',
+		'date':                    'Date',
+		'time':                    'Time',
+		'duration':                'Duration',
+		'planned':                 'planned',
+		'from':                    'From',
+		'to':                      'To',
+		'longdistancetrain':       'Long distance trains',
+		'regionaltrain':           'Regional trains',
+		'suburbantrain':           'Suburban Trains',
+		'subway':                  'Subway',
+		'iceonly':                 'ICE',
+		'iconly':                  'IC',
+		'dzug':                    'D-Zug',
+		'tram':                    'Tram',
+		'bus':                     'Bus',
+		'taxi':                    'Taxi',
+		'ferry':                   'Ferry',
+		'journeyoverview':         'Go to journeysoverview',
+		'earlier':                 'Earlier connections',
+		'later':                   'Later connections',
+		'lastjourney':             'Go to last selected journey',
+		'optional':                '(optional)',
+		'options':                 'Options',
+		'platform':                'Platform',
+		'products':                'Products',
+		'remarks':                 'Remarks',
+		'search':                  'Search',
+		'setfromto':               'Set as from/to',
+		'settings':                'Settings',
+		'station':                 'Station',
+		'swap':                    'Swap from/to',
+		'transferinfo':            'Travel to {}',
+		'via':                     'Via',
+		'walkinfo':                'Walk to {}',
+		'walkinfoMeters':          'Walk to {} (apprx. {} meters)',
+		'load-low-to-medium':      'Low to medium load',
+		'load-high':               'High load',
+		'load-very-high':          'Very high load',
+		'load-exceptionally-high': 'Exceptionally high load',
+		'tableView':               'Table',
+		'canvasView':              'Graphical',
+		'showDS100':               'Show DS100 (if available)',
+		'showPrices ':             'Show prices',
+		'price':                   'Price',
+		'back':                    'Back',
+		'refresh':                 'Refresh data',
+		'combineDateTime':         'Use combined DateTime-input',
+		'titleSetDateTimeNow':     'Set Date & Time to now',
+		'titleBikeFriendly':       'Bicycle transport possible',
+		'loyaltyCard':             'Discount card',
+		'loyaltyCardNone':         'No discount card',
+		'class':                   'Class',
+		'titleNoTransfers':        'only direct connections',
+		'lastSelectedJourney':     'Last selected journey',
+		'walkingSpeed':            'Walking speed',
+		'walkingSpeedSlow':        'slow',
+		'walkingSpeedNormal':      'normal',
+		'walkingSpeedFast':        'fast',
+		'shareURL':                'Share URL',
+		'copyURL':                 'Copy URL',
+		'ageGroup':                'Age group',
+		'ageGroupChild':           'Child',
+		'ageGroupYoung':           'Young',
+		'ageGroupAdult':           'Adult',
+		'ageGroupSenior':          'Senior',
+		'tickets':                 'Tickets',
+		'now':                     'Now',
+		'minTransferTime':         'Transfer time (Minutes)',
+		'trainType':               'Train type',
+		'close':                   'Close',
+	},
+
 	'de': {
-		'backendLang':           'de',
-		'accessibility':         'Barrierefreiheit',
-		'accessibilityNone':     'Keine Einschränkungen',
-		'accessibilityPartial':  'Bedingt barrierefrei',
-		'accessibilityComplete': 'Barrierefrei',
-		'arrival':            'Ankunft',
-		'bus':                'Bus',
-		'cancelled':          'Fahrt entfällt!',
-		'changeinfo':         '{} Umstiegsdauer',
-		'changes':            'Umstiege',
-		'clearstorage':       'Lokale Daten löschen',
-		'datasource':         'Datenquelle',
-		'date':               'Datum',
-		'de':                 'Deutsch',
-		'departure':          'Abfahrt',
-		'duration':           'Dauer',
-		'planned':            'geplant',
-		'dzug':               'D-Zug',
-		'en':                 'Englisch',
-		'ferry':              'Fähre',
-		'from':               'Von',
-		'iceonly':            'ICE',
-		'iconly':             'IC',
-		'journeyoverview':    'Verbindungsübersicht aufrufen',
-		'earlier':            'Frühere Verbindungen',
-		'later':              'Spätere Verbindungen',
-		'language':           'Sprache',
-		'lastjourney':        'Letzte gewählte Verbindung aufrufen',
-		'longdistancetrain':  'Fernverkehr',
-		'nl':                 'Niederländisch',
-		'optional':           '(optional)',
-		'options':            'Optionen',
-		'platform':           'Gleis',
-		'product':            'Produkt',
-		'regionaltrain':      'Regionalverkehr',
-		'remarks':            'Hinweise',
-		'save':               'Speichern',
-		'search':             'Suchen',
-		'setfromto':          'Als Von/Nach setzen',
-		'settings':           'Einstellungen',
-		'showDS100':          'RIL100-Kürzel anzeigen (wenn verfügbar)',
-		'station':            'Station',
-		'suburbantrain':      'S-Bahn',
-		'subway':             'U-Bahn',
-		'swap':               'Von/Nach tauschen',
-		'taxi':               'Taxi',
-		'time':               'Uhrzeit',
-		'to':                 'Nach',
-		'tram':               'Tram',
-		'transferinfo':       'Reise nach {}',
-		'update':             'Anwendung updaten',
-		'via':                'Über',
-		'walkinfo':           'Laufe nach {}',
-		'walkinfoMeters':     'Laufe nach {} (ca. {} Meter)',
-		'load-low-to-medium': 'Niedrige bis mittlere Auslastung',
-		'load-high':          'Hohe Auslastung',
-		'load-very-high':     'Sehr hohe Auslastung',
+		'backendLang':             'de',
+		'en':                      'Englisch',
+		'de':                      'Deutsch',
+		'nl':                      'Niederländisch',
+		'language':                'Sprache',
+		'accessibility':           'Barrierefreiheit',
+		'accessibilityNone':       'Keine Einschränkungen',
+		'accessibilityPartial':    'Bedingt barrierefrei',
+		'accessibilityComplete':   'Barrierefrei',
+		'departure':               'Abfahrt',
+		'arrival':                 'Ankunft',
+		'cancelled':               'Fahrt entfällt!',
+		'changeinfo':              '{} Umstiegsdauer',
+		'changes':                 'Umstiege',
+		'clearstorage':            'Lokale Daten löschen',
+		'datasource':              'Datenquelle',
+		'date':                    'Datum',
+		'time':                    'Uhrzeit',
+		'duration':                'Dauer',
+		'planned':                 'geplant',
+		'longdistancetrain':       'Fernverkehr',
+		'regionaltrain':           'Regionalverkehr',
+		'iceonly':                 'ICE',
+		'iconly':                  'IC',
+		'dzug':                    'D-Zug',
+		'suburbantrain':           'S-Bahn',
+		'subway':                  'U-Bahn',
+		'tram':                    'Tram',
+		'bus':                     'Bus',
+		'taxi':                    'Taxi',
+		'ferry':                   'Fähre',
+		'from':                    'Von',
+		'to':                      'Nach',
+		'journeyoverview':         'Verbindungsübersicht aufrufen',
+		'earlier':                 'Frühere Verbindungen',
+		'later':                   'Spätere Verbindungen',
+		'lastjourney':             'Letzte gewählte Verbindung aufrufen',
+		'optional':                '(optional)',
+		'options':                 'Optionen',
+		'platform':                'Gleis',
+		'product':                 'Produkt',
+		'products':                'Produkte',
+		'remarks':                 'Hinweise',
+		'search':                  'Suchen',
+		'setfromto':               'Als Von/Nach setzen',
+		'settings':                'Einstellungen',
+		'station':                 'Station',
+		'swap':                    'Von/Nach tauschen',
+		'transferinfo':            'Reise nach {}',
+		'via':                     'Über',
+		'walkinfo':                'Laufe nach {}',
+		'walkinfoMeters':          'Laufe nach {} (ca. {} Meter)',
+		'load-low-to-medium':      'Niedrige bis mittlere Auslastung',
+		'load-high':               'Hohe Auslastung',
+		'load-very-high':          'Sehr hohe Auslastung',
 		'load-exceptionally-high': 'Extrem hohe Auslastung',
-		'tableView':          'Tabelle',
-		'canvasView':         'Graphisch'
-		'showPrices':         'Preise anzeigen',
-		'combineDateTime':    'Kombinierte Zeit & Datumseingabe verwenden',
-		'titleSetDateTimeNow': 'Setze Uhrzeit & Datum auf jetzt',
-		'titleBikeFriendly':   'Fahrradmitnahme möglich',
-		'loyaltyCard':         'Ermäßigungskarte',
-		'loyaltyCardNone':     'keine Ermäßigungskarte',
-		'class':               'Klasse',
-		'titleNoTransfers':    'keine Umstiege zulassen',
-		'lastSelectedJourney': 'Zuletzt gewählte Verbindung',
-		'walkingSpeed':        'Gehgeschwindigkeit',
-		'walkingSpeedSlow':    'langsam',
-		'walkingSpeedNormal':  'normal',
-		'walkingSpeedFast':    'schnell',
-		'shareURL':            'Link teilen',
-		'copyURL':             'Link kopieren',
-		'ageGroup':            'Altersgruppe',
-		'ageGroupChild':       'Kind',
-		'ageGroupYoung':       'Jung',
-		'ageGroupAdult':       'Erwachsen',
-		'ageGroupSenior':      'Senior',
-		'tickets':             'Tickets',
-		'now':                 'Jetzt',
-		'minTransferTime':     'Umstiegszeit (Minuten)',
-		'trainType':           'Zugtyp',
-		'close':               'Schließen',
-		'products':            'Produkte',
-		'price':               'Preis',
-		'refresh':             'Aktualisieren',
-		'back':                'Zurück',
+		'tableView':               'Tabelle',
+		'canvasView':              'Graphisch',
+		'showDS100':               'RIL100-Kürzel anzeigen (wenn verfügbar)',
+		'showPrices':              'Preise anzeigen',
+		'combineDateTime':         'Kombinierte Zeit & Datumseingabe verwenden',
+		'titleSetDateTimeNow':     'Setze Uhrzeit & Datum auf jetzt',
+		'titleBikeFriendly':       'Fahrradmitnahme möglich',
+		'loyaltyCard':             'Ermäßigungskarte',
+		'loyaltyCardNone':         'keine Ermäßigungskarte',
+		'class':                   'Klasse',
+		'titleNoTransfers':        'keine Umstiege zulassen',
+		'lastSelectedJourney':     'Zuletzt gewählte Verbindung',
+		'walkingSpeed':            'Gehgeschwindigkeit',
+		'walkingSpeedSlow':        'langsam',
+		'walkingSpeedNormal':      'normal',
+		'walkingSpeedFast':        'schnell',
+		'shareURL':                'Link teilen',
+		'copyURL':                 'Link kopieren',
+		'ageGroup':                'Altersgruppe',
+		'ageGroupChild':           'Kind',
+		'ageGroupYoung':           'Jung',
+		'ageGroupAdult':           'Erwachsen',
+		'ageGroupSenior':          'Senior',
+		'tickets':                 'Tickets',
+		'now':                     'Jetzt',
+		'minTransferTime':         'Umstiegszeit (Minuten)',
+		'trainType':               'Zugtyp',
+		'close':                   'Schließen',
+		'price':                   'Preis',
+		'refresh':                 'Aktualisieren',
+		'back':                    'Zurück',
 	},
 
 	'nl': {
-		'backendLang':           'nl',
-		'accessibility':         'Toegankelijkheid',
-		'accessibilityNone':     'Geen beperkingen',
-		'accessibilityPartial':  'Beperkt toegankelijk',
-		'accessibilityComplete': 'Toegankelijk',
-		'arrival':            'Aankomst',
-		'bus':                'Bus',
-		'cancelled':          'Rit geannuleerd',
-		'changeinfo':         '{} overstaptijd',
-		'changes':            'Overstappen',
-		'clearstorage':       'Lokale gegevens wissen',
-		'datasource':         'Gegevensbron',
-		'date':               'Datum',
-		'de':                 'Duits',
-		'departure':          'Vertrek',
-		'duration':           'Duur',
-		'planned':            'gepland',
-		'dzug':               'Sneltrein',
-		'en':                 'Engels',
-		'ferry':              'Veerboot',
-		'from':               'Van',
-		'iceonly':            'ICE',
-		'iconly':             'IC',
-		'journeyoverview':    'Toon verbindingsoverzicht',
-		'earlier':            'Vroegere verbindingen',
-		'later':              'Latere verbindingen',
-		'language':           'Taal',
-		'lastjourney':        'Laatste gekozen verbinding tonen',
-		'longdistancetrain':  'Lange-afstandverkeer',
-		'nl':                 'Nederlands',
-		'optional':           '(optioneel)',
-		'options':            'Opties',
-		'platform':           'Spoor',
-		'products':           'Producten',
-		'regionaltrain':      'Regionaal verkeer',
-		'remarks':            'Opmerkingen',
-		'save':               'Opslaan',
-		'search':             'Zoeken',
-		'setfromto':          'Als Van/Naar zetten',
-		'settings':           'Instellingen',
-		'showDS100':          'RIL100-afkortingen tonen (indien aanwezig)',
-		'station':            'Station',
-		'suburbantrain':      'S-trein',
-		'subway':             'Metro',
-		'swap':               'Van/Naar omkeren',
-		'taxi':               'Taxi',
-		'time':               'Tijd',
-		'to':                 'Naar',
-		'tram':               'Tram',
-		'transferinfo':       'Reis naar {}',
-		'update':             'Applicatie updaten',
-		'via':                'Over',
-		'walkinfo':           'Ga naar {}',
-		'walkinfoMeters':     'Ga naar {} (ong. {} meter)',
-		'load-low-to-medium': 'Niet druk',
-		'load-high':          'Druk',
-		'load-very-high':     'Zéér druk',
+		'backendLang':             'nl',
+		'en':                      'Engels',
+		'de':                      'Duits',
+		'nl':                      'Nederlands',
+		'language':                'Taal',
+		'accessibility':           'Toegankelijkheid',
+		'accessibilityNone':       'Geen beperkingen',
+		'accessibilityPartial':    'Beperkt toegankelijk',
+		'accessibilityComplete'  : 'Toegankelijk',
+		'departure':               'Vertrek',
+		'arrival':                 'Aankomst',
+		'cancelled':               'Rit geannuleerd',
+		'changeinfo':              '{} overstaptijd',
+		'changes':                 'Overstappen',
+		'clearstorage':            'Lokale gegevens wissen',
+		'datasource':              'Gegevensbron',
+		'date':                    'Datum',
+		'time':                    'Tijd',
+		'duration':                'Duur',
+		'planned':                 'gepland',
+		'dzug':                    'Sneltrein',
+		'longdistancetrain':       'Lange-afstandverkeer',
+		'regionaltrain':           'Regionaal verkeer',
+		'iceonly':                 'ICE',
+		'iconly':                  'IC',
+		'suburbantrain':           'S-trein',
+		'subway':                  'Metro',
+		'tram':                    'Tram',
+		'bus':                     'Bus',
+		'taxi':                    'Taxi',
+		'ferry':                   'Veerboot',
+		'from':                    'Van',
+		'to':                      'Naar',
+		'journeyoverview':         'Toon verbindingsoverzicht',
+		'earlier':                 'Vroegere verbindingen',
+		'later':                   'Latere verbindingen',
+		'lastjourney':             'Laatste gekozen verbinding tonen',
+		'optional':                '(optioneel)',
+		'options':                 'Opties',
+		'platform':                'Spoor',
+		'products':                'Producten',
+		'remarks':                 'Opmerkingen',
+		'search':                  'Zoeken',
+		'setfromto':               'Als Van/Naar zetten',
+		'settings':                'Instellingen',
+		'station':                 'Station',
+		'swap':                    'Van/Naar omkeren',
+		'transferinfo':            'Reis naar {}',
+		'via':                     'Over',
+		'walkinfo':                'Ga naar {}',
+		'walkinfoMeters':          'Ga naar {} (ong. {} meter)',
+		'load-low-to-medium':      'Niet druk',
+		'load-high':               'Druk',
+		'load-very-high':          'Zéér druk',
 		'load-exceptionally-high': 'Extreem druk',
-		'tableView':          'Tabel',
-		'showPrices':         'Prijzen tonen',
+		'tableView':               'Tabel',
+		'showDS100':               'RIL100-afkortingen tonen (indien aanwezig)',
+		'showPrices':              'Prijzen tonen',
 	},
-
-	'en': {
-		'backendLang':           'en',
-		'accessibility':         'Accessibillity',
-		'accessibilityNone':     'none',
-		'accessibilityPartial':  'partial',
-		'accessibilityComplete': 'full',
-		'arrival':           'Arrival',
-		'bus':               'Bus',
-		'cancelled':         'Cancelled!',
-		'changeinfo':        '{} change duration',
-		'changes':           'Changes',
-		'clearstorage':      'Remove local data',
-		'datasource':        'Data source',
-		'date':              'Date',
-		'de':                'German',
-		'departure':         'Departure',
-		'duration':          'Duration',
-		'planned':           'planned',
-		'dzug':              'D-Zug',
-		'en':                'English',
-		'ferry':             'Ferry',
-		'from':              'From',
-		'iceonly':           'ICE',
-		'iconly':            'IC',
-		'journeyoverview':   'Go to journeysoverview',
-		'earlier':           'Earlier connections',
-		'later':             'Later connections',
-		'language':          'Language',
-		'lastjourney':       'Go to last selected journey',
-		'longdistancetrain': 'Long distance trains',
-		'nl':                'Dutch',
-		'optional':          '(optional)',
-		'options':           'Options',
-		'platform':          'Platform',
-		'products':          'Products',
-		'regionaltrain':     'Regional trains',
-		'remarks':           'Remarks',
-		'save':              'Save',
-		'search':            'Search',
-		'setfromto':         'Set as from/to',
-		'settings':          'Settings',
-		'showDS100':         'Show DS100 (if available)',
-		'station':           'Station',
-		'suburbantrain':     'Suburban Trains',
-		'subway':            'Subway',
-		'swap':              'Swap from/to',
-		'taxi':              'Taxi',
-		'time':              'Time',
-		'to':                'To',
-		'tram':              'Tram',
-		'transferinfo':      'Travel to {}',
-		'update':            'Update application',
-		'via':               'Via',
-		'walkinfo':          'Walk to {}',
-		'walkinfoMeters':    'Walk to {} (apprx. {} meters)',
-		'load-low-to-medium': 'Low to medium load',
-		'load-high':         'High load',
-		'load-very-high':    'Very high load',
-		'load-exceptionally-high': 'Exceptionally high load',
-		'tableView':         'Table',
-		'canvasView':        'Graphical',
-		'showPrices ':       'Show prices',
-		'price':             'Price',
-		'back':              'Back',
-		'refresh':           'Refresh data',
-		'combineDateTime':   'Use combined DateTime-input',
-		'titleSetDateTimeNow': 'Set Date & Time to now',
-		'titleBikeFriendly':   'Bicycle transport possible',
-		'loyaltyCard':         'Discount card',
-		'loyaltyCardNone':     'No discount card',
-		'class':               'Class',
-		'titleNoTransfers':    'only direct connections',
-		'lastSelectedJourney': 'Last selected journey',
-		'walkingSpeed':        'Walking speed',
-		'walkingSpeedSlow':    'slow',
-		'walkingSpeedNormal':  'normal',
-		'walkingSpeedFast':    'fast',
-		'shareURL':            'Share URL',
-		'copyURL':             'Copy URL',
-		'ageGroup':            'Age group',
-		'ageGroupChild':       'Child',
-		'ageGroupYoung':       'Young',
-		'ageGroupAdult':       'Adult',
-		'ageGroupSenior':      'Senior',
-		'tickets':             'Tickets',
-		'now':                 'Now',
-		'minTransferTime':     'Transfer time (Minutes)',
-		'trainType':           'Train type',
-		'close':               'Close'
-	}
 };