# HG changeset patch # User Christophe Lincoln # Date 1302063443 -7200 # Node ID 1a80f769f6e127268dbc39c14fa0ddde249003e0 # Parent 5f2f886182922e752e5d3109a7bae651de4cd108 Move network shared function (used by summary) to libtazpanel and include libtazpanel in POT file diff -r 5f2f88618292 -r 1a80f769f6e1 Makefile --- a/Makefile Wed Apr 06 06:09:34 2011 +0200 +++ b/Makefile Wed Apr 06 06:17:23 2011 +0200 @@ -14,7 +14,8 @@ xgettext -o po/tazpanel.pot -L Shell \ --package-name="TazPanel" \ --package-version="$(VERSION)" \ - ./tazpanel ./index.cgi ./pkgs.cgi ./live.cgi ./network.cgi + ./tazpanel ./index.cgi ./pkgs.cgi ./live.cgi \ + ./network.cgi ./lib/libtazpanel msgmerge: @for l in $(LINGUAS); do \ diff -r 5f2f88618292 -r 1a80f769f6e1 README --- a/README Wed Apr 06 06:09:34 2011 +0200 +++ b/README Wed Apr 06 06:17:23 2011 +0200 @@ -11,7 +11,7 @@ ---- TazPanel have been coded from the beginning with gettext support. Please forget 'echo' and use gettext, but remember that gettext "" is equivalent -to echo -n. Each script have it own TEXTDOMAIN and pot files as well, all +to echo -n. All script use the same TEXTDOMAIN and the same pot files, all translations goes in the po/ folder. To start a new translation please use msginit from the pot file directory. Example for French/France locale (fr_FR): diff -r 5f2f88618292 -r 1a80f769f6e1 index.cgi --- a/index.cgi Wed Apr 06 06:09:34 2011 +0200 +++ b/index.cgi Wed Apr 06 06:17:23 2011 +0200 @@ -18,48 +18,6 @@ TEXTDOMAIN='tazpanel' export TEXTDOMAIN -# Network interface status -interface_status() { - if ifconfig | grep -A 1 $i | grep -q inet; then - ip=`ifconfig | grep -A 1 $i | grep inet | \ - awk '{ print $2 }' | cut -d ":" -f 2` - echo "connected$ip" - else - echo "--------" - fi -} - -# Catch network interface (network is splited this function and above -# must go in lib/libtazpanel -list_network_interfaces() { - table_start - cat << EOT - - `gettext "Interface"` - `gettext "Name"` - `gettext "Status"` - `gettext "IP Address"` - -EOT - for i in `ls /sys/class/net` - do - case $i in - eth*) - echo "$i - Ethernet `interface_status`" ;; - wlan*|ath*|ra*) - echo "$i - Wireless `interface_status`" ;; - lo) - echo "$i - Loopback `interface_status`" ;; - *) - continue ;; - esac - done - table_end -} - # # Commands # @@ -174,26 +132,6 @@ EOT ;; - network) - # - # Network configuration - # - TITLE="- Network" - xhtml_header - cat << EOT -
-

`gettext "Networking`

-

`gettext "Manage network connection and services`

-
- -`list_network_interfaces` - -

Output of: ifconfig -a

-
-`ifconfig -a`
-
-EOT - ;; hardware) # # Hardware drivers, devices, filesystem, screen diff -r 5f2f88618292 -r 1a80f769f6e1 lib/libtazpanel --- a/lib/libtazpanel Wed Apr 06 06:09:34 2011 +0200 +++ b/lib/libtazpanel Wed Apr 06 06:17:23 2011 +0200 @@ -3,6 +3,13 @@ # Common functions for TazPanel CGI and cmdline interface # +# Include gettext helper script. +. /usr/bin/gettext.sh + +# Export package name for gettext. +TEXTDOMAIN='tazpanel' +export TEXTDOMAIN + # We need a config file first get_config() { CONFIG="/etc/slitaz/tazpanel.conf" @@ -13,6 +20,47 @@ exit 1 } +# Network interface status +interface_status() { + if ifconfig | grep -A 1 $i | grep -q inet; then + ip=`ifconfig | grep -A 1 $i | grep inet | \ + awk '{ print $2 }' | cut -d ":" -f 2` + echo "connected$ip" + else + echo "--------" + fi +} + +# Catch network interface (used in summary and network main page) +list_network_interfaces() { + table_start + cat << EOT + + `gettext "Interface"` + `gettext "Name"` + `gettext "Status"` + `gettext "IP Address"` + +EOT + for i in `ls /sys/class/net` + do + case $i in + eth*) + echo "$i + Ethernet `interface_status`" ;; + wlan*|ath*|ra*) + echo "$i + Wireless `interface_status`" ;; + lo) + echo "$i + Loopback `interface_status`" ;; + *) + continue ;; + esac + done + table_end +} + # # xHTML 5 (header and footer skel are from the style) # diff -r 5f2f88618292 -r 1a80f769f6e1 po/tazpanel.pot --- a/po/tazpanel.pot Wed Apr 06 06:09:34 2011 +0200 +++ b/po/tazpanel.pot Wed Apr 06 06:17:23 2011 +0200 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: TazPanel 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-04-06 06:09+0200\n" +"POT-Creation-Date: 2011-04-06 06:15+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -41,119 +41,99 @@ msgid "Usage:" msgstr "" -#: index.cgi:38 -msgid "Interface" +#: index.cgi:34 +msgid "Boot & startup" msgstr "" -#: index.cgi:39 index.cgi:133 pkgs.cgi:117 +#: index.cgi:36 +msgid "Everything that appends before user login." +msgstr "" + +#: index.cgi:40 +msgid "Kernel cmdline" +msgstr "" + +#: index.cgi:81 +msgid "Manage users" +msgstr "" + +#: index.cgi:82 +msgid "Manage human users on your SliTaz system" +msgstr "" + +#: index.cgi:89 +msgid "Login" +msgstr "" + +#: index.cgi:90 +msgid "User ID" +msgstr "" + +#: index.cgi:91 pkgs.cgi:117 lib/libtazpanel:40 msgid "Name" msgstr "" -#: index.cgi:40 -msgid "Status" +#: index.cgi:92 +msgid "Home" msgstr "" -#: index.cgi:41 -msgid "IP Address" +#: index.cgi:93 +msgid "SHell" msgstr "" -#: index.cgi:76 -msgid "Boot & startup" -msgstr "" - -#: index.cgi:78 -msgid "Everything that appends before user login." -msgstr "" - -#: index.cgi:82 -msgid "Kernel cmdline" -msgstr "" - -#: index.cgi:123 -msgid "Manage users" +#: index.cgi:120 +msgid "Delete selected user" msgstr "" #: index.cgi:124 -msgid "Manage human users on your SliTaz system" +msgid "Add a new user" +msgstr "" + +#: index.cgi:127 +msgid "User login:" +msgstr "" + +#: index.cgi:129 +msgid "User password:" msgstr "" #: index.cgi:131 -msgid "Login" +msgid "Create user" msgstr "" -#: index.cgi:132 -msgid "User ID" +#: index.cgi:143 +msgid "Drivers & Devices" msgstr "" -#: index.cgi:134 -msgid "Home" +#: index.cgi:144 +msgid "Manage your computer hardware" msgstr "" -#: index.cgi:135 -msgid "SHell" +#: index.cgi:164 +msgid "Host:" msgstr "" -#: index.cgi:162 -msgid "Delete selected user" +#: index.cgi:165 +msgid "SliTaz administration et configuration Panel" msgstr "" -#: index.cgi:166 -msgid "Add a new user" -msgstr "" - -#: index.cgi:169 -msgid "User login:" +#: index.cgi:168 pkgs.cgi:390 +msgid "Summary" msgstr "" #: index.cgi:171 -msgid "User password:" -msgstr "" - -#: index.cgi:173 -msgid "Create user" -msgstr "" - -#: index.cgi:185 network.cgi:32 -msgid "Networking" -msgstr "" - -#: index.cgi:186 network.cgi:33 -msgid "Manage network connection and services" -msgstr "" - -#: index.cgi:205 -msgid "Drivers & Devices" -msgstr "" - -#: index.cgi:206 -msgid "Manage your computer hardware" -msgstr "" - -#: index.cgi:226 -msgid "Host:" -msgstr "" - -#: index.cgi:227 -msgid "SliTaz administration et configuration Panel" -msgstr "" - -#: index.cgi:230 pkgs.cgi:390 -msgid "Summary" -msgstr "" - -#: index.cgi:233 msgid "Uptime:" msgstr "" -#: index.cgi:236 +#: index.cgi:174 msgid "Memory in Mb" msgstr "" -#: index.cgi:243 +#: index.cgi:181 msgid "Network status" msgstr "" -#: index.cgi:246 +#: index.cgi:184 msgid "Filesystem usage statistics" msgstr "" @@ -337,3 +317,23 @@ #: live.cgi:99 msgid "generate" msgstr "" + +#: network.cgi:32 +msgid "Networking" +msgstr "" + +#: network.cgi:33 +msgid "Manage network connection and services" +msgstr "" + +#: lib/libtazpanel:39 +msgid "Interface" +msgstr "" + +#: lib/libtazpanel:41 +msgid "Status" +msgstr "" + +#: lib/libtazpanel:42 +msgid "IP Address" +msgstr "" diff -r 5f2f88618292 -r 1a80f769f6e1 styles/default/header.html --- a/styles/default/header.html Wed Apr 06 06:09:34 2011 +0200 +++ b/styles/default/header.html Wed Apr 06 06:17:23 2011 +0200 @@ -15,10 +15,10 @@