From 60f24f875789900ba54cef4976ac2e9de19a52b4 Mon Sep 17 00:00:00 2001 From: vcoppe Date: Thu, 10 Oct 2024 11:39:14 +0200 Subject: [PATCH] add h1's --- website/src/hooks.server.js | 17 +-------- website/src/routes/[[language]]/+page.svelte | 2 +- .../src/routes/[[language]]/app/+page.svelte | 35 ++++++++++++++++++- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/website/src/hooks.server.js b/website/src/hooks.server.js index b537f353..81d46813 100644 --- a/website/src/hooks.server.js +++ b/website/src/hooks.server.js @@ -45,24 +45,9 @@ export async function handle({ event, resolve }) { `; } - const stringsHTML = page === 'app' ? stringsToHTML(strings) : ''; - const response = await resolve(event, { - transformPageChunk: ({ html }) => html.replace('', htmlTag).replace('', headTag).replace('', `
${stringsHTML}
`) + transformPageChunk: ({ html }) => html.replace('', htmlTag).replace('', headTag), }); return response; -} - -function stringsToHTML(dictionary, strings = new Set(), root = true) { - Object.values(dictionary).forEach((value) => { - if (typeof value === 'object') { - stringsToHTML(value, strings, false); - } else { - strings.add(value); - } - }); - if (root) { - return Array.from(strings).map((string) => `

${string}

`).join(''); - } } \ No newline at end of file diff --git a/website/src/routes/[[language]]/+page.svelte b/website/src/routes/[[language]]/+page.svelte index ae966141..ef9cd580 100644 --- a/website/src/routes/[[language]]/+page.svelte +++ b/website/src/routes/[[language]]/+page.svelte @@ -49,7 +49,7 @@
-
{$_('metadata.home_title')}
+

{$_('metadata.home_title')}

{$_('metadata.description')}
diff --git a/website/src/routes/[[language]]/app/+page.svelte b/website/src/routes/[[language]]/app/+page.svelte index d1d7477d..f4796183 100644 --- a/website/src/routes/[[language]]/app/+page.svelte +++ b/website/src/routes/[[language]]/app/+page.svelte @@ -10,7 +10,6 @@ import LayerControl from '$lib/components/layer-control/LayerControl.svelte'; import Resizer from '$lib/components/Resizer.svelte'; import { Toaster } from '$lib/components/ui/sonner'; - import { observeFilesFromDatabase, settings } from '$lib/db'; import { gpxStatistics, loadFiles, slicedGPXStatistics } from '$lib/stores'; import { onMount } from 'svelte'; @@ -18,6 +17,7 @@ import { languages } from '$lib/languages'; import { getURLForLanguage } from '$lib/utils'; import { getURLForGoogleDriveFile } from '$lib/components/embedding/Embedding'; + import { _ } from 'svelte-i18n'; const { verticalFileView, @@ -53,6 +53,39 @@ }); +
+

{$_('metadata.home_title')} — {$_('metadata.app_title')}

+

{$_('metadata.description')}

+

{$_('toolbar.routing.tooltip')}

+

{$_('toolbar.routing.help_no_file')}

+

{$_('toolbar.routing.help')}

+

{$_('toolbar.routing.reverse.button')}

+

{$_('toolbar.routing.reverse.tooltip')}

+

{$_('toolbar.routing.route_back_to_start.button')}

+

{$_('toolbar.routing.route_back_to_start.tooltip')}

+

{$_('toolbar.routing.round_trip.button')}

+

{$_('toolbar.routing.round_trip.tooltip')}

+

{$_('toolbar.routing.start_loop_here')}

+

{$_('toolbar.scissors.tooltip')}

+

{$_('toolbar.scissors.help')}

+

{$_('toolbar.time.tooltip')}

+

{$_('toolbar.time.help')}

+

{$_('toolbar.merge.tooltip')}

+

{$_('toolbar.merge.merge_traces')}

+

{$_('toolbar.merge.help_merge_traces')}

+

{$_('toolbar.merge.merge_contents')}

+

{$_('toolbar.merge.help_merge_contents')}

+

{$_('toolbar.elevation.button')}

+

{$_('toolbar.elevation.help')}

+

{$_('toolbar.waypoint.tooltip')}

+

{$_('toolbar.waypoint.help')}

+

{$_('toolbar.reduce.tooltip')}

+

{$_('toolbar.reduce.help')}

+

{$_('toolbar.clean.tooltip')}

+

{$_('toolbar.clean.help')}

+

{$_('gpx.files')}, {$_('gpx.tracks')}, {$_('gpx.segments')}, {$_('gpx.waypoints')}

+
+