From: Paul Donald Date: Wed, 21 Jan 2026 21:39:04 +0000 (+0100) Subject: luci-theme: fix theme header title X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=9fe1334fd5172111773a56894825983acdf9865a;p=openwrt-luci.git luci-theme: fix theme header title dispatched.title is sometimes null, especially where menu JSON does not declare a title for a page. Also, while we're here, wrap these in i18n tags, since the JSON titles are often translated (they're included in po matter). Closes #8222 Signed-off-by: Paul Donald --- diff --git a/themes/luci-theme-bootstrap/ucode/template/themes/bootstrap/header.ut b/themes/luci-theme-bootstrap/ucode/template/themes/bootstrap/header.ut index 85216214e9..6a4af93f84 100644 --- a/themes/luci-theme-bootstrap/ucode/template/themes/bootstrap/header.ut +++ b/themes/luci-theme-bootstrap/ucode/template/themes/bootstrap/header.ut @@ -18,7 +18,7 @@ - {{ striptags(`${dispatched ? `${dispatched.title} | ` : ''}${boardinfo.hostname ?? '?'}`) }} | LuCI + {{ striptags(`${dispatched?.title ? `${_(dispatched.title)} | ` : ''}${boardinfo.hostname ?? '?'}`) }} | LuCI {% if (!darkpref): %} -{{ striptags(`${dispatched ? `${dispatched.title} | ` : ''}${boardinfo.hostname ?? '?'}`) }} | LuCI +{{ striptags(`${dispatched?.title ? `${_(dispatched.title)} | ` : ''}${boardinfo.hostname ?? '?'}`) }} | LuCI {% if (css): %} {% endif %} diff --git a/themes/luci-theme-openwrt-2020/ucode/template/themes/openwrt2020/header.ut b/themes/luci-theme-openwrt-2020/ucode/template/themes/openwrt2020/header.ut index 25a1719eea..1449f0fb83 100644 --- a/themes/luci-theme-openwrt-2020/ucode/template/themes/openwrt2020/header.ut +++ b/themes/luci-theme-openwrt-2020/ucode/template/themes/openwrt2020/header.ut @@ -22,7 +22,7 @@ -{{ striptags(`${dispatched ? `${dispatched.title} | ` : ''}${boardinfo.hostname ?? '?'}`) }} | LuCI +{{ striptags(`${dispatched?.title ? `${_(dispatched.title)} | ` : ''}${boardinfo.hostname ?? '?'}`) }} | LuCI {% if (css): %} {% endif %} diff --git a/themes/luci-theme-openwrt/ucode/template/themes/openwrt.org/header.ut b/themes/luci-theme-openwrt/ucode/template/themes/openwrt.org/header.ut index a1773aa62e..ce3596b3fc 100644 --- a/themes/luci-theme-openwrt/ucode/template/themes/openwrt.org/header.ut +++ b/themes/luci-theme-openwrt/ucode/template/themes/openwrt.org/header.ut @@ -28,7 +28,7 @@ -{{ striptags(`${dispatched ? `${dispatched.title} | ` : ''}${boardinfo.hostname ?? '?'}`) }} | LuCI +{{ striptags(`${dispatched?.title ? `${_(dispatched.title)} | ` : ''}${boardinfo.hostname ?? '?'}`) }} | LuCI