[nanny] Added i18n-ed packaged filters categories



commit e751f37555285e8ff8f6bdad43cc8cf8998b1935
Author: Cesar Garcia Tapia <cesar garcia tapia openshine com>
Date:   Mon Feb 1 21:40:03 2010 +0100

    Added i18n-ed packaged filters categories

 client/common/src/Categories.py                |   80 ++++++++++++++++++++++++
 client/common/src/Makefile.am                  |    1 +
 client/common/src/__init__.py                  |    1 +
 client/gnome/admin/src/ConfigureProxyDialog.py |    6 ++-
 4 files changed, 87 insertions(+), 1 deletions(-)
---
diff --git a/client/common/src/Categories.py b/client/common/src/Categories.py
new file mode 100644
index 0000000..e86cf04
--- /dev/null
+++ b/client/common/src/Categories.py
@@ -0,0 +1,80 @@
+import gettext
+import __builtin__
+__builtin__._ = gettext.gettext
+
+category_strings = {
+	"abortion": (_("abortion"), _("Abortion information excluding when related to religion")),
+	"ads": (_("ads"), _("Advert servers and banned URLs")),
+	"adult": (_("adult"), _("Sites containing adult material such as swearing but not porn")),
+	"aggressive": (_("aggressive"), _("Similar to violence but more promoting than depicting")),
+	"antispyware": (_("antispyware"), _("Sites that remove spyware")),
+	"artnudes": (_("artnudes"), _("Art sites containing artistic nudity")),
+	"astrology": (_("astrology"), _("Astrology websites")),
+	"audio-video": (_("audio-video"), _("Sites with audio or video downloads")),
+	"banking": (_("banking"), _("Banking websites")),
+	"beerliquorinfo": (_("beerliquorinfo"), _("Sites with information only on beer or liquors")),
+	"beerliquorsale": (_("beerliquorsale"), _("Sites with beer or liquors for sale")),
+	"blog": (_("blog"), _("Journal/Diary websites")),
+	"cellphones": (_("cellphones"), _("stuff for mobile/cell phones")),
+	"chat": (_("chat"), _("Sites with chat rooms etc")),
+	"childcare": (_("childcare"), _("Sites to do with childcare")),
+	"cleaning": (_("cleaning"), _("Sites to do with cleaning")),
+	"clothing": (_("clothing"), _("Sites about and selling clothing")),
+	"contraception": (_("contraception"), _("Information about contraception")),
+	"culnary": (_("culnary"), _("Sites about cooking et al")),
+	"dating": (_("dating"), _("Sites about dating")),
+	"desktopsillies": (_("desktopsillies"), _("Sites containing screen savers, backgrounds, cursers, pointers. desktop themes and similar timewasting and potentially dangerous content")),
+	"dialers": (_("dialers"), _("Sites with dialers such as those for pornography or trojans")),
+	"drugs": (_("drugs"), _("Drug related sites")),
+	"ecommerce": (_("ecommerce"), _("Sites that provide online shopping")),
+	"entertainment": (_("entertainment"), _("Sites that promote movies, books, magazine, humor")),
+	"filehosting": (_("filehosting"), _("Sites to do with filehosting")),
+	"frencheducation": (_("frencheducation"), _("Sites to do with french education")),
+	"gambling": (_("gambling"), _("Gambling sites including stocks and shares")),
+	"games": (_("games"), _("Game related sites")),
+	"gardening": (_("gardening"), _("Gardening sites")),
+	"government": (_("government"), _("Military and schools etc")),
+	"guns": (_("guns"), _("Sites with guns")),
+	"hacking": (_("hacking"), _("Hacking/cracking information")),
+	"homerepair": (_("homerepair"), _("Sites about home repair")),
+	"hygiene": (_("hygiene"), _("Sites about hygiene and other personal grooming related stuff")),
+	"instantmessaging": (_("instantmessaging"), _("Sites that contain messenger client download and web-based messaging sites")),
+	"jewelry": (_("jewelry"), _("Sites about and selling jewelry")),
+	"jobsearch": (_("jobsearch"), _("Sites for finding jobs")),
+	"kidstimewasting": (_("kidstimewasting"), _("Sites kids often waste time on")),
+	"mail": (_("mail"), _("Webmail and email sites")),
+	"marketingware": (_("marketingware"), _("Sites about marketing products")),
+	"medical": (_("medical"), _("Medical websites")),
+	"mixed_adult": (_("mixed_adult"), _("Mixed adult content sites")),
+	"mobile-phone": (_("mobile-phone"), _("Sites to do with mobile phones")),
+	"naturism": (_("naturism"), _("Sites that contain nude pictures and/or promote a nude lifestyle")),
+	"news": (_("news"), _("News sites")),
+	"onlineauctions": (_("onlineauctions"), _("Online auctions")),
+	"onlinegames": (_("onlinegames"), _("Online gaming sites")),
+	"onlinepayment": (_("onlinepayment"), _("Online payment sites")),
+	"personalfinance": (_("personalfinance"), _("Personal finance sites")),
+	"pets": (_("pets"), _("Pet sites")),
+	"phishing": (_("phishing"), _("Sites attempting to trick people into giving out private information.")),
+	"porn": (_("porn"), _("Pornography")),
+	"proxy": (_("proxy"), _("Sites with proxies to bypass filters")),
+	"radio": (_("radio"), _("non-news related radio and television")),
+	"religion": (_("religion"), _("Sites promoting religion")),
+	"ringtones": (_("ringtones"), _("Sites containing ring tones, games, pictures and other")),
+	"searchengines": (_("searchengines"), _("Search engines such as google")),
+	"sect": (_("sect"), _("Sites about eligious groups")),
+	"sexuality": (_("sexuality"), _("Sites dedicated to sexuality, possibly including adult material")),
+	"shopping": (_("shopping"), _("Shopping sites")),
+	"socialnetworking": (_("socialnetworking"), _("Social networking websites")),
+	"sportnews": (_("sportnews"), _("Sport news sites")),
+	"sports": (_("sports"), _("All sport sites")),
+	"spyware": (_("spyware"), _("Sites who run or have spyware software to download")),
+	"updatesites": (_("updatesites"), _("Sites where software updates are downloaded from including virus sigs")),
+	"vacation": (_("vacation"), _("Sites about going on holiday")),
+	"violence": (_("violence"), _("Sites containing violence")),
+	"virusinfected": (_("virusinfected"), _("Sites who host virus infected files")),
+	"warez": (_("warez"), _("Sites with illegal pirate software")),
+	"weather": (_("weather"), _("Weather news sites and weather related")),
+	"weapons": (_("weapons"), _("Sites detailing or selling weapons")),
+	"webmail": (_("webmail"), _("Just webmail sites")),
+	"whitelist": (_("whitelist"), _("Contains site specifically 100% suitable for kids"))
+}
diff --git a/client/common/src/Makefile.am b/client/common/src/Makefile.am
index 2a1b693..923357b 100644
--- a/client/common/src/Makefile.am
+++ b/client/common/src/Makefile.am
@@ -2,4 +2,5 @@ clientlibdir = $(pythondir)/nanny/client/common
 clientlib_PYTHON = __init__.py \
 		   DBusClient.py \
 		   Utils.py \
+		   Categories.py \
 		   Singleton.py
diff --git a/client/common/src/__init__.py b/client/common/src/__init__.py
index c2da13a..a6e126e 100644
--- a/client/common/src/__init__.py
+++ b/client/common/src/__init__.py
@@ -1,3 +1,4 @@
 from DBusClient import DBusClient
 from Singleton import Singleton
 from Utils import *
+from Categories import *
diff --git a/client/gnome/admin/src/ConfigureProxyDialog.py b/client/gnome/admin/src/ConfigureProxyDialog.py
index c512de3..54149b1 100644
--- a/client/gnome/admin/src/ConfigureProxyDialog.py
+++ b/client/gnome/admin/src/ConfigureProxyDialog.py
@@ -434,7 +434,11 @@ class ConfigureProxyDialog (gtk.Dialog):
                     packaged_blacklist_categories_model.append ((False, _('<b>Select all the categories</b>'), 'ALL'))
 
                 for category, user_category in categories:
-                    packaged_blacklist_categories_model.append ((user_category, category, category))
+                    if category in nanny.client.common.Categories.category_strings:
+                        category_name, category_description = nanny.client.common.Categories.category_strings[category]
+                        packaged_blacklist_categories_model.append ((user_category, "%s - %s" % (category_name, category_description), category))
+                    else:
+                        packaged_blacklist_categories_model.append ((user_category, category, category))
             else:
                 self.selected_packaged_filter_id = None
         else:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]