From b6da51fce5d3382248921f1dea3b0a0f1d53a60e Mon Sep 17 00:00:00 2001 From: gnezim Date: Wed, 15 Apr 2026 00:36:54 +0300 Subject: [PATCH] Add smoke route exercising logger, i18n, and locale display --- src/i18n/locales/en/common.json | 3 +++ src/i18n/locales/ru/common.json | 3 +++ src/routes/[lang]/smoke/page.tsx | 36 ++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 src/routes/[lang]/smoke/page.tsx diff --git a/src/i18n/locales/en/common.json b/src/i18n/locales/en/common.json index ee25176a..412de8d2 100644 --- a/src/i18n/locales/en/common.json +++ b/src/i18n/locales/en/common.json @@ -371,6 +371,9 @@ "IFLY_BODY" : "SU5800–SU5949 Aeroflot flights are operated by iFly aircraft and crew.", "IFLY_INFO" : "Information on the on-board service is available here." }, + "SMOKE": { + "HEADING": "Smoke test page" + }, "FLIGHTS-MAP": { "TITLE": "Route map", "ROUTE": "Find your route", diff --git a/src/i18n/locales/ru/common.json b/src/i18n/locales/ru/common.json index cfc4c125..2b06b289 100644 --- a/src/i18n/locales/ru/common.json +++ b/src/i18n/locales/ru/common.json @@ -365,6 +365,9 @@ "WEEK": "Неделя", "WEEK_FORMAT-WRONG": "Не соответствует формату ДД.ММ.ГГГГ - ДД.ММ.ГГГГ" }, + "SMOKE": { + "HEADING": "Страница проверки" + }, "WARNING":{ "IFLY_HIGHLIGHT" : "Обратите внимание!", "IFLY_BODY" : "Рейсы Аэрофлота с нумерацией SU5800-SU5949 выполняются на самолётах и экипажем авиакомпании iFly.", diff --git a/src/routes/[lang]/smoke/page.tsx b/src/routes/[lang]/smoke/page.tsx new file mode 100644 index 00000000..724a18f1 --- /dev/null +++ b/src/routes/[lang]/smoke/page.tsx @@ -0,0 +1,36 @@ +import { useEffect } from "react"; +import { useParams } from "@modern-js/runtime/router"; +import { useTranslation } from "@/i18n/provider"; +import { useLogger } from "@/observability/logger/provider"; + +/** + * Smoke route at /{lang}/smoke. + * Exercises the foundation subsystems as a quick integration check: + * - Logger: emits an info log on mount + * - i18n: renders a translated string (SMOKE.HEADING) + * - Locale display: shows the current lang param + */ +export default function SmokePage(): JSX.Element { + const { lang } = useParams<{ lang: string }>(); + const { t } = useTranslation(); + const logger = useLogger(); + + useEffect(() => { + logger.info("Smoke page mounted", { locale: lang ?? "unknown" }); + }, [logger, lang]); + + return ( +
+

{t("SMOKE.HEADING")}

+
+
Locale
+
{lang}
+
i18n test (BOARD.DEPARTURE)
+
{t("BOARD.DEPARTURE")}
+
+

+ If you can see translated text above, the i18n provider is working. +

+
+ ); +}