applications/luci-splash: Fix a translation problem with 2 strings
[project/luci.git] / applications / luci-splash / luasrc / view / splash / splash.htm
index 9e79b10..b9de464 100644 (file)
@@ -13,18 +13,24 @@ You may obtain a copy of the License at
 <%
 local fs = require "luci.fs"
 local has_custom_splash = fs.access("/usr/lib/luci-splash/splashtext.html")
+local has_custom_splashinclude = fs.access("/usr/lib/luci-splash/splashtextinclude.html")
 
-function expand (e)        
+function expand (e, R)        
        return (string.gsub(e, "###([A-Z_]+)###", R))
 end
 
-local community, homepage, leasetime, limit_up, limit_down, R
+local community, homepage, leasetime, limit_up, limit_down
 
 local contacturl = luci.dispatcher.build_url("freifunk", "contact")
 
 local c = luci.model.uci.cursor():get_all("freifunk", "community")
 if c and c.name then
-       community = c.name
+        name = luci.model.uci.cursor():get('profile_' .. c.name, 'profile', 'name')
+       if name then
+               community = name
+       else
+               community = c.name
+       end
 else
        community = "Freifunk"
 end
@@ -49,9 +55,15 @@ if limit_up and limit_down then
        "to this project.") .. "</p>"
 end
 
-if has_custom_splash then
+local contact = translate('Get in %s with the operator of this access point.')
+contact = contact % ('<a href="' .. contacturl .. '">' .. translatef('Contact') .. '</a>')
+
+local accepttext = translate('By accepting these rules you can use this network for %s hour(s). After this time you need to accept these rules again.')
+accepttext = accepttext % leasetime
+
 
-       R = {
+if has_custom_splash then
+       local R = {
                COMMUNITY = community,
                COMMUNITY_URL = homepage,
                LEASETIME = leasetime,
@@ -59,8 +71,7 @@ if has_custom_splash then
                LIMIT = limit_text,
                CONTACTURL = contacturl
        }
-
-       local splashtext = expand(fs.readfile("/usr/lib/luci-splash/splashtext.html"))
+       local splashtext = expand(fs.readfile("/usr/lib/luci-splash/splashtext.html"), R)
        %>
        <%=splashtext%>
 
@@ -87,12 +98,41 @@ if has_custom_splash then
        <p><%:If you use this network on a regular basis we ask for your support:%></p>
        <ul>
                <li><a href="<%=homepage%>"><%:Become an active member of this community and help by operating your own node%></a></li>
-               <li><a href="<%=contacturl%>"><%:Contact%></a> <%:the owner of this access point.%></li>
+               <li><%=contact%></li>
                <li><%:Donate some money to help us keep this project alive.%></li>
-               <li><%:If you operate your own wifi equipment use channels different from ours.%>
+               <li><%:If you operate your own wifi equipment use channels different from ours.%></li>
        </ul>
-       <br/><p><%:By accepting these rules you can use this network for%> <%=leasetime%> 
-       <%:hour(s). After this time you need to accept these rules again.%>
+
+       <%
+       if has_custom_splashinclude then
+               local splashtextinclude = fs.readfile("/usr/lib/luci-splash/splashtextinclude.html")
+       %>
+               <%=splashtextinclude%>
+       <% end %>
+
+       <h2><%:Usage Agreement%></h2>
+       <p>
+       <%:The open and free wireless network of volunteers ("Operators") provides the necessary equipment and Internet connections ("Infrastructure") at their own expense.%>
+       <%:These Terms of Use govern the use of the network by its participants' computer, PDA, or similar device ("Devices") within the network.%>
+       <%:Access to the network is not guaranteed. It can be interrupted at any time without notice for any reason, for certain devices, and/or may be blocked for certain users.%>
+       </p>
+
+       <h3><%:Legally Prohibited Activities%></h3>
+       <p><%:The participant agrees to not perform any action and refrain from acts which may violate the law or infringe upon the rights of third parties.%></p>
+       <h3><%:Legally Prohibited content%></h3>
+       <p><%:The participant agrees to not transfer content over the network which violates the law.%></p>
+       <h3><%:Fair Use Policy%></h3>
+       <p><%:The participant agrees to not use the network in any way which will harm the infrastructure, the network itself, its operators or other participants.%></p>
+       <h3><%:Safety%></h3>
+       <p>The network, like the Internet, is unencrypted and open. Each participant is responsible for the safety of their own connections and devices.</p>
+       <h3>Disclaimer</h3>
+       <p><%:The operator claims no liability for loss of data, unauthorized access/damage to devices, or financial losses that participants may suffer from the use of the network.%></p>
+
+       <br /><p><b><%=accepttext%></b></p>
 <% end %>