-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d773eac
commit 55343e1
Showing
9 changed files
with
121 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import type { Translations } from './translation'; | ||
|
||
const translations: Translations = { | ||
from: 'Von', | ||
to: 'Nach', | ||
arrival: 'Ankunft', | ||
departure: 'Abfahrt', | ||
duration: 'Dauer', | ||
arrivals: 'Ankünfte', | ||
departures: 'Abfahrten', | ||
later: 'später', | ||
earlier: 'früher', | ||
track: 'Gleis', | ||
arrivalOnTrack: 'Ankunft auf Gleis', | ||
switchToArrivals: 'Wechsel zu Ankünften', | ||
switchToDepartures: 'Wechsel zu Abfahrten', | ||
tripIntermediateStops: (n: number) => { | ||
switch (n) { | ||
case 0: | ||
return 'Fahrt ohne Zwischenhalt'; | ||
case 1: | ||
return 'Fahrt eine Station'; | ||
default: | ||
return `Fahrt ${n} Stationen`; | ||
} | ||
}, | ||
sharingProvider: 'Anbieter' | ||
}; | ||
|
||
export default translations; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import type { Translations } from './translation'; | ||
|
||
const translations: Translations = { | ||
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { browser } from '$app/environment'; | ||
import en from './en'; | ||
import de from './de'; | ||
|
||
export type Translations = { | ||
from: string; | ||
to: string; | ||
arrival: string; | ||
departure: string; | ||
duration: string; | ||
later: string; | ||
earlier: string; | ||
arrivals: string; | ||
departures: string; | ||
switchToArrivals: string; | ||
switchToDepartures: string; | ||
arrivalOnTrack: string; | ||
track: string; | ||
tripIntermediateStops: (n: number) => string; | ||
sharingProvider: string; | ||
}; | ||
|
||
const translations: Map<string, Translations> = new Map( | ||
Object.entries({ | ||
en, | ||
de | ||
}) | ||
); | ||
|
||
export const language = (browser ? navigator.languages.find((l) => l.length == 2) : 'en') ?? 'en'; | ||
export const t = translations.get(language) ?? en; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters