In multi-language setups, the (:all)/og-image route strips the language prefix from the slug (line 47) but never calls kirby()->setCurrentLanguage(). Since the route runs in Kirby's main router (no 'language' property), the current language stays on the default. page($slug) then fails to resolve translated slugs because Pages::findByKey() only does translated slug lookups when $kirby->language()->isDefault() === false.
Reproduction:
Kirby multi-language (EN default, DE secondary), page with translated DE slug (e.g. folder publications, DE slug publikationen):
- /en/publications/my-page/og-image → works (slug matches folder ID)
- /de/publikationen/my-page/og-image → 404 (fails)
I fixed it with adding kirby()->setCurrentLanguage($slugParts[0]); before stripping the prefix in index.php, but there might be a smoother fix through LanguageRouter.
Version: 1.2.2, Kirby 5.x
In multi-language setups, the
(:all)/og-imageroute strips the language prefix from the slug (line 47) but never callskirby()->setCurrentLanguage(). Since the route runs in Kirby's main router (no 'language' property), the current language stays on the default.page($slug)then fails to resolve translated slugs becausePages::findByKey()only does translated slug lookups when$kirby->language()->isDefault() === false.Reproduction:
Kirby multi-language (EN default, DE secondary), page with translated DE slug (e.g. folder publications, DE slug publikationen):
I fixed it with adding
kirby()->setCurrentLanguage($slugParts[0]);before stripping the prefix inindex.php, but there might be a smoother fix through LanguageRouter.Version: 1.2.2, Kirby 5.x