From: Jo-Philipp Wich Date: Tue, 14 Aug 2012 12:45:06 +0000 (+0000) Subject: modules/admin-full: use format_wifi_encryption() in wifi_join.htm to make encryption... X-Git-Tag: 0.11.0~354 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6b128c028146d6a7a0ed630f4be07c1d67cf8fc1;p=oweals%2Fluci.git modules/admin-full: use format_wifi_encryption() in wifi_join.htm to make encryption translatable --- diff --git a/modules/admin-full/luasrc/view/admin_network/wifi_join.htm b/modules/admin-full/luasrc/view/admin_network/wifi_join.htm index 03407b839..2455b7d6f 100644 --- a/modules/admin-full/luasrc/view/admin_network/wifi_join.htm +++ b/modules/admin-full/luasrc/view/admin_network/wifi_join.htm @@ -50,18 +50,20 @@ $Id$ end function format_wifi_encryption(info) - if info.wep == true and not info.wpa_version then + if info.wep == true then return "WEP" - elseif info.wpa then - return "%s - %s" % { + elseif info.wpa > 0 then + return translatef("%s - %s", table.concat(info.pair_ciphers, ", "), table.concat(info.group_ciphers, ", "), - (info.wpa == 3) and "mixed WPA/WPA2" + (info.wpa == 3) and translate("mixed WPA/WPA2") or (info.wpa == 2 and "WPA2" or "WPA"), table.concat(info.auth_suites, ", ") - } + ) + elseif info.enabled then + return "%s" % translate("unknown") else - return "None" + return "%s" % translate("open") end end @@ -113,7 +115,7 @@ $Id$ Channel: <%=net.channel%> | Mode: <%=net.mode%> | BSSID: <%=net.bssid%> | - Encryption: <%=net.encryption.description or translate("Open")%> + Encryption: <%=format_wifi_encryption(net.encryption)%>