From a1fe62f1324f460e443914d904fa33ec1fe7c7b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=B6rdle=20Bot?= Date: Thu, 4 Dec 2025 21:26:16 +0100 Subject: [PATCH] =?UTF-8?q?Fix:=20Verwende=20Punycode-Domain=20(xn--hrdle-?= =?UTF-8?q?jua.de)=20in=20Share-Nachricht=20f=C3=BCr=20h=C3=B6rdle.de-Benu?= =?UTF-8?q?tzer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Game.tsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/components/Game.tsx b/components/Game.tsx index 49058d6..5491b8e 100644 --- a/components/Game.tsx +++ b/components/Game.tsx @@ -416,11 +416,22 @@ export default function Game({ dailyPuzzle, genre = null, isSpecial = false, max const bonusStar = (hasWon && gameState.yearGuessed && dailyPuzzle.releaseYear && gameState.scoreBreakdown.some(item => item.reason === 'Bonus: Correct Year')) ? '⭐' : ''; const genreText = genre ? `${isSpecial ? t('special') : t('genre')}: ${genre}\n` : ''; + // Use current domain from window.location to support both hoerdle.de and hördle.de + const rawHost = typeof window !== 'undefined' ? window.location.hostname : config.domain; + const protocol = typeof window !== 'undefined' ? window.location.protocol : 'https:'; + + // For users on hördle.de, use Punycode domain (xn--hrdle-jua.de) in share message + // to avoid rendering issues with Unicode domains + let currentHost = rawHost; + if (rawHost === 'hördle.de' || rawHost === 'xn--hrdle-jua.de') { + currentHost = 'xn--hrdle-jua.de'; + } + + // OLD CODE (commented out - may be needed again in the future): // Use current domain from window.location to support both hoerdle.de and hördle.de, // but always share the pretty Unicode-Domain "hördle.de" instead of the Punycode variant. - const rawHost = typeof window !== 'undefined' ? window.location.hostname : config.domain; - const currentHost = rawHost === 'xn--hrdle-jua.de' ? 'hördle.de' : rawHost; - const protocol = typeof window !== 'undefined' ? window.location.protocol : 'https:'; + // const currentHost = rawHost === 'xn--hrdle-jua.de' ? 'hördle.de' : rawHost; + let shareUrl = `${protocol}//${currentHost}`; // Add locale prefix if not default (en) if (locale !== 'en') {