Skip to content

Commit ebdb14f

Browse files
authored
update styling and add world map (#29)
* feat:add world map for country selection * feat:include map in modals, country in db * feat: allow to navigate back in modals * feat: update styling of modals * enhance: update styling of landing page, global * enhance: update styling of about page * enhance: update styling, fix minor issues * enhance: redirect after submission * fix: redirect working again but css broken with new postcss import * design: update layout, work with tailwind v4 * design: navbar now finally working as intended, also on mobile * design: update cards on landing page * language: add first french translation * translations: FAQ and others * translation: add donation page * feat: update flow of variable passing and set disclosure acceptance * feat: commit lockfile * fix: correct detected vulnerabilities in the setup * fix: remove ssh_config line again * fix: missing playwright, comments in files * fix: typo in FAQ * fix: test and logging
1 parent 6c89320 commit ebdb14f

43 files changed

Lines changed: 2367 additions & 4012 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/frontend-CI.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ jobs:
3535
run: |
3636
cd src/frontend
3737
pnpm install
38-
- name: run basic tests typescript
38+
39+
- name: Generate SvelteKit files
3940
run: |
4041
cd src/frontend
41-
pnpm install
42-
pnpm run test:unit
43-
42+
pnpm svelte-kit sync
43+
4444
- name: Install Playwright Browsers and run tests
4545
run: |
4646
cd src/frontend

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ This is the webserver for email donation.
33

44
*This project is currently under development!*
55

6+
The frontend uses the svg world map by [behodgson](https://github.com/benhodgson/markedup-svg-worldmap) (Creative Commons Legal Code Attribution-ShareAlike 3.0 Unported).
67

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ services:
3333
- '3306'
3434
volumes:
3535
- my-db:/var/lib/mysql
36+
sysctls:
37+
- net.ipv4.tcp_timestamps=0
3638

3739
volumes:
3840
my-db:

src/frontend/drizzle.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { defineConfig } from "drizzle-kit";
2-
import 'dotenv/config';
2+
import { config } from "dotenv";
3+
4+
config({ path: ".env" });
35

46
export default defineConfig({
57
dialect: 'mysql',

src/frontend/i18n-README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Internationalization (i18n) Setup
2+
3+
This project now includes internationalization support with English and French translations.
4+
5+
## Features
6+
7+
- **Language switcher** in the navigation bar
8+
- **Automatic language detection** from browser preferences
9+
- **Persistent language selection** stored in localStorage
10+
- **Fallback system** to English if translations are missing
11+
- **Type-safe translations** with TypeScript support
12+
13+
## Usage
14+
15+
### In Svelte components:
16+
17+
```svelte
18+
<script>
19+
import { t } from '$lib/i18n';
20+
</script>
21+
22+
<!-- Use reactive translations -->
23+
<h1>{$t.homepage.title}</h1>
24+
<p>{$t.nav.about}</p>
25+
```
26+
27+
### Adding new translations:
28+
29+
1. Edit `src/lib/i18n/translations.ts`
30+
2. Add new keys to both `en` and `fr` objects
31+
3. The TypeScript types will automatically update
32+
33+
### Example translation structure:
34+
35+
```typescript
36+
export const translations = {
37+
en: {
38+
nav: {
39+
about: 'Information',
40+
contact: 'Kontakt'
41+
},
42+
homepage: {
43+
title: 'Willkommen',
44+
subtitle: 'Dies ist unsere Webseite'
45+
}
46+
},
47+
fr: {
48+
nav: {
49+
about: 'À propos',
50+
contact: 'Contact'
51+
},
52+
homepage: {
53+
title: 'Bienvenue',
54+
subtitle: 'Ceci est notre site web'
55+
}
56+
}
57+
};
58+
```
59+
60+
## Components
61+
62+
- **LanguageSwitcher**: Dropdown component for switching languages
63+
- **Location**: `src/lib/components/LanguageSwitcher.svelte`
64+
65+
## Language Support
66+
67+
Currently supported languages:
68+
- German (de) - Default
69+
- Français (fr)
70+
71+
## Implementation Details
72+
73+
- Language preference is stored in `localStorage`
74+
- Falls back to browser language detection
75+
- Uses Svelte stores for reactive updates
76+
- Includes TypeScript types for all translation keys
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ describe('sum test', () => {
44
it('adds 1 + 2 to equal 3', () => {
55
expect(1 + 2).toBe(3);
66
});
7-
});
7+
});

src/frontend/package.json

Lines changed: 26 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -23,63 +23,34 @@
2323
"gh-pages": "npm run build && npx gh-pages -d build"
2424
},
2525
"devDependencies": {
26-
"@playwright/test": "^1.50.1",
27-
"@sveltejs/adapter-auto": "^4.0.0",
28-
"@sveltejs/adapter-node": "^5.2.12",
29-
"@sveltejs/kit": "^2.20.6",
30-
"@typescript-eslint/eslint-plugin": "^8.24.1",
31-
"@typescript-eslint/parser": "^8.24.1",
32-
"autoprefixer": "^10.4.20",
33-
"drizzle-kit": "^0.30.5",
34-
"eslint": "^9.20.1",
35-
"eslint-config-prettier": "^10.0.1",
36-
"eslint-plugin-svelte3": "^4.0.0",
37-
"gh-pages": "^6.3.0",
38-
"postcss": "^8.5.3",
39-
"postcss-load-config": "^6.0.1",
40-
"prettier": "^3.5.1",
41-
"prettier-plugin-svelte": "^3.3.3",
42-
"svelte": "^5.20.2",
43-
"svelte-check": "^4.1.4",
26+
"@playwright/test": "^1.57.0",
27+
"@sveltejs/adapter-auto": "^6.0.1",
28+
"@sveltejs/kit": "^2.27.0",
29+
"@sveltejs/vite-plugin-svelte": "^6.1.0",
30+
"autoprefixer": "^10.4.21",
31+
"dotenv": "^17.2.1",
32+
"drizzle-kit": "^0.31.8",
33+
"drizzle-orm": "^0.44.4",
34+
"flowbite": "^3.1.2",
35+
"flowbite-svelte": "^1.11.2",
36+
"flowbite-svelte-blocks": "^2.1.0",
37+
"flowbite-svelte-icons": "^2.2.1",
38+
"flowbite-typography": "^1.0.5",
39+
"mysql2": "^3.14.3",
40+
"postcss": "^8.5.6",
41+
"prettier": "^3.6.2",
42+
"prettier-plugin-svelte": "^3.4.0",
43+
"svelte": "^5.37.3",
44+
"svelte-check": "^4.3.1",
4445
"svelte-preprocess": "^6.0.3",
45-
"tailwindcss": "^3.4.17",
46+
"tailwindcss": "^4.1.11",
4647
"tslib": "^2.8.1",
47-
"typescript": "^5.7.3",
48-
"vite": "^6.1.6",
49-
"vitest": "^3.0.6"
48+
"typescript": "^5.9.2",
49+
"vite": "^7.0.6",
50+
"vitest": "^3.2.4"
5051
},
5152
"dependencies": {
52-
"@dotenvx/dotenvx": "^1.39.0",
53-
"@popperjs/core": "^2.11.8",
54-
"@sveltejs/vite-plugin-svelte": "^5.0.3",
55-
"classnames": "^2.5.1",
56-
"dotenv": "^16.4.7",
57-
"drizzle-orm": "^0.40.0",
58-
"flowbite": "^3.1.2",
59-
"flowbite-svelte": "^0.47.4",
60-
"flowbite-svelte-icons": "^2.0.2",
61-
"globrex": "^0.1.2",
62-
"mdsvex": "^0.12.3",
63-
"mysql2": "^3.13.0",
64-
"node": "^23.8.0",
65-
"pnpm": "^10.4.1",
66-
"rehype-slug": "^6.0.0",
67-
"remark-toc": "^9.0.0",
68-
"svelte-awesome-icons": "^2.0.1"
53+
"@tailwindcss/vite": "^4.1.11"
6954
},
70-
"packageManager": "pnpm@10.6.3+sha512.bb45e34d50a9a76e858a95837301bfb6bd6d35aea2c5d52094fa497a467c43f5c440103ce2511e9e0a2f89c3d6071baac3358fc68ac6fb75e2ceb3d2736065e6",
71-
"pnpm": {
72-
"ignoredBuiltDependencies": [
73-
"@sveltejs/kit",
74-
"esbuild",
75-
"node",
76-
"svelte-preprocess"
77-
],
78-
"onlyBuiltDependencies": [
79-
"@sveltejs/kit",
80-
"esbuild",
81-
"node",
82-
"svelte-preprocess"
83-
]
84-
}
85-
}
55+
"packageManager": "pnpm@10.6.3"
56+
}

0 commit comments

Comments
 (0)