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

@ -28,7 +28,7 @@
class="px-2 py-1 rounded bg-zinc-900/80 backdrop-blur-sm transition text-sm/6 font-semibold text-zinc-400 hover:text-zinc-100 inline-flex gap-x-2 items-center duration-200 hover:scale-105"
>
<ArrowLeftIcon class="h-4 w-4" aria-hidden="true" />
Back to News
{{ $t("news.back") }}
</NuxtLink>
<button
@ -37,7 +37,7 @@
@click="() => (currentlyDeleting = article)"
>
<TrashIcon class="h-4 w-4" aria-hidden="true" />
Delete Article
{{ $t("news.delete") }}
</button>
</div>
@ -91,6 +91,7 @@ const route = useRoute();
const currentlyDeleting = ref();
const user = useUser();
const news = useNews();
const { t } = useI18n();
if (!news.value) {
news.value = await fetchNews();
}
@ -100,7 +101,7 @@ const article = computed(() =>
if (!article.value)
throw createError({
statusCode: 404,
statusMessage: "Article not found",
statusMessage: t("news.notFound"),
fatal: true,
});

View File

@ -4,10 +4,10 @@
<div class="flex flex-col gap-y-4">
<div>
<h2 class="text-2xl font-bold font-display text-zinc-100">
Latest News
{{ $t("news.title") }}
</h2>
<p class="mt-2 text-zinc-400">
Stay up to date with the latest updates and announcements.
{{ $t("news.subheader") }}
</p>
</div>
</div>
@ -49,7 +49,7 @@
:datetime="article.publishedAt"
class="text-sm text-zinc-400"
>
{{ formatDate(article.publishedAt) }}
{{ $d(new Date(article.publishedAt), "short") }}
</time>
<span class="text-sm text-blue-400">{{
article.author?.displayName ?? "System"
@ -73,8 +73,10 @@
<div v-if="articles?.length === 0" class="text-center py-12">
<DocumentIcon class="mx-auto h-12 w-12 text-zinc-400" />
<h3 class="mt-2 text-sm font-semibold text-zinc-100">No articles</h3>
<p class="mt-1 text-sm text-zinc-500">Check back later for updates.</p>
<h3 class="mt-2 text-sm font-semibold text-zinc-100">
{{ $t("news.none") }}
</h3>
<p class="mt-1 text-sm text-zinc-500">{{ $t("news.checkLater") }}</p>
</div>
</div>
</template>
@ -84,6 +86,8 @@ import { DocumentIcon } from "@heroicons/vue/24/outline";
import type { Article } from "~/prisma/client";
import type { SerializeObject } from "nitropack/types";
const { t } = useI18n();
const { articles } = defineProps<{
articles: SerializeObject<
Article & {
@ -93,16 +97,8 @@ const { articles } = defineProps<{
>[];
}>();
const formatDate = (date: string) => {
return new Date(date).toLocaleDateString("en-AU", {
year: "numeric",
month: "long",
day: "numeric",
});
};
useHead({
title: "News",
title: t("userHeader.links.news"),
});
</script>