Add smoke route exercising logger, i18n, and locale display
This commit is contained in:
@@ -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 <a target=\"_blank\" href=\"https://www.aeroflot.ru/ru-en/aeroflot-ifly\">here</a>."
|
||||
},
|
||||
"SMOKE": {
|
||||
"HEADING": "Smoke test page"
|
||||
},
|
||||
"FLIGHTS-MAP": {
|
||||
"TITLE": "Route map",
|
||||
"ROUTE": "Find your route",
|
||||
|
||||
@@ -365,6 +365,9 @@
|
||||
"WEEK": "Неделя",
|
||||
"WEEK_FORMAT-WRONG": "Не соответствует формату ДД.ММ.ГГГГ - ДД.ММ.ГГГГ"
|
||||
},
|
||||
"SMOKE": {
|
||||
"HEADING": "Страница проверки"
|
||||
},
|
||||
"WARNING":{
|
||||
"IFLY_HIGHLIGHT" : "Обратите внимание!",
|
||||
"IFLY_BODY" : "Рейсы Аэрофлота с нумерацией SU5800-SU5949 выполняются на самолётах и экипажем авиакомпании iFly.",
|
||||
|
||||
@@ -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 (
|
||||
<main style={{ padding: "2rem" }}>
|
||||
<h1>{t("SMOKE.HEADING")}</h1>
|
||||
<dl>
|
||||
<dt>Locale</dt>
|
||||
<dd>{lang}</dd>
|
||||
<dt>i18n test (BOARD.DEPARTURE)</dt>
|
||||
<dd>{t("BOARD.DEPARTURE")}</dd>
|
||||
</dl>
|
||||
<p>
|
||||
If you can see translated text above, the i18n provider is working.
|
||||
</p>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user