i18n Support and Task improvements (#80)

* fix: release workflow

* feat: move mostly to internal tasks system

* feat: migrate object clean to new task system

* fix: release not  getting good base version

* chore: set version v0.3.0

* chore: style

* feat: basic task concurrency

* feat: temp pages to fill in page links

* feat: inital i18n support

* feat: localize store page

* chore: style

* fix: weblate doesn't like multifile thing

* fix: update nuxt

* feat: improved error logging

* fix: using old task api

* feat: basic translation docs

* feat: add i18n eslint plugin

* feat: translate store and auth pages

* feat: more translation progress

* feat: admin dash i18n progress

* feat: enable update check by default in prod

* fix: using wrong i18n keys

* fix: crash in library sources page

* feat: finish i18n work

* fix: missing i18n translations

* feat: use twemoji for emojis

* feat: sanatize object ids

* fix: EmojiText's alt text

* fix: UserWidget not using links

* feat: cache and auth for emoji api

* fix: add more missing translations
This commit is contained in:
Husky
2025-06-04 19:53:30 -04:00
committed by GitHub
parent c7fab132ab
commit 681efe95af
86 changed files with 5175 additions and 2816 deletions

View File

@ -8,13 +8,12 @@ const props = defineProps({
},
});
const { t } = useI18n();
const route = useRoute();
const user = useUser();
const statusCode = props.error?.statusCode;
const message =
props.error?.statusMessage ||
props.error?.message ||
"An unknown error occurred.";
props.error?.message || props.error?.statusMessage || t("errors.unknown");
const showSignIn = statusCode ? statusCode == 403 || statusCode == 401 : false;
async function signIn() {
@ -24,7 +23,7 @@ async function signIn() {
}
useHead({
title: `${statusCode ?? message} | Drop`,
title: t("errors.pageTitle", [statusCode ?? message]),
});
if (import.meta.client) {
@ -51,7 +50,7 @@ if (import.meta.client) {
<h1
class="mt-4 text-3xl font-bold font-display tracking-tight text-zinc-100 sm:text-5xl"
>
Oh no!
{{ $t("errors.ohNo") }}
</h1>
<p
v-if="message"
@ -60,24 +59,32 @@ if (import.meta.client) {
{{ message }}
</p>
<p class="mt-6 text-base leading-7 text-zinc-400">
An error occurred while responding to your request. If you believe
this to be a bug, please report it. Try signing in and see if it
resolves the issue.
{{ $t("errors.occurred") }}
</p>
<!-- <p>{{ error. }}</p> -->
<div class="mt-10">
<!-- full app reload to fix errors -->
<NuxtLink
v-if="user && !showSignIn"
to="/"
class="text-sm font-semibold leading-7 text-blue-600"
><span aria-hidden="true">&larr;</span> Back to home</NuxtLink
>
<i18n-t keypath="errors.backHome" tag="span" scope="global">
<template #arrow>
<span aria-hidden="true">{{ $t("chars.arrowBack") }}</span>
</template>
</i18n-t>
</NuxtLink>
<button
v-else
class="text-sm font-semibold leading-7 text-blue-600"
@click="signIn"
>
Sign in <span aria-hidden="true">&rarr;</span>
<i18n-t keypath="errors.signIn" tag="span" scope="global">
<template #arrow>
<span aria-hidden="true">{{ $t("chars.arrow") }}</span>
</template>
</i18n-t>
</button>
</div>
</div>
@ -87,7 +94,7 @@ if (import.meta.client) {
<nav
class="mx-auto flex w-full max-w-7xl items-center gap-x-4 px-6 text-sm leading-7 text-zinc-400 lg:px-8"
>
<NuxtLink href="/docs">Documentation</NuxtLink>
<NuxtLink href="/docs">{{ $t("footer.documentation") }}</NuxtLink>
<svg
viewBox="0 0 2 2"
aria-hidden="true"
@ -96,7 +103,7 @@ if (import.meta.client) {
<circle cx="1" cy="1" r="1" />
</svg>
<NuxtLink to="https://discord.gg/NHx46XKJWA" target="_blank">
Support Discord
{{ $t("errors.support") }}
</NuxtLink>
</nav>
</div>