From 89bb3380657fcd95ff55d8013fea9bf1bb7c5e21 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Sun, 27 Aug 2023 23:43:01 +0200 Subject: [PATCH] Implement translations See also: https://github.com/kytta/share2fedi/pull/43 Co-authored-by: Sunny Ripert --- src/components/form.astro | 8 +++- src/components/instance-select.astro | 25 +++++++++---- src/components/language-select.astro | 55 ++++++++++++++++++++++++++++ src/i18n/engine.ts | 54 +++++++++++++++++++++++++++ src/i18n/translations.ts | 55 ++++++++++++++++++++++++++++ src/layouts/layout.astro | 4 +- src/pages/index.astro | 52 ++++++++++++++++---------- src/stores/i18n.ts | 3 ++ src/styles/main.scss | 3 ++ tsconfig.json | 1 + 10 files changed, 231 insertions(+), 29 deletions(-) create mode 100644 src/components/language-select.astro create mode 100644 src/i18n/engine.ts create mode 100644 src/i18n/translations.ts create mode 100644 src/stores/i18n.ts diff --git a/src/components/form.astro b/src/components/form.astro index 602e265..bbe2540 100644 --- a/src/components/form.astro +++ b/src/components/form.astro @@ -13,14 +13,16 @@ const { prefilledText, prefilledInstance } = Astro.props; action="/api/share" method="POST" > -