From 73c92b800a5f5785cf8fabdbd7572e2c1560ca31 Mon Sep 17 00:00:00 2001 From: Levente Orban Date: Fri, 7 Nov 2025 14:01:47 +0100 Subject: [PATCH] fix: outsorce user facing messages to json file --- src/lib/i18n/messages.json | 15 +++++++++++ src/routes/instance/+page.svelte | 44 +++++++++++++++++++++----------- 2 files changed, 44 insertions(+), 15 deletions(-) diff --git a/src/lib/i18n/messages.json b/src/lib/i18n/messages.json index 4b4bed5..e38bfd7 100644 --- a/src/lib/i18n/messages.json +++ b/src/lib/i18n/messages.json @@ -251,6 +251,21 @@ "noEventsFoundTitle": "No events found", "noEventsFoundDescription": "Try adjusting your search terms or browse all events" }, + "instance": { + "name": "Name", + "url": "URL", + "events": "Events", + "healthStatus": "Health Status", + "responseTime": "Response Time", + "notAvailable": "N/A", + "healthStatusHealthy": "healthy", + "healthStatusUnhealthy": "unhealthy", + "healthStatusUnknown": "unknown", + "description": "These are the instances that are part of the github original federation list, if you want to add your instance to the list, please open a pull request to the", + "configFile": "federation.config.js", + "file": "file.", + "noInstances": "No federation instances configured." + }, "calendar": { "addToCalendarTitle": "Add to Calendar", "googleCalendarTitle": "Google Calendar", diff --git a/src/routes/instance/+page.svelte b/src/routes/instance/+page.svelte index 51f338b..4ad5c67 100644 --- a/src/routes/instance/+page.svelte +++ b/src/routes/instance/+page.svelte @@ -1,4 +1,6 @@
@@ -35,27 +48,27 @@ - Name + {t('instance.name')} - URL + {t('instance.url')} - Events + {t('instance.events')} - Health Status + {t('instance.healthStatus')} - Response Time + {t('instance.responseTime')} @@ -64,7 +77,7 @@ - {instance.name || 'N/A'} + {instance.name || t('instance.notAvailable')} @@ -79,7 +92,7 @@ - {instance.events !== null ? instance.events : 'N/A'} + {instance.events !== null ? instance.events : t('instance.notAvailable')} @@ -88,10 +101,10 @@ class="mr-2 inline-block h-3 w-3 rounded-full {getStatusColor( instance.responseTime )}" - title={instance.healthStatus} + title={getHealthStatusText(instance.healthStatus)} > - {instance.healthStatus} + {getHealthStatusText(instance.healthStatus)} {#if instance.error} ({instance.error}) @@ -116,15 +129,16 @@

- These are the instances that are part of the github original federation list, if you want to - add your instance to the list, please open a pull request to the federation.config.js file. + class="text-violet-300/80">{t('instance.configFile')} + {t('instance.file')}

{#if data.instances.length === 0} -
No federation instances configured.
+
{t('instance.noInstances')}
{/if}