From cc544322b246067e7feb35c159285a562bd09cf0 Mon Sep 17 00:00:00 2001 From: Pascal Syma Date: Wed, 20 Aug 2025 23:18:40 +0200 Subject: [PATCH] Switch to translatable data --- .github/workflows/docker.yml | 14 +++++ TODO.md | 2 +- app/components/QuestTags.vue | 8 ++- app/components/admin/Answer.vue | 25 ++++++-- app/components/admin/Team.vue | 3 + app/composables/useI18nKey.ts | 51 ++++++++++++++++ app/lang/de.json | 2 +- app/lang/en.json | 2 +- .../hunt/[huntSlug]/[questSlug]/admin.vue | 15 +++-- .../hunt/[huntSlug]/[questSlug]/index.vue | 51 ++++++++++------ app/pages/hunt/[huntSlug]/admin.vue | 34 ++++++++--- app/pages/hunt/[huntSlug]/diashow.vue | 5 +- app/pages/hunt/[huntSlug]/index.vue | 43 +++++++++----- app/pages/hunt/[huntSlug]/pictures.vue | 11 ++-- app/pages/hunt/[huntSlug]/showcase.vue | 17 ++++-- app/pages/hunt/[huntSlug]/teams.vue | 5 +- app/pages/index.vue | 22 +++---- app/pages/profile.vue | 15 +++-- nuxt.config.ts | 2 +- package.json | 1 + .../migration.sql | 57 ++++++++++++++++++ prisma/schema.prisma | 32 ++++++---- prisma/seed/hunt.ts | 58 +++++++++++++------ server/api/admin/hunt/[huntId]/index.get.ts | 6 +- server/api/admin/hunt/[huntId]/index.post.ts | 6 +- server/api/admin/hunt/[huntId]/teams.get.ts | 3 +- server/api/admin/quest/[questId]/index.get.ts | 4 +- server/api/admin/team/[teamId]/kick.post.ts | 2 +- server/api/auth/profile.get.ts | 6 +- server/api/home.get.ts | 12 ++-- server/api/hunt/[huntId]/diashow.get.ts | 6 +- server/api/hunt/[huntId]/index.get.ts | 12 ++-- server/api/hunt/[huntId]/showcase.get.ts | 9 ++- server/api/quest/[questId]/index.get.ts | 15 +++-- server/api/quest/[questId]/submit.post.ts | 13 +++-- shared/utils/flag.ts | 8 +++ 36 files changed, 431 insertions(+), 146 deletions(-) create mode 100644 app/composables/useI18nKey.ts create mode 100644 prisma/migrations/20250820190359_add_i18n_to_models/migration.sql create mode 100644 shared/utils/flag.ts diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7b895db..7468245 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -6,7 +6,21 @@ on: branches: ['main'] jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install bun + uses: oven-sh/setup-bun@v2 + - name: Install dependencies + run: bun install --include=dev + - name: Check formatting + run: bun run check + - name: Run tests + run: bun run test deploy: + needs: test permissions: contents: read packages: write diff --git a/TODO.md b/TODO.md index 4c48284..5878d19 100644 --- a/TODO.md +++ b/TODO.md @@ -31,7 +31,7 @@ - [x] Image Diashow - **Hunt User** - [x] View all images on one page - - [ ] i18n data + - [x] i18n data - [ ] Mark image as private - [ ] How-to/Guide/Good explanation - [ ] Leave/Remove/Edit team diff --git a/app/components/QuestTags.vue b/app/components/QuestTags.vue index e4a1a40..5a2cbbd 100644 --- a/app/components/QuestTags.vue +++ b/app/components/QuestTags.vue @@ -1,7 +1,10 @@