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);
|
||||
}, []);
|
||||
|
||||
const timeStr = time.toLocaleTimeString('sv-SE', {
|
||||
const timeStr = time.toLocaleTimeString('en-GB', {
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit',
|
||||
hour12: false
|
||||
});
|
||||
|
||||
const dateStr = time.toLocaleDateString('sv-SE', {
|
||||
const dateStr = time.toLocaleDateString('en-GB', {
|
||||
weekday: 'long',
|
||||
day: 'numeric',
|
||||
month: 'long'
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { Departure } from '../../types';
|
|||
export const DepartureItem = ({ departure }: { departure: Departure }) => {
|
||||
const depTime = new Date(departure.scheduled);
|
||||
const diffMin = Math.round((depTime.getTime() - Date.now()) / 60000);
|
||||
const timeText = diffMin <= 0 ? 'Nu' : `${diffMin} min`;
|
||||
const timeText = diffMin <= 0 ? 'Now' : `${diffMin} min`;
|
||||
|
||||
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">
|
||||
|
|
|
|||
|
|
@ -39,12 +39,12 @@ export const SearchBox = ({ onSelect }: SearchBoxProps) => {
|
|||
onClick={search}
|
||||
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>
|
||||
</div>
|
||||
|
||||
<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) => (
|
||||
<div
|
||||
key={stop.id}
|
||||
|
|
@ -56,7 +56,7 @@ export const SearchBox = ({ onSelect }: SearchBoxProps) => {
|
|||
</div>
|
||||
))}
|
||||
{!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>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ export const Settings = () => {
|
|||
const navigate = useNavigate();
|
||||
|
||||
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 {
|
||||
const response = await fetch('/api/config', {
|
||||
|
|
@ -19,7 +19,7 @@ export const Settings = () => {
|
|||
navigate('/');
|
||||
}
|
||||
} 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>
|
||||
<h1 className="text-5xl font-bold">Inställningar</h1>
|
||||
<h1 className="text-5xl font-bold">Settings</h1>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
Sök efter din station
|
||||
Search for your station
|
||||
</h2>
|
||||
<SearchBox onSelect={handleSelect} />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ app.use((req, res, next) => {
|
|||
|
||||
res.send(`
|
||||
<!DOCTYPE html>
|
||||
<html lang="sv">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
|
|
|||
Loading…
Reference in a new issue