feat: use i18n in components
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { getTool } from '$lib/registry';
|
||||
import { t } from '$lib/i18n/t';
|
||||
import { toolTitle } from '$lib/i18n/tool-strings';
|
||||
import ToolPage from '$lib/components/ToolPage.svelte';
|
||||
import ToolSearch from '$lib/components/search/ToolSearch.svelte';
|
||||
import Button from '$lib/components/ui/Button.svelte';
|
||||
@@ -56,7 +57,7 @@
|
||||
{@const restoreId = lastToolId}
|
||||
<div class="restore-row">
|
||||
<Button variant="secondary" fullWidth onclick={() => openTool(restoreId, true)}>
|
||||
{t('home.restoreLast', { title: getTool(restoreId)?.title ?? '' })}
|
||||
{t('home.restoreLast', { title: getTool(restoreId) ? toolTitle(getTool(restoreId)!) : '' })}
|
||||
</Button>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { CATEGORIES } from '$lib/categories';
|
||||
import { t } from '$lib/i18n/t';
|
||||
import { toolDescription, toolTitle } from '$lib/i18n/tool-strings';
|
||||
import ToolCard from '$lib/components/search/ToolCard.svelte';
|
||||
import { TOOLS } from '$lib/registry';
|
||||
</script>
|
||||
@@ -23,8 +24,8 @@
|
||||
<div class="panel">
|
||||
<ToolCard
|
||||
toolId={tool.id}
|
||||
title={tool.title}
|
||||
description={tool.description}
|
||||
title={toolTitle(tool)}
|
||||
description={toolDescription(tool)}
|
||||
href="/tools/{tool.id}"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import ToolPage from '$lib/components/ToolPage.svelte';
|
||||
import { getTool } from '$lib/registry';
|
||||
import { t } from '$lib/i18n/t';
|
||||
import { toolDescription, toolTitle } from '$lib/i18n/tool-strings';
|
||||
|
||||
let { data } = $props();
|
||||
|
||||
@@ -9,9 +10,9 @@
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>{tool?.title ?? t('toolPage.fallbackTitle')} — easy-png-tools</title>
|
||||
<title>{tool ? toolTitle(tool) : t('toolPage.fallbackTitle')} — easy-png-tools</title>
|
||||
{#if tool}
|
||||
<meta name="description" content={tool.description} />
|
||||
<meta name="description" content={toolDescription(tool)} />
|
||||
{/if}
|
||||
</svelte:head>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user