diff --git a/curses/netentry_curses.py b/curses/netentry_curses.py index c00c887..52f89cc 100644 --- a/curses/netentry_curses.py +++ b/curses/netentry_curses.py @@ -28,7 +28,9 @@ from wicd.misc import noneToString, stringToNone, noneToBlankString, to_bool -language = misc.get_language_list_gui() +from wicd.translations import language +for i in language.keys(): + language[i] = language[i].decode('utf8') daemon = None wired = None @@ -56,9 +58,9 @@ class AdvancedSettingsDialog(urwid.WidgetWrap): use_global_dns_t = language['use_global_dns'] dns_dom_t = ('editcp',language['dns_domain']+': ') search_dom_t = ('editcp',language['search_domain']+':') - dns1_t = ('editcp',language['dns']+ ' ' + language['1']+':'+' '*8) - dns2_t = ('editcp',language['dns']+ ' ' + language['2']+':'+' '*8) - dns3_t = ('editcp',language['dns']+ ' ' + language['3']+':'+' '*8) + dns1_t = ('editcp',language['dns']+ ' 1'+':'+' '*8) + dns2_t = ('editcp',language['dns']+ ' 2'+':'+' '*8) + dns3_t = ('editcp',language['dns']+ ' 3'+':'+' '*8) cancel_t = 'Cancel' ok_t = 'OK' diff --git a/curses/prefs_curses.py b/curses/prefs_curses.py index 992bc84..c13d756 100755 --- a/curses/prefs_curses.py +++ b/curses/prefs_curses.py @@ -28,7 +28,9 @@ daemon = None wireless = None wired = None -language = misc.get_language_list_gui() +from wicd.translations import language +for i in language.keys(): + language[i] = language[i].decode('utf8') class PrefsDialog(urwid.WidgetWrap): def __init__(self,body,pos,ui,dbus=None): diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 0428085..cc4dce3 100644 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -67,9 +67,10 @@ from optparse import OptionParser CURSES_REVNO=wpath.curses_revision -language = misc.get_language_list_gui() -# We need 'Connecting' without the '...' -language['connecting']=misc.get_language_list_tray()['connecting'] +# Fix strings in wicd-curses +from wicd.translations import language +for i in language.keys(): + language[i] = language[i].decode('utf8') ######################################## ##### SUPPORT CLASSES diff --git a/images/wicd-blue.png b/images/wicd-blue.png deleted file mode 100644 index 460b80f..0000000 Binary files a/images/wicd-blue.png and /dev/null differ diff --git a/images/wicd-client.png b/images/wicd-client.png deleted file mode 100644 index 1487bdb..0000000 Binary files a/images/wicd-client.png and /dev/null differ diff --git a/images/wicd-green.png b/images/wicd-green.png deleted file mode 100644 index 67dde2b..0000000 Binary files a/images/wicd-green.png and /dev/null differ diff --git a/images/wicd-orange.png b/images/wicd-orange.png deleted file mode 100644 index a0c87ed..0000000 Binary files a/images/wicd-orange.png and /dev/null differ diff --git a/images/wicd-purple.png b/images/wicd-purple.png deleted file mode 100644 index bc78156..0000000 Binary files a/images/wicd-purple.png and /dev/null differ diff --git a/images/wicd-red.png b/images/wicd-red.png deleted file mode 100644 index 42eb9aa..0000000 Binary files a/images/wicd-red.png and /dev/null differ diff --git a/setup.py b/setup.py index a9fa0d0..dd9f851 100755 --- a/setup.py +++ b/setup.py @@ -162,7 +162,6 @@ class configure(Command): self.init = '/etc/rc.d/' else: self.init = 'FAIL' - self.initfile = 'FAIL' self.no_install_init = True self.distro_detect_failed = True print 'WARNING: Unable to detect the distribution in use. ' + \ @@ -490,16 +489,17 @@ Wicd supports wired and wireless networks, and capable of creating and tracking profiles for both. It has a template-based wireless encryption system, which allows the user to easily add encryption methods used. It ships with some common -encryption types, such as WPA and WEP. Wicd will automatically +encryption types, such as WPA and WEP. Wicdl will automatically connect at startup to any preferred network within range. """, author="Adam Blackburn, Dan O'Reilly", - author_email="compwiz18@users.sourceforge.net, oreilldf@gmail.com", + author_email="compwiz18@gmail.com, oreilldf@gmail.com", url="http://wicd.net", license="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html", - py_modules=['wicd.networking', 'wicd.misc', 'wicd.gui', 'wicd.wnettools', - 'wicd.wpath', 'wicd.prefs', 'wicd.netentry', 'wicd.dbusmanager', - 'wicd.logfile', 'wicd.backend', 'wicd.configmanager', 'wicd.guiutil'], + py_modules=['wicd.networking','wicd.misc','wicd.gui','wicd.wnettools', + 'wicd.wpath','wicd.prefs','wicd.netentry','wicd.dbusmanager', + 'wicd.logfile','wicd.backend','wicd.configmanager', + 'wicd.guiutil','wicd.translations'], ext_modules=[iwscan_ext, wpactrl_ext], data_files=data ) diff --git a/wicd/gui.py b/wicd/gui.py index 1f23fb8..4be5bfb 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -43,12 +43,12 @@ from wicd.misc import noneToString from wicd.netentry import WiredNetworkEntry, WirelessNetworkEntry from wicd.prefs import PreferencesDialog from wicd.guiutil import error, GreyLabel, LabelEntry, SmallLabel +from wicd.translations import language if __name__ == '__main__': wpath.chdir(__file__) proxy_obj = daemon = wireless = wired = bus = None -language = misc.get_language_list_gui() DBUS_AVAIL = False def setup_dbus(force=True): diff --git a/wicd/misc.py b/wicd/misc.py index cc57deb..dac2743 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -19,7 +19,6 @@ import os import locale -import gettext import sys import re import gobject @@ -339,36 +338,6 @@ def noneToString(text): else: return str(text) -def get_gettext(): - """ Set up gettext for translations. """ - # Borrowed from an excellent post on how to do this at - # http://www.learningpython.com/2006/12/03/translating-your-pythonpygtk-application/ - local_path = wpath.translations - langs = [] - osLanguage = os.environ.get('LANGUAGE', None) - if osLanguage: - langs += osLanguage.split(":") - osLanguage = None - osLanguage = os.environ.get('LC_MESSAGES', None) - if osLanguage: - langs += osLanguage.split(":") - try: - # This avoids a bug: locale.getdefaultlocale() prefers - # LC_CTYPE over LANG/LANGUAGE - lc, encoding = locale.getdefaultlocale(envvars=('LC_MESSAGES', - 'LC_ALL', 'LANG', - 'LANGUAGE')) - except ValueError, e: - print str(e) - print "Default locale unavailable, falling back to en_US" - if (lc): - langs += [lc] - langs += ["en_US"] - lang = gettext.translation('wicd', local_path, languages=langs, - fallback=True) - _ = lang.gettext - return _ - def to_unicode(x): """ Attempts to convert a string to utf-8. """ # If this is a unicode string, encode it and return @@ -478,196 +447,6 @@ def find_path(cmd): return os.path.join(path, cmd) return None -def get_language_list_gui(): - """ Returns a dict of translatable strings used by the GUI. - - Translations are done at http://wicd.net/translator. Please - translate if you can. - - """ - _ = get_gettext() - language = {} - language['connect'] = _("Connect") - language['ip'] = _("IP") - language['netmask'] = _("Netmask") - language['gateway'] = _('Gateway') - language['dns'] = _('DNS') - language['use_static_ip'] = _('Use Static IPs') - language['use_static_dns'] = _('Use Static DNS') - language['use_encryption'] = _('Use Encryption') - language['advanced_settings'] = _('Advanced Settings') - language['properties'] = _('Properties') - language['wired_network'] = _('Wired Network') - language['wired_network_instructions'] = _('To connect to a wired network,' - ' you must create a network profile. To create a network profile, type a' - ' name that describes this network, and press Add.') - language['automatic_connect'] = _('Automatically connect to this network') - language['secured'] = _('Secured') - language['unsecured'] = _('Unsecured') - language['channel'] = _('Channel') - language['preferences'] = _('Preferences') - language['wpa_supplicant_driver'] = _('WPA Supplicant Driver') - language['wireless_interface'] = _('Wireless Interface') - language['wired_interface'] = _('Wired Interface') - language['hidden_network'] = _('Hidden Network') - language['hidden_network_essid'] = _('Hidden Network ESSID') - language['connected_to_wireless'] = _('Connected to $A at $B (IP: $C)') - language['connected_to_wired'] = _('Connected to wired network (IP: $A)') - language['not_connected'] = _('Not connected') - language['no_wireless_networks_found'] = _('No wireless networks found.') - language['killswitch_enabled'] = _('Wireless Kill Switch Enabled') - language['key'] = _('Key') - language['username'] = _('Username') - language['password'] = _('Password') - language['anonymous_identity'] = _('Anonymous Identity') - language['identity'] = _('Identity') - language['authentication'] = _('Authentication') - language['path_to_pac_file'] = _('Path to PAC File') - language['select_a_network'] = _('Choose from the networks below:') - language['connecting'] = _('Connecting...') - language['wired_always_on'] = _('Always show wired interface') - language['auto_reconnect'] = _('Automatically reconnect on connection loss') - language['create_adhoc_network'] = _('Create an Ad-Hoc Network') - language['essid'] = _('ESSID') - language['use_wep_encryption'] = _('Use Encryption (WEP only)') - language['before_script'] = _('Run script before connect') - language['after_script'] = _('Run script after connect') - language['disconnect_script'] = _('Run disconnect script') - language['script_settings'] = _('Scripts') - language['use_ics'] = _('Activate Internet Connection Sharing') - language['madwifi_for_adhoc'] = _('Check if using madwifi/atheros drivers') - language['default_wired'] = _('Use as default profile (overwrites any previous default)') - language['use_debug_mode'] = _('Enable debug mode') - language['use_global_dns'] = _('Use global DNS servers') - language['use_default_profile'] = _('Use default profile on wired autoconnect') - language['show_wired_list'] = _('Prompt for profile on wired autoconnect') - language['use_last_used_profile'] = _('Use last used profile on wired autoconnect') - language['choose_wired_profile'] = _('Select or create a wired profile to connect with') - language['wired_network_found'] = _('Wired connection detected') - language['stop_showing_chooser'] = _('Stop Showing Autoconnect pop-up temporarily') - language['display_type_dialog'] = _('Use dBm to measure signal strength') - language['scripts'] = _('Scripts') - #language['invalid_address'] = _('Invalid address in $A entry.') - language['global_settings'] = _('Use these settings for all networks sharing this essid') - language['encrypt_info_missing'] = _('Required encryption information is missing.') - language['enable_encryption'] = _('This network requires encryption to be enabled.') - language['wicd_auto_config'] = _('Automatic (recommended)') - language["gen_settings"] = _("General Settings") - language["ext_programs"] = _("External Programs") - language["dhcp_client"] = _("DHCP Client") - language["wired_detect"] = _("Wired Link Detection") - language["route_flush"] = _("Route Table Flushing") - language["backend"] = _("Backend") - language["backend_alert"] = _("Changes to your backend won't occur until the daemon is restarted.") - language['dns_domain'] = _("DNS domain") - language['search_domain'] = _("Search domain") - language['global_dns_not_enabled'] = _("Global DNS has not been enabled in general preferences.") - language['scripts_need_pass'] = _('You must enter your password to configure scripts') - language['no_sudo_prog'] = _("Could not find a graphical sudo program. The script editor could not be launched." + - " You'll have to edit scripts directly your configuration file.") - - language['0'] = _('0') - language['1'] = _('1') - language['2'] = _('2') - language['3'] = _('3') - language['4'] = _('4') - language['5'] = _('5') - language['6'] = _('6') - language['7'] = _('7') - language['8'] = _('8') - language['9'] = _('9') - - language['interface_down'] = _('Putting interface down...') - language['resetting_ip_address'] = _('Resetting IP address...') - language['interface_up'] = _('Putting interface up...') - language['setting_encryption_info'] = _('Setting encryption info') - language['removing_old_connection'] = _('Removing old connection...') - language['generating_psk'] = _('Generating PSK...') - language['generating_wpa_config'] = _('Generating WPA configuration file...') - language['flushing_routing_table'] = _('Flushing the routing table...') - language['configuring_interface'] = _('Configuring wireless interface...') - language['validating_authentication'] = _('Validating authentication...') - language['setting_broadcast_address'] = _('Setting broadcast address...') - language['setting_static_dns'] = _('Setting static DNS servers...') - language['setting_static_ip'] = _('Setting static IP addresses...') - language['running_dhcp'] = _('Obtaining IP address...') - language['dhcp_failed'] = _('Connection Failed: Unable to Get IP Address') - language['no_dhcp_offers'] = _('Connection Failed: No DHCP offers received.') - language['aborted'] = _('Connection Cancelled') - language['bad_pass'] = _('Connection Failed: Could not authenticate (bad password?)') - language['done'] = _('Done connecting...') - language['scanning'] = _('Scanning') - language['scanning_stand_by'] = _('Scanning networks... stand by...') - language['cannot_start_daemon'] = _("Unable to connect to wicd daemon DBus interface. " + \ - "This typically means there was a problem starting the daemon. " + \ - "Check the wicd log for more info") - language['lost_dbus'] = _("The wicd daemon has shut down, the UI will not function properly until it is restarted.") - language['configuring_wireless'] = _("Configuring preferences for wireless network \"$A\" ($B)") - language['configuring_wired'] = _("Configuring preferences for wired profile \"$A\"") - language['scan'] = _('Scan') - language['always_switch_to_wired'] = _("Always switch to wired connection when available") - language['wired_autoconnect_settings'] = _("Wired Autoconnect Settings") - language['always_use_wext'] = _("You should almost always use wext as the WPA supplicant driver") - language['debugging'] = _("Debugging") - language['wpa_supplicant'] = _("WPA Supplicant") - language['automatic_reconnection'] = _("Automatic Reconnection") - language['global_dns_servers'] = _("Global DNS servers") - language['network_interfaces'] = _("Network Interfaces") - language['connecting_to_daemon'] = _("Connecting to daemon...") - language['cannot_connect_to_daemon'] = _("Can't connect to the daemon, trying to start it automatically...") - language['could_not_connect'] = _("Could not connect to wicd's D-Bus interface. Check the wicd log for error messages.") - language["exception"] = _("EXCEPTION! Please report this to the maintainer and file a bug report with the backtrace below:") - language["brought_to_you"] = _("Brought to you by:") - language["cannot_edit_scripts_1"] = _('To avoid various complications, wicd-curses does not support directly editing the scripts directly. However, you can edit them manually. First, (as root), open the "$A" config file, and look for the section labeled by the $B in question. In this case, this is:') - language["cannot_edit_scripts_2"] = _('Once here, you can adjust (or add) the "beforescript", "afterscript", and "disconnectscript" variables as needed, to change the preconnect, postconnect, and disconnect scripts respectively. Alternatively, you can configure the wireless networks by ESSID, by looking for the "[]" field in the config file.') - language["add_new_profile"] = _("Add a new profile") - language["add_new_wired_profile"] = _("Add a new wired profile") - language["no_delete_last_profile"] = _("wicd-curses does not support deleting the last wired profile. Try renaming it ('F2')") - language["rename_wired_profile"] = _("Rename wired profile") - language["select_hidden_essid"] = _("Select Hidden Network ESSID") - language["esc_to_cancel"] = _("Press ESC to cancel") - language["press_to_quit"] = _("Press F8 or Q to quit.") - - language['terminated'] = _("Terminated by user") - language['wicd_curses'] = _("Wicd Curses Interface") - language['dbus_fail'] = _("DBus failure! This is most likely caused by the wicd daemon stopping while wicd-curses is running. Please restart the daemon, and then restart wicd-curses.") - - # Fix strings in wicd-curses - for i in language.keys(): - try : - language[i] = language[i].decode('utf8') - except: - print "\"%s\"" % language[i] - raise - - - return language - -def get_language_list_tray(): - """ Returns a dict of translatable strings used by the tray icon. - - Translations are done at http://wicd.net/translator. Please - translate if you can. - - """ - _ = get_gettext() - language = {} - language['connected_to_wireless'] = _('Connected to $A at $B (IP: $C)') - language['connected_to_wired'] = _('Connected to wired network (IP: $A)') - language['not_connected'] = _('Not connected') - language['killswitch_enabled'] = _('Wireless Kill Switch Enabled') - language['connecting'] = _('Connecting') - language['wired'] = _('Wired Network') - language['scanning'] = _('Scanning') - language['no_wireless_networks_found'] = _('No wireless networks found.') - language['daemon_unavailable'] = _("The wicd daemon is unavailable, so your request cannot be completed") - language['cannot_start_daemon'] = _("Unable to connect to wicd daemon DBus interface." + \ - "This typically means there was a problem starting the daemon." + \ - "Check the wicd log for more info") - language['no_daemon_tooltip'] = _("Wicd daemon unreachable") - language['lost_dbus'] = _("The wicd daemon has shut down, the UI will not function properly until it is restarted.") - return language - def noneToBlankString(text): """ Converts NoneType or "None" to a blank string. """ if text in (None, "None"): diff --git a/wicd/netentry.py b/wicd/netentry.py index 0e1f8fc..58e0be9 100644 --- a/wicd/netentry.py +++ b/wicd/netentry.py @@ -24,7 +24,7 @@ import dbusmanager from misc import noneToString, stringToNone, noneToBlankString, to_bool from guiutil import error, SmallLabel, LabelEntry, GreyLabel, LeftAlignedLabel, string_input -language = misc.get_language_list_gui() +from translations import language # These get set when a NetworkEntry is instantiated. daemon = None @@ -57,9 +57,9 @@ class AdvancedSettingsDialog(gtk.Dialog): self.txt_gateway = LabelEntry(language['gateway']) self.txt_search_dom = LabelEntry(language['search_domain']) self.txt_domain = LabelEntry(language['dns_domain']) - self.txt_dns_1 = LabelEntry(language['dns'] + ' ' + language['1']) - self.txt_dns_2 = LabelEntry(language['dns'] + ' ' + language['2']) - self.txt_dns_3 = LabelEntry(language['dns'] + ' ' + language['3']) + self.txt_dns_1 = LabelEntry(language['dns'] + ' 1') + self.txt_dns_2 = LabelEntry(language['dns'] + ' 2') + self.txt_dns_3 = LabelEntry(language['dns'] + ' 3') self.chkbox_static_ip = gtk.CheckButton(language['use_static_ip']) self.chkbox_static_dns = gtk.CheckButton(language['use_static_dns']) self.chkbox_global_dns = gtk.CheckButton(language['use_global_dns']) diff --git a/wicd/prefs.py b/wicd/prefs.py index 2adfc6d..d25267b 100644 --- a/wicd/prefs.py +++ b/wicd/prefs.py @@ -39,7 +39,7 @@ daemon = None wireless = None wired = None -language = misc.get_language_list_gui() +from translations import language def setup_dbus(): global daemon, wireless, wired diff --git a/wicd/translations.py b/wicd/translations.py new file mode 100644 index 0000000..e9523b1 --- /dev/null +++ b/wicd/translations.py @@ -0,0 +1,226 @@ +#!/usr/bin/env python +# -* coding: utf-8 -*- +# ^^ why do I need this? + +# +# Copyright (C) 2007 - 2009 Adam Blackburn +# Copyright (C) 2007 - 2009 Dan O'Reilly +# Copyright (C) 2009 Andrew Psaltis +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +import locale +import os +import wpath +import gettext + + +def get_gettext(): + """ Set up gettext for translations. """ + # Borrowed from an excellent post on how to do this at + # http://www.learningpython.com/2006/12/03/translating-your-pythonpygtk-application/ + local_path = wpath.translations + langs = [] + osLanguage = os.environ.get('LANGUAGE', None) + if osLanguage: + langs += osLanguage.split(":") + osLanguage = None + osLanguage = os.environ.get('LC_MESSAGES', None) + if osLanguage: + langs += osLanguage.split(":") + try: + # This avoids a bug: locale.getdefaultlocale() prefers + # LC_CTYPE over LANG/LANGUAGE + lc, encoding = locale.getdefaultlocale(envvars=('LC_MESSAGES', + 'LC_ALL', 'LANG', + 'LANGUAGE')) + except ValueError, e: + print str(e) + print "Default locale unavailable, falling back to en_US" + if (lc): + langs += [lc] + langs += ["en_US"] + lang = gettext.translation('wicd', local_path, languages=langs, + fallback=True) + _ = lang.gettext + return _ + +_ = get_gettext() +language = {} +language['connect'] = _('Connect') +language['ip'] = _('IP') +language['netmask'] = _('Netmask') +language['gateway'] = _('Gateway') +language['dns'] = _('DNS') +language['use_static_ip'] = _('Use Static IPs') +language['use_static_dns'] = _('Use Static DNS') +language['use_encryption'] = _('Use Encryption') +language['advanced_settings'] = _('Advanced Settings') +language['properties'] = _('Properties') +language['wired_network'] = _('Wired Network') +language['wired_network_instructions'] = _('To connect to a wired network,' +' you must create a network profile. To create a network profile, type a' +' name that describes this network, and press Add.') +language['automatic_connect'] = _('Automatically connect to this network') +language['secured'] = _('Secured') +language['unsecured'] = _('Unsecured') +language['channel'] = _('Channel') +language['preferences'] = _('Preferences') +language['wpa_supplicant_driver'] = _('WPA Supplicant Driver') +language['wireless_interface'] = _('Wireless Interface') +language['wired_interface'] = _('Wired Interface') +language['hidden_network'] = _('Hidden Network') +language['hidden_network_essid'] = _('Hidden Network ESSID') +language['connected_to_wireless'] = _('Connected to $A at $B (IP: $C)') +language['connected_to_wired'] = _('Connected to wired network (IP: $A)') +language['not_connected'] = _('Not connected') +language['no_wireless_networks_found'] = _('No wireless networks found.') +language['killswitch_enabled'] = _('Wireless Kill Switch Enabled') +language['key'] = _('Key') +language['username'] = _('Username') +language['password'] = _('Password') +language['anonymous_identity'] = _('Anonymous Identity') +language['identity'] = _('Identity') +language['authentication'] = _('Authentication') +language['path_to_pac_file'] = _('Path to PAC File') +language['select_a_network'] = _('Choose from the networks below:') +#language['connecting...'] = _('Connecting...') +language['wired_always_on'] = _('Always show wired interface') +language['auto_reconnect'] = _('Automatically reconnect on connection loss') +language['create_adhoc_network'] = _('Create an Ad-Hoc Network') +language['essid'] = _('ESSID') +language['use_wep_encryption'] = _('Use Encryption (WEP only)') +language['before_script'] = _('Run script before connect') +language['after_script'] = _('Run script after connect') +language['disconnect_script'] = _('Run disconnect script') +language['script_settings'] = _('Scripts') +language['use_ics'] = _('Activate Internet Connection Sharing') +language['madwifi_for_adhoc'] = _('Check if using madwifi/atheros drivers') +language['default_wired'] = _('Use as default profile (overwrites any previous default)') +language['use_debug_mode'] = _('Enable debug mode') +language['use_global_dns'] = _('Use global DNS servers') +language['use_default_profile'] = _('Use default profile on wired autoconnect') +language['show_wired_list'] = _('Prompt for profile on wired autoconnect') +language['use_last_used_profile'] = _('Use last used profile on wired autoconnect') +language['choose_wired_profile'] = _('Select or create a wired profile to connect with') +language['wired_network_found'] = _('Wired connection detected') +language['stop_showing_chooser'] = _('Stop Showing Autoconnect pop-up temporarily') +language['display_type_dialog'] = _('Use dBm to measure signal strength') +language['scripts'] = _('Scripts') +language['invalid_address'] = _('Invalid address in $A entry.') +language['global_settings'] = _('Use these settings for all networks sharing this essid') +language['encrypt_info_missing'] = _('Required encryption information is missing.') +language['enable_encryption'] = _('This network requires encryption to be enabled.') +language['wicd_auto_config'] = _('Automatic (recommended)') +language["gen_settings"] = _('General Settings') +language["ext_programs"] = _('External Programs') +language["dhcp_client"] = _('DHCP Client') +language["wired_detect"] = _('Wired Link Detection') +language["route_flush"] = _('Route Table Flushing') +language["backend"] = _('Backend') +language["backend_alert"] = _('Changes to your backend won\'t occur until the daemon is restarted.') +language['dns_domain'] = _('DNS domain') +language['search_domain'] = _('Search domain') +language['global_dns_not_enabled'] = _('Global DNS has not been enabled in general preferences.') +language['scripts_need_pass'] = _('You must enter your password to configure scripts') +language['no_sudo_prog'] = _('Could not find a graphical sudo program. The script editor could not be launched.' + + ' You\'ll have to edit scripts directly your configuration file.') + +language['interface_down'] = _('Putting interface down...') +language['resetting_ip_address'] = _('Resetting IP address...') +language['interface_up'] = _('Putting interface up...') +language['setting_encryption_info'] = _('Setting encryption info') +language['removing_old_connection'] = _('Removing old connection...') +language['generating_psk'] = _('Generating PSK...') +language['generating_wpa_config'] = _('Generating WPA configuration file...') +language['flushing_routing_table'] = _('Flushing the routing table...') +language['configuring_interface'] = _('Configuring wireless interface...') +language['validating_authentication'] = _('Validating authentication...') +language['setting_broadcast_address'] = _('Setting broadcast address...') +language['setting_static_dns'] = _('Setting static DNS servers...') +language['setting_static_ip'] = _('Setting static IP addresses...') +language['running_dhcp'] = _('Obtaining IP address...') +language['dhcp_failed'] = _('Connection Failed: Unable to Get IP Address') +language['no_dhcp_offers'] = _('Connection Failed: No DHCP offers received.') +language['aborted'] = _('Connection Cancelled') +language['bad_pass'] = _('Connection Failed: Could not authenticate (bad password?)') +language['done'] = _('Done connecting...') +language['scanning'] = _('Scanning') +language['scanning_stand_by'] = _('Scanning networks... stand by...') +language['cannot_start_daemon'] = _('Unable to connect to wicd daemon DBus interface. " + \ + "This typically means there was a problem starting the daemon. " + \ + "Check the wicd log for more info') +language['lost_dbus'] = _('The wicd daemon has shut down, the UI will not function properly until it is restarted.') +language['configuring_wireless'] = _('Configuring preferences for wireless network "$A" ($B)') +language['configuring_wired'] = _('Configuring preferences for wired profile "$A"') +language['scan'] = _('Scan') +language['always_switch_to_wired'] = _('Always switch to wired connection when available') +language['wired_autoconnect_settings'] = _('Wired Autoconnect Settings') +language['always_use_wext'] = _('You should almost always use wext as the WPA supplicant driver') +language['debugging'] = _('Debugging') +language['wpa_supplicant'] = _('WPA Supplicant') +language['automatic_reconnection'] = _('Automatic Reconnection') +language['global_dns_servers'] = _('Global DNS servers') +language['network_interfaces'] = _('Network Interfaces') +language['connecting_to_daemon'] = _('Connecting to daemon...') +language['cannot_connect_to_daemon'] = _('Can\'t connect to the daemon, trying to start it automatically...') +language['could_not_connect'] = _('Could not connect to wicd\'s D-Bus interface. Check the wicd log for error messages.') +language["exception"] = _('EXCEPTION! Please report this to the maintainer and file a bug report with the backtrace below:') +language["brought_to_you"] = _('Brought to you by:') +language["add_new_profile"] = _('Add a new profile') +language["add_new_wired_profile"] = _('Add a new wired profile') +language["no_delete_last_profile"] = _('wicd-curses does not support deleting the last wired profile. Try renaming it (\'F2\')') +language["rename_wired_profile"] = _('Rename wired profile') +language["select_hidden_essid"] = _('Select Hidden Network ESSID') +language["esc_to_cancel"] = _('Press ESC to cancel') +language["press_to_quit"] = _('Press F8 or Q to quit.') + +language['terminated'] = _('Terminated by user') +language['wicd_curses'] = _('Wicd Curses Interface') +language['dbus_fail'] = _('DBus failure! This is most likely caused by the wicd daemon stopping while wicd-curses is running. Please restart the daemon, and then restart wicd-curses.') + +# These are in the tray list, but not in the non-tray list +language['connecting'] = _('Connecting') +language['daemon_unavailable'] = _('The wicd daemon is unavailable, so your request cannot be completed') +language['no_daemon_tooltip'] = _('Wicd daemon unreachable') + +# Translations added on Wed Mar 4 03:36:24 UTC 2009 +language['make_wired_profile'] = _('To connect to a wired network, you must create a network profile. To create a network profile, type a name that describes this network, and press Add.') +language['access_cards'] = _('Wicd needs to access your computer\'s network cards.') +#language['CHANGE_ME'] = _('Create Ad-Hoc network') +#language['CHANGE_ME'] = _('Wired Autoconnect Setting:') +language['bad_pass'] = _('Connection Failed: Bad password') +language['cannot_edit_scripts_1'] = _('To avoid various complications, wicd-curses does not support directly editing the scripts directly. However, you can edit them manually. First, (as root)", open the "$A" config file, and look for the section labeled by the $B in question. In this case, this is:') +language['cannot_edit_scripts_2'] = _('Once there, you can adjust (or add) the "beforescript", "afterscript", and "disconnectscript" variables as needed, to change the preconnect, postconnect, and disconnect scripts respectively. Note that you will be specifying the full path to the scripts - not the actual script contents. You will need to add/edit the script contents separately. Refer to the wicd manual page for more information.') +language['cannot_edit_scripts_3'] = _('You can also configure the wireless networks by looking for the "[]" field in the config file.') +language['wired_networks'] = _('Wired Networks') +language['wireless_networks'] = _('Wireless Networks') +language['about'] = _('About Wicd') +language['more_help'] = _('For more detailed help, consult the wicd-curses(8) man page.') +language['case_sensitive'] = _('All controls are case sensitive') +language['help_help'] = _('Display this help dialog') +language['connect_help'] = _('Connect to selected network') +language['disconn_help'] = _('Disconnect from all networks') +language['about_help'] = _('Stop a network connection in progress') +language['refresh_help'] = _('Refresh network list') +language['prefs_help'] = _('Preferences dialog') +language['scan_help'] = _('Scan for hidden networks') +language['scripts_help'] = _('Select scripts') +language['adhoc_help'] = _('Set up Ad-hoc network') +language['config_help'] = _('Configure Selected Network') +#language[''] = _('Press H or ? for help') # Defunct in curses-uimod +language['raw_screen_arg'] = _('use urwid\'s raw screen controller') +language['ok'] = _('OK') +language['cancel'] = _('Cancel') + + diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index e69c5fd..f82dd08 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -53,6 +53,8 @@ from wicd import gui from wicd import dbusmanager from wicd.guiutil import error +from wicd.translations import language + ICON_AVAIL = True USE_EGG = False # Import egg.trayicon if we're using an older gtk version @@ -72,9 +74,6 @@ if __name__ == '__main__': daemon = wireless = wired = lost_dbus_id = None DBUS_AVAIL = False -language = misc.get_language_list_tray() - - def catchdbus(func): def wrapper(*args, **kwargs): try: @@ -179,7 +178,7 @@ class TrayIcon(object): def set_connecting_state(self, info): """ Sets the icon info for a connecting state. """ if info[0] == 'wired' and len(info) == 1: - cur_network = language['wired'] + cur_network = language['wired_network'] else: cur_network = info[1] self.tr.set_tooltip(language['connecting'] + " to " +