+ {t("threemaSetup.bannerTitle")} +
+{t("threemaSetup.bannerBody")}
+{t(helpKey)} diff --git a/src/lib/threema-gateway-config.ts b/src/lib/threema-gateway-config.ts index 414d17f..27df94d 100644 --- a/src/lib/threema-gateway-config.ts +++ b/src/lib/threema-gateway-config.ts @@ -13,21 +13,19 @@ * env var that lists the active account. * 2. Move the QR PNG into a server-rendered route that takes a * gateway ID query param. - * 3. Update consumers (today only ThreemaSetup) to accept the - * gateway info as a prop and pass it from a server component. - * - * In display contexts we strip the leading asterisk from the Threema - * ID — customers don't understand the `*X` prefix convention used for - * Gateway accounts, and the QR code carries the real value anyway. We - * keep the asterisk only for places where the technical value matters - * (server-side message routing, debug logs). + * 3. Update consumers to accept the gateway info as a prop and pass + * it from a server component. */ export const THREEMA_GATEWAY = { /** Technical Threema Gateway ID, with leading asterisk. */ id: "*AIAGENT", - /** Display name shown to customers (no asterisk). */ - displayName: "AIAGENT", + /** + * Display name shown to customers. INCLUDES the leading asterisk — + * customers need to recognise this exact string in their Threema + * contacts after scanning the QR, so we don't strip it. + */ + displayName: "*AIAGENT", /** Public path to the QR code PNG served from `public/`. */ qrCodePath: "/threema/qr_code_AIAGENT.png", } as const; diff --git a/src/messages/de.json b/src/messages/de.json index 1b6988d..c744564 100644 --- a/src/messages/de.json +++ b/src/messages/de.json @@ -403,7 +403,9 @@ "step2": "Tippen Sie auf das Scan-Symbol und scannen Sie diesen QR-Code, um den Assistenten als Kontakt hinzuzufügen.", "step3": "Fügen Sie anschliessend unten Ihre eigene Threema-ID hinzu.", "qrAlt": "QR-Code, um {gateway} als Threema-Kontakt hinzuzufügen", - "showQr": "QR anzeigen" + "bannerTitle": "Threema einrichten", + "bannerBody": "Öffnen Sie Threema auf Ihrem Telefon und scannen Sie unseren QR-Code, um den Assistenten als Kontakt hinzuzufügen. Geben Sie anschliessend unten Ihre eigene Threema-ID ein.", + "bannerButton": "QR-Code anzeigen" } }, "team": { diff --git a/src/messages/en.json b/src/messages/en.json index 63cd2a5..0a69aae 100644 --- a/src/messages/en.json +++ b/src/messages/en.json @@ -403,7 +403,9 @@ "step2": "Tap the scan icon and scan this QR code to add the assistant as a contact.", "step3": "Then add your own Threema ID below.", "qrAlt": "QR code to add {gateway} as a Threema contact", - "showQr": "Show QR" + "bannerTitle": "Set up Threema", + "bannerBody": "Open Threema on your phone and scan our QR code to add the assistant as a contact. Then add your own Threema ID below.", + "bannerButton": "Show QR code" } }, "team": { diff --git a/src/messages/fr.json b/src/messages/fr.json index 490e77b..d582663 100644 --- a/src/messages/fr.json +++ b/src/messages/fr.json @@ -403,7 +403,9 @@ "step2": "Appuyez sur l'icône de scan et scannez ce QR code pour ajouter l'assistant comme contact.", "step3": "Puis ajoutez votre propre identifiant Threema ci-dessous.", "qrAlt": "QR code pour ajouter {gateway} comme contact Threema", - "showQr": "Afficher le QR" + "bannerTitle": "Configurer Threema", + "bannerBody": "Ouvrez Threema sur votre téléphone et scannez notre QR code pour ajouter l'assistant comme contact. Saisissez ensuite votre propre identifiant Threema ci-dessous.", + "bannerButton": "Afficher le QR code" } }, "team": { diff --git a/src/messages/it.json b/src/messages/it.json index 5050e06..215d5b4 100644 --- a/src/messages/it.json +++ b/src/messages/it.json @@ -403,7 +403,9 @@ "step2": "Tocca l'icona di scansione e scansiona questo QR code per aggiungere l'assistente ai contatti.", "step3": "Quindi aggiungi il tuo ID Threema qui sotto.", "qrAlt": "QR code per aggiungere {gateway} come contatto Threema", - "showQr": "Mostra QR" + "bannerTitle": "Configura Threema", + "bannerBody": "Apri Threema sul tuo telefono e scansiona il nostro QR code per aggiungere l'assistente ai contatti. Inserisci poi il tuo ID Threema qui sotto.", + "bannerButton": "Mostra QR code" } }, "team": { diff --git a/src/middleware.ts b/src/middleware.ts index 2c1447d..902cec5 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -40,5 +40,10 @@ export default async function middleware(request: NextRequest) { } export const config = { - matcher: ["/((?!_next|favicon.ico|api).*)"], + // Excludes _next/* internal routes, the favicon, api routes, AND any + // path containing a dot (covers all static files served from public/, + // e.g. /threema/qr_code_AIAGENT.png). Without the dot exclusion, the + // i18n middleware prepends the locale ("/en/threema/qr_code_AIAGENT.png") + // and the file is not found. + matcher: ["/((?!_next|favicon.ico|api|.*\\..*).*)"], };