changeset 3702:caf27826c7b2

mod_http_muc_log: Use configured room language in room title/desc #a11y Room title and description is presumably using the language set in the room configuration.
author Kim Alvefur <zash@zash.se>
date Wed, 09 Oct 2019 21:36:23 +0200
parents 3bb9a0806439
children 7244ff1d62a8
files mod_http_muc_log/http_muc_log.html mod_http_muc_log/mod_http_muc_log.lua
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_muc_log/http_muc_log.html	Wed Oct 09 21:24:11 2019 +0200
+++ b/mod_http_muc_log/http_muc_log.html	Wed Oct 09 21:36:23 2019 +0200
@@ -45,7 +45,7 @@
 </head>
 <body>
 <header>
-<h1 title="xmpp:{jid?}">{title}</h1>
+<h1 {lang&lang="{lang}"} title="xmpp:{jid?}">{title}</h1>
 <nav>
 <ul>
 {jid_node&
@@ -57,12 +57,12 @@
 </nav>
 </header>
 <hr>
-<main class="content">
+<main {lang&lang="{lang}"} class="content">
 <nav>
 <dl class="room-list">
 {rooms#
-<dt class="name"><a href="{item.href}{hide_presence&?p=h}">{item.name}</a></dt>
-<dd class="description">{item.description?}</dd>}
+<dt {item.lang&lang="{item.lang}"} class="name"><a href="{item.href}{hide_presence&?p=h}">{item.name}</a></dt>
+<dd {item.lang&lang="{item.lang}"} class="description">{item.description?}</dd>}
 </dl>
 {years#
 <h2 id="{item.year}">{item.year}</h2>
--- a/mod_http_muc_log/mod_http_muc_log.lua	Wed Oct 09 21:24:11 2019 +0200
+++ b/mod_http_muc_log/mod_http_muc_log.lua	Wed Oct 09 21:36:23 2019 +0200
@@ -377,6 +377,7 @@
 		jid_node = jid_split(get_room(room).jid);
 		hide_presence = hide_presence(request);
 		presence_available = presence_logged;
+		lang = get_room(room).get_language and get_room(room):get_language();
 		lines = logs;
 		links = links;
 	});
@@ -391,6 +392,7 @@
 				jid = room.jid;
 				href = get_link(jid_split(room.jid), default_view);
 				name = room:get_name();
+				lang = room.get_language and room:get_language();
 				description = room:get_description();
 			}, i + 1;
 		end