i18n: internationalize all admin pages
Add full i18n coverage for the admin section — locale keys, layout nav, users, videos, and articles pages (list, new, edit). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
<script lang="ts">
|
||||
import { page } from "$app/state";
|
||||
import { _ } from "svelte-i18n";
|
||||
|
||||
const { children } = $props();
|
||||
|
||||
const navLinks = [
|
||||
{ name: "Users", href: "/admin/users", icon: "icon-[ri--team-line]" },
|
||||
{ name: "Videos", href: "/admin/videos", icon: "icon-[ri--film-line]" },
|
||||
{ name: "Articles", href: "/admin/articles", icon: "icon-[ri--article-line]" },
|
||||
];
|
||||
const navLinks = $derived([
|
||||
{ name: $_("admin.nav.users"), href: "/admin/users", icon: "icon-[ri--team-line]" },
|
||||
{ name: $_("admin.nav.videos"), href: "/admin/videos", icon: "icon-[ri--film-line]" },
|
||||
{ name: $_("admin.nav.articles"), href: "/admin/articles", icon: "icon-[ri--article-line]" },
|
||||
]);
|
||||
|
||||
function isActive(href: string) {
|
||||
return page.url.pathname.startsWith(href);
|
||||
@@ -20,7 +21,7 @@
|
||||
<!-- Mobile top nav -->
|
||||
<div class="lg:hidden flex items-center gap-2 py-3 border-b border-border/40">
|
||||
<a href="/" class="text-xs text-muted-foreground hover:text-foreground transition-colors shrink-0 mr-2">
|
||||
← Back
|
||||
{$_("admin.nav.back_mobile")}
|
||||
</a>
|
||||
{#each navLinks as link (link.href)}
|
||||
<a
|
||||
@@ -43,9 +44,9 @@
|
||||
<aside class="hidden lg:flex w-56 shrink-0 flex-col border-r border-border/40">
|
||||
<div class="px-4 py-5 border-b border-border/40">
|
||||
<a href="/" class="text-xs text-muted-foreground hover:text-foreground transition-colors">
|
||||
← Back to site
|
||||
{$_("admin.nav.back_to_site")}
|
||||
</a>
|
||||
<h1 class="mt-2 text-base font-bold text-foreground">Admin</h1>
|
||||
<h1 class="mt-2 text-base font-bold text-foreground">{$_("admin.nav.title")}</h1>
|
||||
</div>
|
||||
|
||||
<nav class="flex-1 p-3 space-y-1">
|
||||
|
||||
Reference in New Issue
Block a user