diff --git a/config/site.example.yaml b/config/site.example.yaml index 6eed298..6849eb2 100644 --- a/config/site.example.yaml +++ b/config/site.example.yaml @@ -33,4 +33,9 @@ footerHTML: | Kener an open source status page system built with Svelte and TailwindCSS. +i18n: + defaultLocale: "en" + locales: + en: "English" + hi: "Hindi" \ No newline at end of file diff --git a/locales/hi.json b/locales/hi.json index f420a4a..d5936d0 100644 --- a/locales/hi.json +++ b/locales/hi.json @@ -25,7 +25,7 @@ "status_ok": "स्थिति ठीक है", "status_x_hour_y_minute": "%hours घंटा %minutes मिनट के लिए %status", "status_x_minute": "%minute मिनट के लिए %status", - "status_x_minutes": "%minute मिनट के लिए %status", + "status_x_minutes": "%minutes मिनट के लिए %status", "theme": "थीम", "theme_dark": "डार्क", "theme_light": "लाइट", diff --git a/src/lib/components/incident.svelte b/src/lib/components/incident.svelte index c90b5c8..a984216 100644 --- a/src/lib/components/incident.svelte +++ b/src/lib/components/incident.svelte @@ -7,6 +7,7 @@ import { Badge } from "$lib/components/ui/badge"; import { ChevronDown } from "lucide-svelte"; import * as Collapsible from "$lib/components/ui/collapsible"; + import { l } from '$lib/i18n/client'; import axios from "axios"; import { Skeleton } from "$lib/components/ui/skeleton"; export let incident; @@ -102,15 +103,15 @@

{#if incident.labels.includes("identified")} - Identified + {l(lang,'incident.identified')} {/if} {#if incident.labels.includes("resolved")} - Resolved + {l(lang,'incident.resolved')} {/if} {#if incident.labels.includes("maintenance")} - Maintenance + {l(lang,'incident.maintenance')} {/if}

diff --git a/src/lib/components/monitor.svelte b/src/lib/components/monitor.svelte index beb6ab5..5733428 100644 --- a/src/lib/components/monitor.svelte +++ b/src/lib/components/monitor.svelte @@ -1,34 +1,42 @@ +
{#if monitor.embed === undefined} -
-
-
- {#if monitor.image} - {monitor.name} - {/if} - {monitor.name} -
- {#if monitor.description} - - - - - - - -

{monitor.name}

- {@html monitor.description} -
-
- {/if} - - - - - - - -

{l(lang,'monitor.share')}

-

{l(lang,'monitor.share_desc')}

- -

{l(lang,'monitor.embed')}

-

{l(lang,'monitor.embed_desc')}

-
-
-

{l(lang,'monitor.theme')}

- -
- - -
-
- - -
- -
+
+
+
+ {#if monitor.image} + {monitor.name} + {/if} + {monitor.name} +
+ {#if monitor.description} + + + + + + + +

+ {monitor.name} +

+ + {@html monitor.description} + +
+
+ {/if} + + + + + + + +

+ {l(lang, "monitor.share")} +

+

+ {l(lang, "monitor.share_desc")} +

+ +

+ {l(lang, "monitor.embed")} +

+

+ {l(lang, "monitor.embed_desc")} +

+
+
+

+ {l(lang, "monitor.theme")} +

+ +
+ + +
+
+ + +
+ +
+
+
+

+ {l(lang, "monitor.mode")} +

+ +
+ + +
+
+ + +
+ +
+
-
-

{l(lang,'monitor.mode')}

- -
- - -
-
- - -
- -
-
-
- -

{l(lang,'monitor.badge')}

-

{l(lang,'monitor.badge_desc')}

- - - - + +

+ {l(lang, "monitor.badge")} +

+

+ {l(lang, "monitor.badge_desc")} +

+ + + + +
-
-
- {/if} -
- +
-
-
- - -
-
- {#if _90Day[todayDD]} -
- {summaryTime(lang, _90Day[todayDD].message)} -
- {/if} -
-
+
+
+ + +
+
+ {#if _90Day[todayDD]} +
+ {summaryTime(lang, _90Day[todayDD].message)} +
+ {/if} +
+
{#if view == "90day"} -
-
- {#each Object.entries(_90Day) as [ts, bar]} -
-
+
+
+ {#each Object.entries(_90Day) as [ts, bar]} +
+
+
+
+
+ ● {n( + lang, + new Date( + bar.timestamp * 1000, + ).toLocaleDateString(), + )} + {summaryTime(lang, bar.message)} +
+
+ {/each}
-
-
- ● {n(lang, new Date(bar.timestamp * 1000).toLocaleDateString())} {summaryTime(lang, bar.message)} -
-
- {/each}
-
{:else} -
-
- {#if Object.keys(_0Day).length == 0} - - {/if} {#each Object.entries(_0Day) as [ts, bar] } -
-
-
-

- - ● - - {ampm(lang, n(lang, new Date(bar.timestamp * 1000).toLocaleTimeString()))} -

- {#if bar.status != 'NO_DATA'} -

- {l(lang,'statuses.' + bar.status)} -

- {:else} -

-

- {/if} -
+
+
+ {#if Object.keys(_0Day).length == 0} + + {/if} + {#each Object.entries(_0Day) as [ts, bar]} +
+
+
+

+ + ● + + {ampm( + lang, + n( + lang, + new Date( + bar.timestamp * 1000, + ).toLocaleTimeString(), + ), + )} +

+ {#if bar.status != "NO_DATA"} +

+ {l(lang, "statuses." + bar.status)} +

+ {:else} +

-

+ {/if} +
+
+ {/each}
- {/each}
-
{/if}
+