Change application language to English
This commit is contained in:
parent
964b1ea994
commit
e9e72d8cea
7 changed files with 45 additions and 46 deletions
1
index.ts
1
index.ts
|
|
@ -1 +0,0 @@
|
||||||
console.log("Hello via Bun!");
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -8,14 +8,14 @@ export const Clock = () => {
|
||||||
return () => clearInterval(timer);
|
return () => clearInterval(timer);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const timeStr = time.toLocaleTimeString('sv-SE', {
|
const timeStr = time.toLocaleTimeString('en-GB', {
|
||||||
hour: '2-digit',
|
hour: '2-digit',
|
||||||
minute: '2-digit',
|
minute: '2-digit',
|
||||||
second: '2-digit',
|
second: '2-digit',
|
||||||
hour12: false
|
hour12: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const dateStr = time.toLocaleDateString('sv-SE', {
|
const dateStr = time.toLocaleDateString('en-GB', {
|
||||||
weekday: 'long',
|
weekday: 'long',
|
||||||
day: 'numeric',
|
day: 'numeric',
|
||||||
month: 'long'
|
month: 'long'
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { Departure } from '../../types';
|
||||||
export const DepartureItem = ({ departure }: { departure: Departure }) => {
|
export const DepartureItem = ({ departure }: { departure: Departure }) => {
|
||||||
const depTime = new Date(departure.scheduled);
|
const depTime = new Date(departure.scheduled);
|
||||||
const diffMin = Math.round((depTime.getTime() - Date.now()) / 60000);
|
const diffMin = Math.round((depTime.getTime() - Date.now()) / 60000);
|
||||||
const timeText = diffMin <= 0 ? 'Nu' : `${diffMin} min`;
|
const timeText = diffMin <= 0 ? 'Now' : `${diffMin} min`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex justify-between items-center px-5 py-4 bg-surface rounded-xl text-3xl font-medium transition hover:bg-zinc-800">
|
<div className="flex justify-between items-center px-5 py-4 bg-surface rounded-xl text-3xl font-medium transition hover:bg-zinc-800">
|
||||||
|
|
|
||||||
|
|
@ -39,12 +39,12 @@ export const SearchBox = ({ onSelect }: SearchBoxProps) => {
|
||||||
onClick={search}
|
onClick={search}
|
||||||
className="bg-sl-blue px-8 py-4 rounded-xl font-bold text-xl hover:brightness-110 active:scale-95 transition-all"
|
className="bg-sl-blue px-8 py-4 rounded-xl font-bold text-xl hover:brightness-110 active:scale-95 transition-all"
|
||||||
>
|
>
|
||||||
Sök
|
Search
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mt-8 flex flex-col gap-3">
|
<div className="mt-8 flex flex-col gap-3">
|
||||||
{loading && <div className="p-6 bg-surface rounded-xl animate-pulse text-xl">Söker...</div>}
|
{loading && <div className="p-6 bg-surface rounded-xl animate-pulse text-xl">Searching...</div>}
|
||||||
{!loading && results.map((stop) => (
|
{!loading && results.map((stop) => (
|
||||||
<div
|
<div
|
||||||
key={stop.id}
|
key={stop.id}
|
||||||
|
|
@ -56,7 +56,7 @@ export const SearchBox = ({ onSelect }: SearchBoxProps) => {
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
{!loading && query && results.length === 0 && (
|
{!loading && query && results.length === 0 && (
|
||||||
<div className="p-6 bg-surface rounded-xl text-gray-500 text-xl">Inga stationer hittades.</div>
|
<div className="p-6 bg-surface rounded-xl text-gray-500 text-xl">No stations found.</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ export const Settings = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const handleSelect = async (stop: StopLocation) => {
|
const handleSelect = async (stop: StopLocation) => {
|
||||||
if (!confirm(`Vill du byta station till "${stop.name}"?`)) return;
|
if (!confirm(`Do you want to change the station to "${stop.name}"?`)) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/api/config', {
|
const response = await fetch('/api/config', {
|
||||||
|
|
@ -19,7 +19,7 @@ export const Settings = () => {
|
||||||
navigate('/');
|
navigate('/');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert('Kunde inte spara inställningarna.');
|
alert('Could not save settings.');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -29,12 +29,12 @@ export const Settings = () => {
|
||||||
<Link to="/" className="text-4xl text-gray-500 hover:text-white transition-colors">
|
<Link to="/" className="text-4xl text-gray-500 hover:text-white transition-colors">
|
||||||
←
|
←
|
||||||
</Link>
|
</Link>
|
||||||
<h1 className="text-5xl font-bold">Inställningar</h1>
|
<h1 className="text-5xl font-bold">Settings</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="max-w-4xl w-full mx-auto">
|
<div className="max-w-4xl w-full mx-auto">
|
||||||
<h2 className="text-2xl text-gray-400 mb-8 px-4 font-medium uppercase tracking-widest">
|
<h2 className="text-2xl text-gray-400 mb-8 px-4 font-medium uppercase tracking-widest">
|
||||||
Sök efter din station
|
Search for your station
|
||||||
</h2>
|
</h2>
|
||||||
<SearchBox onSelect={handleSelect} />
|
<SearchBox onSelect={handleSelect} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ app.use((req, res, next) => {
|
||||||
|
|
||||||
res.send(`
|
res.send(`
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="sv">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue