themes: load client side translations
authorJo-Philipp Wich <jo@mein.io>
Thu, 18 Oct 2018 11:58:10 +0000 (13:58 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 5 Nov 2018 10:01:45 +0000 (11:01 +0100)
Extend the theme headers to include the translation string scripts,
allowing client side code to translate strings without server side
support.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm
themes/luci-theme-freifunk-generic/luasrc/view/themes/freifunk-generic/header.htm
themes/luci-theme-material/luasrc/view/themes/material/header.htm
themes/luci-theme-openwrt/luasrc/view/themes/openwrt.org/header.htm

index 9ea1ff2281aedee4bcfda957ef789e81826dfc08..d784e4ff9412039e18e711b7d96a41b5e76e7af0 100644 (file)
                <% if css then %>
                        <style title="text/css"><%= css %></style>
                <% end -%>
+               <script src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
                <script src="<%=resource%>/cbi.js"></script>
                <script src="<%=resource%>/xhr.js"></script>
        </head>
index 5b6491a952422bfe008ef5b1dc05f35eac28352c..fa749325f6180c9a24ad7a3602b14d8b1400aeeb 100644 (file)
@@ -81,6 +81,7 @@
 </style>
 <% end -%>
 <meta name="viewport" content="initial-scale=1.0" />
+<script type="text/javascript" src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
 <script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript" src="<%=resource%>/xhr.js"></script>
 
index 737b6dbc659f5dbaada118c98539c65778c3c80b..07419e866f84d544adf6c52f5a863e0e7cbaf722 100644 (file)
        <% if css then %>
                <style title="text/css"><%= css %></style>
        <% end -%>
+       <script src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
        <script src="<%=resource%>/cbi.js"></script>
        <script src="<%=resource%>/xhr.js"></script>
 </head>
index 873d4d948ebf1307b6dfd7f2d1082346292d54e4..c5186c40c5fd506b7dca2d28a351ff5958982072 100644 (file)
 <%= css %>
 </style>
 <% end -%>
+<script type="text/javascript" src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
 <script type="text/javascript" src="<%=resource%>/cbi.js"></script>
 <script type="text/javascript" src="<%=resource%>/xhr.js"></script>
 <script type="text/javascript">//<![CDATA[