From 6bfef156f2cdcb4e01176ffbac7998625414a8e5 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 10 Oct 2008 11:48:04 +0000 Subject: * luci/app/openvpn: add translations, various improvements --- .../luci-openvpn/luasrc/i18n/openvpn.en.lua | 196 +++++++++++++++++++++ .../luasrc/model/cbi/openvpn-advanced.lua | 6 +- .../luasrc/model/cbi/openvpn-basic.lua | 7 +- .../luci-openvpn/luasrc/model/cbi/openvpn.lua | 18 +- .../luasrc/view/openvpn/pageswitch.htm | 2 +- 5 files changed, 218 insertions(+), 11 deletions(-) create mode 100644 applications/luci-openvpn/luasrc/i18n/openvpn.en.lua (limited to 'applications') diff --git a/applications/luci-openvpn/luasrc/i18n/openvpn.en.lua b/applications/luci-openvpn/luasrc/i18n/openvpn.en.lua new file mode 100644 index 000000000..b56e5780d --- /dev/null +++ b/applications/luci-openvpn/luasrc/i18n/openvpn.en.lua @@ -0,0 +1,196 @@ +openvpn="OpenVPN" + +openvpn_switch_basic="« Switch to basic configuration" +openvpn_switch_advanced="Switch to advanced configuration »" + +openvpn_enable="Enabled" +openvpn_active="Started" +openvpn_active_no="no" +openvpn_active_yes="yes (%i)" +openvpn_port="Port" +openvpn_proto="Protocol" + +openvpn_instance="Instance \"%s\"" + +openvpn_overview="OpenVPN instances" +openvpn_overview_desc="Below is a list of configured OpenVPN instances and their current state" + +openvpn_service="Daemon configuration" +openvpn_networking="Networking options" +openvpn_vpn="VPN options" +openvpn_cryptography="Cryptography settings" + +openvpn_param_config="Read configuration options from file" +openvpn_param_local="Local host name or ip address" +openvpn_param_remote="Remote host name or ip address" +openvpn_param_remote_random="Randomly choose remote server" +openvpn_param_mode="Major mode" +openvpn_param_proto="Use protocol" +openvpn_param_connect_retry="Connection retry interval" +openvpn_param_connect_timeout="Connection timeout" +openvpn_param_connect_retry_max="Maximum connection attempt retries" +openvpn_param_auto_proxy="Try to sense proxy settings automatically" +openvpn_param_http_proxy="Connect to remote host" +openvpn_param_http_proxy_retry="Retry indefinitely on HTTP proxy errors" +openvpn_param_http_proxy_timeout="Proxy timeout in seconds" +openvpn_param_http_proxy_option="Set extended HTTP proxy options" +openvpn_param_socks_proxy="Connect through Socks5 proxy" +openvpn_param_socks_proxy_retry="Retry indefinitely on Socks proxy errors" +openvpn_param_resolv_retry="If hostname resolve fails, retry" +openvpn_param_float="Allow remote to change its IP or port" +openvpn_param_ipchange="Execute shell command on remote ip change" +openvpn_param_port="TCP/UDP port # for both local and remote" +openvpn_param_lport="TCP/UDP port # for local (default=1194)" +openvpn_param_rport="TCP/UDP port # for remote (default=1194)" +openvpn_param_bind="Bind to local address and port" +openvpn_param_nobind="Do not bind to local address and port" +openvpn_param_dev="tun/tap device" +openvpn_param_dev_type="Type of used device" +openvpn_param_dev_node="Use tun/tap device node" +openvpn_param_lladdr="Set the link layer address of the tap device" +openvpn_param_topology="'net30', 'p2p', or 'subnet'" +openvpn_param_tun_ipv6="Make tun device IPv6 capable" +openvpn_param_ifconfig="Configure device to use IP address" +openvpn_param_ifconfig_noexec="Don't actually execute ifconfig" +openvpn_param_ifconfig_nowarn="Don't warn on ifconfig inconsistencies" +openvpn_param_route="Add route after establishing connection" +openvpn_param_route_gateway="Specify a default gateway for routes" +openvpn_param_route_metric="Specify a default metric for routes" +openvpn_param_route_delay="Delay n seconds after connection " +openvpn_param_route_up="Execute shell cmd after routes are added" +openvpn_param_route_noexec="Don't add routes automatically" +openvpn_param_route_nopull="Don't pull options from server" +openvpn_param_redirect_gateway="Automatically redirect default route" +openvpn_param_setenv="Pass environment variables to script" +openvpn_param_shaper="Shaping for peer bandwidth" +openvpn_param_keepalive="Set timeouts in server mode" +openvpn_param_inactive="tun/tap inactivity timeout" +openvpn_param_ping_exit="Remote ping timeout" +openvpn_param_ping_restart="Restart after remote ping timeout" +openvpn_param_ping_timer_rem="Only process ping timeouts if routes exist" +openvpn_param_ping="Ping remote every n seconds over TCP/UDP port" +openvpn_param_multihome="Configure a multi-homed UDP server" +openvpn_param_fast_io="Optimize TUN/TAP/UDP writes" +openvpn_param_remap_usr1="Remap SIGUSR1 signals" +openvpn_param_persist_tun="Keep tun/tap device open on restart" +openvpn_param_persist_remote_ip="Keep remote IP address on restart" +openvpn_param_persist_local_ip="Keep local IP address on restart" +openvpn_param_persist_key="Don't re-read key on restart" +openvpn_param_passtos="TOS passthrough (applies to IPv4 only)" +openvpn_param_tun_mtu="Set tun/tap device MTU" +openvpn_param_tun_mtu_extra="Set tun/tap device overhead" +openvpn_param_link_mtu="Set TCP/UDP MTU" +openvpn_param_mtu_disc="Enable Path MTU discovery" +openvpn_param_mtu_test="Empirically measure MTU" +openvpn_param_fragment="Enable internal datagram fragmentation" +openvpn_param_mssfix="Set upper bound on TCP MSS" +openvpn_param_sndbuf="Set the TCP/UDP send buffer size" +openvpn_param_rcvbuf="Set the TCP/UDP receive buffer size" +openvpn_param_txqueuelen="Set tun/tap TX queue length" +openvpn_param_mlock="Disable Paging" +openvpn_param_up="Shell cmd to execute after tun device open" +openvpn_param_up_delay="Delay tun/tap open and up script execution" +openvpn_param_down="Shell cmd to run after tun device close" +openvpn_param_down_pre="Call down cmd/script before TUN/TAP close" +openvpn_param_up_restart="Run up/down scripts for all restarts" +openvpn_param_user="Set UID to user" +openvpn_param_group="Set GID to group" +openvpn_param_chroot="Chroot to directory after initialization" +openvpn_param_cd="Change to directory before initialization" +openvpn_param_daemon="Daemonize after initialization" +openvpn_param_syslog="Output to syslog and do not daemonize" +openvpn_param_inetd="Run as an inetd or xinetd server" +openvpn_param_log="Write log to file" +openvpn_param_log_append="Append log to file" +openvpn_param_suppress_timestamps="Don't log timestamps" +openvpn_param_writepid="Write process ID to file" +openvpn_param_nice="Change process priority" +openvpn_param_echo="Echo parameters to log" +openvpn_param_verb="Set output verbosity" +openvpn_param_mute="Limit repeated log messages" +openvpn_param_status="Write status to file every n seconds" +openvpn_param_status_version="Status file format version" +openvpn_param_disable_occ="Disable options consistency check" +openvpn_param_gremlin="Special stress testing mode" +openvpn_param_comp_lzo="Use fast LZO compression" +openvpn_param_comp_noadapt="Don't use adaptive lzo compression" +openvpn_param_management="Enable TCP server on ip:port" +openvpn_param_management_client="Management interface will connect as a TCP client" +openvpn_param_management_query_passwords="Query management channel for private key" +openvpn_param_management_hold="Start OpenVPN in a hibernating state" +openvpn_param_management_signal="Issue SIGUSR1 on management disconnect" +openvpn_param_management_forget_disconnect="Forget passwords on management disconnect" +openvpn_param_management_log_cache="Number of lines for log file history" +openvpn_param_plugin="Load plug-in module" +openvpn_param_server="Configure server mode" +openvpn_param_server_bridge="Configure server bridge" +openvpn_param_push="Push options to peer" +openvpn_param_push_reset="Don't inherit global push options" +openvpn_param_ifconfig_pool="Set aside a pool of subnets" +openvpn_param_ifconfig_pool_linear="Use individual addresses rather than /30 subnets" +openvpn_param_ifconfig_pool_persist="Persist/unpersist ifconfig-pool" +openvpn_param_ifconfig_push="Push an ifconfig option to remote" +openvpn_param_iroute="Route subnet to client" +openvpn_param_disable="Client is disabled" +openvpn_param_client_cert_not_required="Don't require client certificate" +openvpn_param_username_as_common_name="Use username as common name" +openvpn_param_auth_user_pass_verify="Script to verify interactive authentication" +openvpn_param_client_to_client="Allow client-to-client traffic" +openvpn_param_duplicate_cn="Allow multiple clients with same certificate" +openvpn_param_client_connect="Run script cmd on client connection" +openvpn_param_client_disconnect="Run script cmd on client disconnection" +openvpn_param_client_config_dir="Directory for custom client config files" +openvpn_param_ccd_exclusive="Refuse connection if no custom client config" +openvpn_param_tmp_dir="Temporary directory for client-connect return file" +openvpn_param_hash_size="Set size of real and virtual address hash tables" +openvpn_param_bcast_buffers="Number of allocated broadcast buffers" +openvpn_param_tcp_queue_limit="Maximum number of queued TCP output packets" +openvpn_param_learn_address="Script to validate client virtual addresses" +openvpn_param_connect_freq="Allowed maximum of new connections" +openvpn_param_max_clients="Allowed maximum of connected clients" +openvpn_param_max_routes_per_client="Allowed maximum of internal" +openvpn_param_port_share="Proxy incoming HTTPS sessions" +openvpn_param_client="Configure client mode" +openvpn_param_auth_user_pass="Authenticate using username/password" +openvpn_param_pull="Accept options pushed from server" +openvpn_param_auth_retry="Handling of authentication failures" +openvpn_param_explicit_exit_notify="Send notification to peer on disconnect" +openvpn_param_secret="Enable Static Key encryption mode (non-TLS)" +openvpn_param_auth="HMAC authentication for packets" +openvpn_param_cipher="Encryption cipher for packets" +openvpn_param_keysize="Size of cipher key" +openvpn_param_engine="Enable OpenSSL hardware crypto engines" +openvpn_param_no_replay="Disable replay protection" +openvpn_param_mute_replay_warnings="Silence the output of replay warnings" +openvpn_param_replay_window="Replay protection sliding window size" +openvpn_param_no_iv="Disable cipher initialisation vector" +openvpn_param_replay_persist="Persist replay-protection state" +openvpn_param_test_crypto="Run a self-test of crypto features" +openvpn_param_tls_server="Enable TLS and assume server role" +openvpn_param_tls_client="Enable TLS and assume client role" +openvpn_param_key_method="Data channel key exchange method" +openvpn_param_ca="Certificate authority" +openvpn_param_capath="Directory of trusted certificates (CAs and CRLs)" +openvpn_param_dh="Diffie Hellman parameters" +openvpn_param_cert="Local certificate" +openvpn_param_key="Local private key" +openvpn_param_pkcs12="PKCS#12 file containing keys" +openvpn_param_tls_cipher="TLS cipher" +openvpn_param_tls_timeout="Retransmit timeout on TLS control channel" +openvpn_param_reneg_bytes="Renegotiate data chan. key after bytes" +openvpn_param_reneg_pkts="Renegotiate data chan. key after packets" +openvpn_param_reneg_sec="Renegotiate data chan. key after seconds" +openvpn_param_hand_window="Timeframe for key exchange" +openvpn_param_tran_window="Key transition window" +openvpn_param_single_session="Allow only one session" +openvpn_param_tls_exit="Exit on TLS negotiation failure" +openvpn_param_tls_auth="Additional authentication over TLS" +openvpn_param_askpass="Get PEM password from controlling tty before we daemonize" +openvpn_param_auth_nocache="Don't cache --askpass or --auth-user-pass passwords" +openvpn_param_crl_verify="Check peer certificate against a CRL" +openvpn_param_tls_verify="Shell command to verify X509 name" +openvpn_param_tls_remote="Only accept connections from given X509 name" +openvpn_param_ns_cert_type="Require explicit designation on certificate" +openvpn_param_remote_cert_ku="Require explicit key usage on certificate" +openvpn_param_remote_cert_eku="Require extended explicit key usage on certificate" +openvpn_param_remote_cert_tls="Require normal and extended key usage on certificate" diff --git a/applications/luci-openvpn/luasrc/model/cbi/openvpn-advanced.lua b/applications/luci-openvpn/luasrc/model/cbi/openvpn-advanced.lua index 40af624b9..b1941e15f 100644 --- a/applications/luci-openvpn/luasrc/model/cbi/openvpn-advanced.lua +++ b/applications/luci-openvpn/luasrc/model/cbi/openvpn-advanced.lua @@ -230,7 +230,11 @@ s.anonymous = true for _, option in ipairs(params) do - local o = s:option(option[1], option[2]) + local o = s:option( + option[1], option[2], + translate("openvpn_param_%s" % option[2]), + translate("openvpn_param_%s_desc" % option[2]) + ) if option[1] == DummyValue then o.value = option[3] diff --git a/applications/luci-openvpn/luasrc/model/cbi/openvpn-basic.lua b/applications/luci-openvpn/luasrc/model/cbi/openvpn-basic.lua index 964da447e..cadf558bf 100644 --- a/applications/luci-openvpn/luasrc/model/cbi/openvpn-basic.lua +++ b/applications/luci-openvpn/luasrc/model/cbi/openvpn-basic.lua @@ -61,7 +61,12 @@ p.instance = arg[1] local s = m:section( NamedSection, arg[1], "openvpn" ) for _, option in ipairs(basicParams) do - local o = s:option(option[1], option[2]) + local o = s:option( + option[1], option[2], + translate("openvpn_param_%s" % option[2]), + translate("openvpn_param_%s_desc" % option[2]) + ) + o.optional = true if option[1] == DummyValue then diff --git a/applications/luci-openvpn/luasrc/model/cbi/openvpn.lua b/applications/luci-openvpn/luasrc/model/cbi/openvpn.lua index 22cdcb4d6..863be2f13 100644 --- a/applications/luci-openvpn/luasrc/model/cbi/openvpn.lua +++ b/applications/luci-openvpn/luasrc/model/cbi/openvpn.lua @@ -20,8 +20,8 @@ require("luci.model.uci") local uci = luci.model.uci.cursor() -local m = Map("openvpn") -local s = m:section( TypedSection, "openvpn" ) +local m = Map("openvpn", translate("openvpn")) +local s = m:section( TypedSection, "openvpn", translate("openvpn_overview"), translate("openvpn_overview_desc") ) s.template = "cbi/tblsection" s.template_addremove = "openvpn/cbi-select-input-add" s.addremove = true @@ -70,26 +70,28 @@ function s.create(self, name) end -s:option( Flag, "enable" ) +s:option( Flag, "enable", translate("openvpn_enable") ) -local active = s:option( DummyValue, "_active" ) +local active = s:option( DummyValue, "_active", translate("openvpn_active") ) function active.cfgvalue(self, section) if luci.fs.isfile("/var/run/openvpn_%s.pid" % section) then local pid = io.lines("/var/run/openvpn_%s.pid" % section)() if pid and #pid > 0 and tonumber(pid) ~= nil then - return (luci.sys.process.signal(pid, 0)) and "yes (" .. pid .. ")" or "no" + return (luci.sys.process.signal(pid, 0)) + and translatef("openvpn_active_yes", pid) + or translate("openvpn_active_no") end end - return "no" + return translate("openvpn_active_no") end -local port = s:option( DummyValue, "port" ) +local port = s:option( DummyValue, "port", translate("openvpn_port") ) function port.cfgvalue(self, section) local val = AbstractValue.cfgvalue(self, section) return val or "1194" end -local proto = s:option( DummyValue, "proto" ) +local proto = s:option( DummyValue, "proto", translate("openvpn_proto") ) function proto.cfgvalue(self, section) local val = AbstractValue.cfgvalue(self, section) return val or "udp" diff --git a/applications/luci-openvpn/luasrc/view/openvpn/pageswitch.htm b/applications/luci-openvpn/luasrc/view/openvpn/pageswitch.htm index a58766638..3203f0c74 100644 --- a/applications/luci-openvpn/luasrc/view/openvpn/pageswitch.htm +++ b/applications/luci-openvpn/luasrc/view/openvpn/pageswitch.htm @@ -16,7 +16,7 @@ $Id$
"><%:openvpn_overview Overview%> » - "><%=self.instance%> + <%=luci.i18n.translatef("openvpn_instance", "%s", self.instance)%> <% if self.mode == "basic" then %> -- cgit v1.2.3