mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-09-14 21:46:35 +00:00
fix: update i18n - catalog, nav, common components
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Snippet } from "svelte";
|
import type { Snippet } from "svelte";
|
||||||
|
import { t } from "$lib/i18n/t";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
label: string;
|
label: string;
|
||||||
@@ -12,7 +13,8 @@
|
|||||||
<section class="catalog-group">
|
<section class="catalog-group">
|
||||||
<div class="group-title">
|
<div class="group-title">
|
||||||
<span>{label}</span>
|
<span>{label}</span>
|
||||||
<i>{count.toString().padStart(2, "0")} <!-- --> TOOLS</i>
|
<i>{count.toString().padStart(2, "0")} <!-- --> {t("catalog.toolsCount")}</i
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="tool-cards">
|
<div class="tool-cards">
|
||||||
{@render children()}
|
{@render children()}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { t } from "$lib/i18n/t";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
total: number;
|
total: number;
|
||||||
}
|
}
|
||||||
@@ -7,15 +9,12 @@
|
|||||||
|
|
||||||
<div class="catalog-head">
|
<div class="catalog-head">
|
||||||
<div>
|
<div>
|
||||||
<h1>Tool catalog</h1>
|
<h1>{t("catalog.heading")}</h1>
|
||||||
<p>
|
<p>{t("catalog.lead")}</p>
|
||||||
Focused utilities for working with PNG. Inspect, transform, and export —
|
|
||||||
locally in your browser.
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="catalog-total">
|
<div class="catalog-total">
|
||||||
<b>{total}</b>
|
<b>{total}</b>
|
||||||
<span>TOOLS<br /> AVAILABLE</span>
|
<span>{t("catalog.toolsAvailable")}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Funnel, Search } from "@lucide/svelte";
|
import { Funnel, Search } from "@lucide/svelte";
|
||||||
|
import { t } from "$lib/i18n/t";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
query: string;
|
query: string;
|
||||||
@@ -8,15 +9,15 @@
|
|||||||
let { query = $bindable(), category = $bindable() }: Props = $props();
|
let { query = $bindable(), category = $bindable() }: Props = $props();
|
||||||
|
|
||||||
const FILTERS = [
|
const FILTERS = [
|
||||||
{ value: "all", label: "ALL" },
|
{ value: "all", label: t("categories.all") },
|
||||||
{ value: "convert", label: "CONVERT" },
|
{ value: "convert", label: t("categories.convert") },
|
||||||
{ value: "alpha", label: "TRANSPARENCY" },
|
{ value: "alpha", label: t("categories.alpha") },
|
||||||
{ value: "color", label: "COLOR" },
|
{ value: "color", label: t("categories.color") },
|
||||||
{ value: "geometry", label: "GEOMETRY" },
|
{ value: "geometry", label: t("categories.geometry") },
|
||||||
{ value: "filters", label: "FILTERS" },
|
{ value: "filters", label: t("categories.filters") },
|
||||||
{ value: "text", label: "TEXT" },
|
{ value: "text", label: t("categories.text") },
|
||||||
{ value: "analyze", label: "ANALYZE" },
|
{ value: "analyze", label: t("categories.analyze") },
|
||||||
{ value: "generate", label: "GENERATE" },
|
{ value: "generate", label: t("categories.generate") },
|
||||||
];
|
];
|
||||||
|
|
||||||
// TODO: Button component
|
// TODO: Button component
|
||||||
@@ -26,8 +27,8 @@
|
|||||||
<label class="catalog-search">
|
<label class="catalog-search">
|
||||||
<Search size={16} />
|
<Search size={16} />
|
||||||
<input
|
<input
|
||||||
aria-label="Search tools"
|
aria-label={t("search.aria")}
|
||||||
placeholder="Search tools..."
|
placeholder={t("search.placeholder")}
|
||||||
bind:value={query}
|
bind:value={query}
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
@@ -87,6 +88,7 @@
|
|||||||
color: var(--color-text-muted);
|
color: var(--color-text-muted);
|
||||||
font: var(--font-size-s) var(--font-mono);
|
font: var(--font-size-s) var(--font-mono);
|
||||||
letter-spacing: var(--space-text-m);
|
letter-spacing: var(--space-text-m);
|
||||||
|
text-transform: uppercase;
|
||||||
padding: var(--space-s) var(--space-m);
|
padding: var(--space-s) var(--space-m);
|
||||||
border-radius: var(--radius-m);
|
border-radius: var(--radius-m);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Upload } from "@lucide/svelte";
|
import { Upload } from "@lucide/svelte";
|
||||||
|
import { t } from "$lib/i18n/t";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
accept?: string;
|
accept?: string;
|
||||||
@@ -53,8 +54,8 @@
|
|||||||
onchange={(e) => handleFiles((e.target as HTMLInputElement).files)}
|
onchange={(e) => handleFiles((e.target as HTMLInputElement).files)}
|
||||||
/>
|
/>
|
||||||
<Upload size={22} />
|
<Upload size={22} />
|
||||||
<span class="dz-title">Drop a PNG here</span>
|
<span class="dz-title">{t("dropZone.pickTitle")}</span>
|
||||||
<span class="dz-sub">or click to browse — processed locally</span>
|
<span class="dz-sub">{t("dropZone.pickHint")}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { LOCALES, type Locale } from "$lib/i18n/dict";
|
import { LOCALES, type Locale } from "$lib/i18n/dict";
|
||||||
import { getLocale, setLocale } from "$lib/i18n/locale.svelte";
|
import { getLocale, setLocale } from "$lib/i18n/locale.svelte";
|
||||||
|
import { t } from "$lib/i18n/t";
|
||||||
|
|
||||||
const LANG_LABELS: Record<Locale, string> = { ru: "RU", en: "EN" };
|
const LANG_LABELS: Record<Locale, string> = { ru: "RU", en: "EN" };
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="lang" role="group" aria-label="Language">
|
<div class="lang" role="group" aria-label={t("ui.language")}>
|
||||||
{#each LOCALES as l (l)}
|
{#each LOCALES as l (l)}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Moon, Sun } from "@lucide/svelte";
|
import { Moon, Sun } from "@lucide/svelte";
|
||||||
|
import { t } from "$lib/i18n/t";
|
||||||
import IconButton from "../ui/IconButton.svelte";
|
import IconButton from "../ui/IconButton.svelte";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -14,7 +15,7 @@
|
|||||||
|
|
||||||
<IconButton
|
<IconButton
|
||||||
icon={theme === "light" ? Moon : Sun}
|
icon={theme === "light" ? Moon : Sun}
|
||||||
label="Toggle theme"
|
label={t("ui.themeToggle")}
|
||||||
variant="clear"
|
variant="clear"
|
||||||
onclick={ontoggle}
|
onclick={ontoggle}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { resolve } from "$app/paths";
|
import { resolve } from "$app/paths";
|
||||||
|
import { t } from "$lib/i18n/t";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav class="nav">
|
<nav class="nav">
|
||||||
<a href={resolve("/")}>Home page</a>
|
<a href={resolve("/")}>{t("header.home")}</a>
|
||||||
<a href={resolve("/list-tools")}>Catalog</a>
|
<a href={resolve("/list-tools")}>{t("header.catalog")}</a>
|
||||||
<a href={resolve("/kit")}> UI Kit </a>
|
<a href={resolve("/kit")}>{t("header.uiKit")}</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Reference in New Issue
Block a user