gluon-config-mode-reboot-ffhh: add i18n support

This commit is contained in:
bjoern 2015-04-11 09:53:14 +02:00
parent 918d892f15
commit 818765060b
3 changed files with 6 additions and 10 deletions

View file

@ -7,6 +7,8 @@ PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-config-mode-reboot-ffhh
SECTION:=gluon
CATEGORY:=Gluon
@ -28,9 +30,5 @@ define Package/gluon-config-mode-reboot-ffhh/install
$(CP) ./files/* $(1)/
endef
define Package/gluon-config-mode-reboot-ffhh/postinst
#!/bin/sh
$(call GluonCheckSite,check_site.lua)
endef
$(eval $(call BuildPackage,gluon-config-mode-reboot-ffhh))

View file

@ -1 +0,0 @@
need_string 'config_mode.msg_nopubkey'

View file

@ -1,18 +1,17 @@
local msg = [[<p>
<%= luci.template.render_string(site.config_mode.msg_nopubkey) %>
</p>]]
local uci = luci.model.uci.cursor()
local meshvpn_enabled = uci:get("fastd", "mesh_vpn", "enabled", "0")
if meshvpn_enabled == "1" then
return nil
else
local i18n = require "luci.i18n"
local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig'
local hostname = uci:get_first("system", "system", "hostname")
local msg = [[<p>]] .. i18n.translate('gluon-config-mode:nopubkey') .. [[</p>]]
return function ()
luci.template.render_string(msg, { hostname=hostname
, site=site